Repository navigation
feat: Add get CLI subcommand for programmatic artifact retrieval - #10
Merged
Merged
Conversation
Adds `fava-trails get <scope>` with three modes: - Default: output latest non-superseded thought content to stdout - `--list`: list child scope names (for directory-style enumeration) - `--exists`: exit 0/1 for existence checks (no output) - `--with-frontmatter`: include YAML frontmatter in output Strict stdout hygiene — only requested content goes to stdout, all errors/diagnostics go to stderr. This enables reliable parsing by tools like porch that consume stdout with regex. Spec 559: Porch FAVA Trails Artifact Resolver Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Make --list and --exists mutually exclusive (argparse group) - Use is_dir() instead of exists() before directory operations Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…a-trails-artifact-resolver
…a-trails-artifact-resolver
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.
Summary
fava-trails get <scope-path>CLI subcommand for programmatic content retrieval--list(list children),--exists(exit code check)is_dir()checks)Context
This is Track 1 of Spec 559 (Porch FAVA Trails Artifact Resolver). Track 2 (porch-side resolver abstraction) is in a separate PR against the codev repo.
Test plan
fava-trails get mwai/eng/best-practices/codev-assets/specs/559-porch-fava-trails-artifact-resolverreturns spec contentfava-trails get --list mwai/eng/best-practices/codev-assets/specslists spec childrenfava-trails get --exists mwai/eng/best-practices/codev-assets/specs/559-porch-fava-trails-artifact-resolverexits 0fava-trails get --exists mwai/eng/nonexistentexits 1--listand--existsare mutually exclusive (argparse error)🤖 Generated with Claude Code