AgentFS CLI
Use agentfs to inspect a file tree with explicit limits so the result stays cheap enough for low-compute systems and downstream agent parsing.
Invoke the Tool
Prefer the installed binary when it exists:
agentfs -root . -max-depth 2 -format json
If working inside this repository or the binary is not installed, run:
go run ./cmd/agentfs -- -root . -max-depth 2 -format json
Choose Flags
- Use
-rootto set the inspection root. - Use
-max-depthto keep traversal bounded. - Use
-max-entriesto avoid oversized snapshots. - Use
-preview-linesfor cheap text previews. - Use
-hashonly when content integrity matters. - Use
-hiddenonly when hidden files are relevant. - Use
-format jsonor-format yamlfor automation,textfor review.
Apply Good Defaults
- Keep depth and entry limits conservative unless the task explicitly needs more.
- Prefer previews over full file reads when building context.
- Hash only a small set of files, since hashing scales with file size.
Examples
Take a bounded repo snapshot:
go run ./cmd/agentfs -- -root . -max-depth 2 -preview-lines 2
Inspect logs in text form:
go run ./cmd/agentfs -- -root /var/log -max-depth 1 -preview-lines 3 -format text