Skip to content

Conversation

@tode-rl
Copy link

@tode-rl tode-rl commented Nov 4, 2025

Add ability to pass a prompt as a command-line argument that executes on entering interactive mode.

Usage:
deepagents "create hello.py"
deepagents --agent mybot "review the last commit"
deepagents --auto-approve "add a new unit test"

Changes:

  • parse_args(): Detect if first positional arg is a prompt vs subcommand
  • simple_cli(): Accept and execute initial_prompt parameter
  • main(): Pass initial_prompt through
  • cli_main(): Extract prompt from args and pass to main()
  • ui.py: Update help text with [PROMPT] usage and example
  • README.md: Document command-line prompt execution feature

Add ability to pass a prompt as a command-line argument that executes before entering interactive mode.

Usage:
  deepagents "create hello.py"
  deepagents --agent mybot "review the last commit"

Changes:
- parse_args(): Detect if first positional arg is a prompt vs subcommand
- simple_cli(): Accept and execute initial_prompt parameter
- main(): Pass initial_prompt through
- cli_main(): Extract prompt from args and pass to main()
- ui.py: Update help text with [PROMPT] usage and example
- README.md: Document command-line prompt execution feature

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>
@tode-rl tode-rl changed the title feat: add command-line prompt execution feat: add option to start cli in interactive mode with arg as prompt Nov 4, 2025
@eyurtsev eyurtsev marked this pull request as ready for review November 4, 2025 19:38
@vtrivedy
Copy link
Collaborator

vtrivedy commented Nov 4, 2025

looks good with added flags, but instead of entering interactive mode it should exit after it's done

@tode-rl
Copy link
Author

tode-rl commented Nov 4, 2025

looks good with added flags, but instead of entering interactive mode it should exit after it's done

I think it can do that but I believe it should have a separate flag for this behaviour. My thought is that a larger task would benefit from having the context in the cli and the ability to do follow-ups

for a usecase like deepagents --auto-approve "Write a new unit test case" some flag like --script could exit from the loop on completion? (I've seen exec, and -p used in other clis to toggle this behaviour)

@tode-rl
Copy link
Author

tode-rl commented Nov 6, 2025

@vtrivedy Any thoughts on #284 (comment)? I can do in a follow-up if you're ok with adding another arg in the cli. I don't mind the cli exiting after complete but would like some control over it

@vtrivedy
Copy link
Collaborator

vtrivedy commented Nov 6, 2025

agree on separate flag, we're leaning towards having the "exec" style only right now (shell exits) to bootstrap the run. if you want to make a new PR we can review it today

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.

3 participants