Skip to content

Add file argument support to llm command#189

Merged
alexkroman merged 1 commit into
mainfrom
claude/inspiring-faraday-5y37n4
Jun 16, 2026
Merged

Add file argument support to llm command#189
alexkroman merged 1 commit into
mainfrom
claude/inspiring-faraday-5y37n4

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Adds the ability to pass one or more file paths as arguments to the assembly llm command, allowing files to be read and used as context for the prompt. This complements the existing transcript-ID and stdin input modes.

Key changes

  • New files argument to the llm command that accepts zero or more file paths, each read and concatenated with ===== filename ===== headers for clarity in multi-file contexts
  • Input priority ordering: --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)
  • Validation: Missing or unreadable files raise a usage error (exit code 2) before auth or network calls, with clean OS error messages (no raw exception repr)
  • --follow incompatibility: File arguments are rejected when combined with --follow (which operates on live stdin), matching the existing --transcript-id restriction
  • Test reorganization: Moved all --follow-specific tests to a new tests/test_llm_follow.py file for better organization; added comprehensive tests for file handling, priority ordering, and edge cases

Implementation 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 ignored
  • Help text and README updated to document the new file argument capability

https://claude.ai/code/session_01WMZ8fCo2D2giFUfkwc4jUa

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
@alexkroman alexkroman enabled auto-merge June 16, 2026 20:58
@alexkroman alexkroman added this pull request to the merge queue Jun 16, 2026
Merged via the queue into main with commit fa9e35d Jun 16, 2026
19 checks passed
@alexkroman alexkroman deleted the claude/inspiring-faraday-5y37n4 branch June 16, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants