add list command to display vault contents#73
Conversation
- Implemented `list` command to list files and folders in a vault. - Updated README with usage examples for the new command. - Added tests for `ListEntries` function to ensure correct functionality.
|
Thank you for contributing! The functionality itself looks good on a brief review but I can see some improvements e.g.
|
|
Sure... On it... |
- Simplified ListEntries by delegating to obsidian.ListEntries. - Removed unnecessary error handling and directory checks. - Added new list.go file to encapsulate list-related functionality. - Updated documentation images for usage and output.
There was a problem hiding this comment.
Pull request overview
This PR adds a list command to enable users to browse vault contents through the CLI without relying on external filesystem tools. The implementation follows established patterns in the codebase for command structure, error handling, and action delegation.
Changes:
- Implemented
ListEntriesfunction in the obsidian package to read and filter directory contents - Added
ListEntriesaction wrapper following the VaultManager interface pattern - Created
listCLI command withlsalias supporting optional path argument and vault flag
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/obsidian/list.go | Core listing logic with path validation, hidden file filtering, and alphabetical sorting |
| pkg/actions/list.go | Action layer wrapper connecting vault manager to obsidian package |
| pkg/actions/list_test.go | Comprehensive test suite for the actions layer covering various scenarios |
| cmd/list.go | CLI command implementation with argument parsing and output formatting |
| README.md | Documentation update adding list command to capabilities and usage examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Verify sorting of directories and files. - Ensure hidden files and folders are filtered out. - Check that empty directories return an empty list. - Validate error handling for non-directory paths. - Reject path traversal attempts.
|
Can you provide guideline how to do it... I tried multiple times still same results... |
|
I just use the |
- Replace the existing usage.png with an updated version. - Ensure the image reflects the latest features and commands.
Yakitrak
left a comment
There was a problem hiding this comment.
LGTM, thanks for contributing! I will do a release soon in the next week or so (with another change I might work on).



Add list command to display vault contents
Add vault listing command
Description
listcommand to list files and folders in a vault.ListEntriesaction for vault-relative directory listing.ListEntries.list.Motivation and Context
Users need to discover vault structure without relying on filesystem commands or absolute paths. This adds a native CLI command to list vault contents at the root or a subfolder.
Checklist: