Add file argument support to llm command#189
Merged
Merged
Conversation
Accept file paths after the prompt; each is read, prefixed with a `===== <name> =====` header, and concatenated as the prompt's context, then sent in a single gateway call. This collapses the common shell-glue pattern of `cat`-ing notes into a pipe — e.g. `assembly llm "... Question: ..." notes/*.md` instead of building a file array and piping it in. Precedence for one-shot input is now --transcript-id > files > stdin; a higher-priority source present alongside a lower one ignores the lower with a visible warning (suppressed by --quiet, structured under --json). A missing/unreadable path is a usage error raised before auth or network. File arguments are rejected in --follow mode, which runs over live stdin. Split the --follow live-mode tests out of test_llm_command.py into test_llm_follow.py to keep both files under the 500-line gate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WMZ8fCo2D2giFUfkwc4jUa
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.
Adds the ability to pass one or more file paths as arguments to the
assembly llmcommand, allowing files to be read and used as context for the prompt. This complements the existing transcript-ID and stdin input modes.Key changes
filesargument to thellmcommand that accepts zero or more file paths, each read and concatenated with===== filename =====headers for clarity in multi-file contexts--transcript-id> file arguments > piped stdin. When a higher-priority source is present alongside a lower one, the lower is ignored with a visible warning (suppressed by--quiet, structured under--json)--followincompatibility: File arguments are rejected when combined with--follow(which operates on live stdin), matching the existing--transcript-idrestriction--follow-specific tests to a newtests/test_llm_follow.pyfile for better organization; added comprehensive tests for file handling, priority ordering, and edge casesImplementation details
_read_files()reads each file with UTF-8 encoding and joins sections with blank lines_input_text()(renamed from_stdin_transcript_text()) now handles all three input sources with proper priority logic_ignored_sources()helper generates user-friendly warning messages naming which inputs are being ignoredhttps://claude.ai/code/session_01WMZ8fCo2D2giFUfkwc4jUa