The CLI channel is the simplest way to interact with your Corvus agent. It uses standard input/output (stdin/stdout) and requires zero configuration or external services.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dallay/corvus/llms.txt
Use this file to discover all available pages before exploring further.
Features
- Zero dependencies (no API tokens, no network)
- Interactive REPL-style conversation
- Single-message mode for scripting
- Always available (no setup required)
- Exit commands (
/quit,/exit) - Direct terminal output
CLI Agent Command Usage
Corvus provides two primary modes for CLI interaction:Interactive Mode
Start an interactive conversation session:- Multi-turn conversation with context
- Typing indicators
- Response timing
- Exit commands
Single Message Mode
Send a single message and get a response:- Scripting and automation
- CI/CD pipelines
- One-off queries
- Batch processing
File Input Mode
Read message from a file:Command-Line Options
Options
| Flag | Long Form | Argument | Description |
|---|---|---|---|
-m | --message | <TEXT> | Send single message and exit |
-h | --help | - | Display help information |
Examples
Interactive conversation:Interactive Mode Features
Exit Commands
End the session with:Empty Lines
Empty lines are ignored - press Enter again to continue:Multi-line Input
Currently, messages are sent on Enter. For multi-line input, use escape sequences:Output Formatting
Standard Output
All agent responses are written to stdout:- 🤖 emoji prefix
Replylabel- Response time in milliseconds
- Actual response text
Progress Indicators
While processing:Error Output
Errors are written to stderr:Session Start/End
Interactive mode shows:Configuration
The CLI channel requires no channel-specific configuration. It uses the agent’s global settings from~/.corvus/config.toml:
Technical Details
Implementation
The CLI channel is defined inclients/agent-runtime/src/channels/cli.rs:
send()writes to stdout viaprintln!listen()reads from stdin line-by-line- Exit commands break the listen loop
- Empty lines are filtered out
- Messages use UUID for unique IDs
- Sender and recipient are both
"user"
Message Flow
- User types message and presses Enter
- CLI channel creates
ChannelMessage: - Message is sent to agent orchestration loop
- Agent processes with LLM + tools
- Response is sent back via
send() println!writes response to terminal
No Streaming Support
The CLI channel does not support draft updates (supports_draft_updates() returns false).
Responses are printed as complete messages after processing.
Scripting Examples
Batch File Processing
Process multiple files:CI/CD Integration
Generate PR descriptions:Log Analysis
Analyze error logs:JSON Output Parsing
Extract structured data:Comparison with Other Channels
| Feature | CLI | Telegram | Discord | |
|---|---|---|---|---|
| Setup | None | BotFather | Discord App | Meta Business App |
| Network | No | Yes | Yes | Yes |
| Streaming | No | Yes | Partial | No |
| Allowlist | N/A | Username/ID | User ID | Phone Number |
| Interactive | Yes | Yes | Yes | Yes |
| Single Message | Yes | No | No | No |
| Scripting | Yes | No | No | No |
Troubleshooting
Interactive Mode Not Starting
Symptom: Command hangs without prompt. Cause: Agent configuration issue (missing API key, invalid model). Solution: Verify configuration:No Response to Message
Symptom: Message sent, but no reply. Cause: Provider API error. Solution: Check logs for errors:Exit Commands Not Working
Symptom:/quit or /exit treated as regular messages.
Cause: CLI channel should catch these commands in listen().
Solution: This is a bug - please report at GitHub Issues.
Workaround: Press Ctrl+C to force exit.
Piped Input Not Working
Symptom:echo "message" | corvus agent hangs.
Cause: Interactive mode waits for stdin close.
Solution: Use single message mode instead:
Best Practices
- Use
-mfor Automation: Single message mode is more reliable for scripts - Quote Complex Messages: Always quote messages with spaces or special characters
- Check Exit Codes: Corvus returns non-zero on errors for scripting
- Limit Context: CLI messages are stateless - include all necessary context
- Capture Output: Redirect stdout to files for processing:
Future Enhancements
- Multi-line input editor: Press
Ctrl+Dto submit multi-line messages - History navigation: Arrow keys to recall previous messages
- Syntax highlighting: Colorized code blocks in responses
- Streaming output: Progressive token-by-token display
- JSON mode: Structured output format for scripting
Reference
- Source:
clients/agent-runtime/src/channels/cli.rs - Channel trait:
clients/agent-runtime/src/channels/traits.rs - Agent commands:
clients/agent-runtime/src/main.rs - Line range:
cli.rs:1-134