Skip to content

feat: support --file flag and --issue URL for autopilot start#68

Merged
chanakyav merged 1 commit intomainfrom
feature/file-prompt-and-issue-url
Mar 24, 2026
Merged

feat: support --file flag and --issue URL for autopilot start#68
chanakyav merged 1 commit intomainfrom
feature/file-prompt-and-issue-url

Conversation

@chanakyav
Copy link
Copy Markdown
Owner

Description

Support reading prompts from a file (--file / -f) and full GitHub issue URLs in --issue, improving how users provide task prompts to autopilot.

Closes #40
Closes #67

--file / -f flag (#67)

Users with long or complex prompts can now write them to a file instead of pasting into CLI args:

autopilot start --file my-task.txt
autopilot start -f instructions.md

Prompt file protection (two layers):

  1. Git exclusion -- file path dynamically added to .git/info/exclude (local-only, never committed). Prevents the file from being staged even if the agent runs git add ..
  2. Agent instruction -- explicit instruction prepended to all prompt builders telling the agent not to read, modify, rename, delete, or commit the file.

Full prompt logging -- agent.py now logs the full prompt at INFO level (was truncated to 100 chars). Prompt source (file/CLI/issue) and length are logged at task start.

--issue URL support (#40)

--issue now accepts full GitHub URLs for cross-repo issue fetching:

autopilot start --issue 123                                        # same repo (backward compatible)
autopilot start --issue https://github.com/org/repo/issues/45      # cross-repo

Other changes

  • --prompt, --issue, and --file are now mutually exclusive (exactly one required)
  • Schema v6: prompt_file column with migration
  • 24 new tests across cli, orchestrator, persistence
  • README commands table updated

Checklist

  • Ran ruff check src/ tests/ -- no errors
  • Ran python -m pytest tests/ -- all tests pass (245 passed)
  • No unused imports or variables
  • Added tests for new functionality (if applicable)
  • Linked related issue above (if applicable)

🤖 autopilot-loop

Add --file / -f flag to read prompt from a plain text file, avoiding
shell escaping and truncation issues with long CLI prompts. The prompt
file is protected from agent edits via two layers:
1. Dynamically added to .git/info/exclude (prevents commit)
2. Explicit agent instruction prepended to all prompt builders

Add full GitHub issue URL support for --issue (e.g.
https://github.com/org/repo/issues/45) with cross-repo fetch via
--repo flag on gh issue view. Plain numbers still work (backward
compatible).

Other changes:
- --prompt, --issue, --file are now mutually exclusive
- Full prompt logged at INFO level (was truncated to 100 chars)
- Prompt source and length logged at task start
- Schema v6: prompt_file column with migration
- 24 new tests across cli, orchestrator, persistence

Closes #40
Closes #67
@chanakyav chanakyav marked this pull request as ready for review March 24, 2026 18:39
@chanakyav chanakyav merged commit 94498f5 into main Mar 24, 2026
3 checks passed
@chanakyav chanakyav deleted the feature/file-prompt-and-issue-url branch March 25, 2026 01:53
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.

Support reading prompt from a file via --file / -f flag Support full GitHub issue URLs in --issue flag

1 participant