feat(ls): support -d/--directory to list directories themselves#2134
Merged
Conversation
Implements `ls -d` / `ls --directory`, which lists directory entries themselves rather than descending into their contents (POSIX). This unblocks the very common `ls -d */` idiom for enumerating subdirectories. Directory arguments are treated like ordinary non-directory entries when -d is set; `-F` still appends the trailing `/` because the classify suffix keys off the entry metadata. Closes #2127
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 7d1a465 | Commit Preview URL Branch Preview URL |
Jun 28 2026, 09:23 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
ls -d/ls --directory(list directory entries themselves, not their contents) was not implemented — bashkit returnedls: option(s) not yet implemented in bashkit: directory. This blocks the extremely commonls -d */idiom for enumerating subdirectories.Found in the LLM eval run 2026-06-27 (mira harness), task
file_path_organizer.Closes #2127.
Changes
crates/bashkit/src/builtins/ls/list.rs: adddirectoryto the supported-arg allowlist; thread adirectoryflag throughLsOptions; when set, treat directory arguments like ordinary non-directory entries (list the entry itself rather than descending).-Fstill appends the trailing/because the classify suffix keys off the entry metadata.crates/bashkit/src/builtins/ls/tests.rs: tests for-d,--directory, multiple directory args (thels -d */case), and-dFclassify suffix.crates/bashkit/docs/compatibility.md: refresh thelssupported-flag list (also adds previously-undocumented-t/-F/-C).Testing
cargo test -p bashkit --features http_client,ssh,sqlite --lib builtins::ls::tests::test_ls_directory→ 4 passed.Generated by Claude Code