ChatCLI’s one-shot mode allows you to run prompts in a single line, ideal for scripts, CI/CD pipelines, and automations.
Basic One-Shot Mode
Use the -p flag to send a prompt and exit immediately:
All context features work within the prompt:
Pipes and stdin
ChatCLI accepts input via pipe, combining the output of other commands with your prompt:
Available Flags
One-Shot Agent Mode
Combine /agent in the prompt to delegate tasks:
With --agent-auto-exec, dangerous commands are automatically blocked. Only commands considered safe will be executed.
Automation Examples
Generate release notes automatically
Review PR in CI
Analyze logs in a cron job
One-shot with a specific provider
Create an alias in your shell for quick access: alias c='chatcli' and alias ai='chatcli -p'. Then use: ai "Explain what this command does: iptables -t nat -L"
- Use
--no-anim in all scripts to avoid escape characters in the output
- Combine with
> to redirect output to files
- Use
--timeout to prevent scripts from hanging while waiting for a response
- Double quotes are important:
chatcli -p "text with @file and @git" (protects against shell interpretation)