Usage
Description
Theagent command provides direct interaction with the nanobot AI assistant. It supports both single-message mode (for scripts and quick queries) and interactive mode (for ongoing conversations).
Modes
Single Message Mode
Send a single message and get a response:Interactive Mode
Start a persistent conversation (default when no message is provided):Options
Message to send to the agent. If provided, runs in single-message mode.Required: No
Default: None (starts interactive mode)
Default: None (starts interactive mode)
Session ID for conversation context. Sessions maintain chat history and context across multiple invocations.Required: No
Default:
Format:
Default:
"cli:direct"Format:
channel:chat_id or simple identifierRender assistant responses as formatted Markdown.Required: No
Default:
Toggle: Use
Default:
trueToggle: Use
--markdown or --no-markdownShow detailed runtime logs during agent execution. Useful for debugging tool usage, API calls, and internal operations.Required: No
Default:
Toggle: Use
Default:
falseToggle: Use
--logs or --no-logsExamples
Quick Question
Code Generation
Multi-Turn Conversation
With Debug Logs
Plain Text Output
Interactive Mode Features
Command History
Use arrow keys to navigate previous commands:- Up Arrow: Previous command
- Down Arrow: Next command
~/.nanobot/history/cli_history
Multiline Paste
Paste multiple lines of text (code, documents) directly:Exit Commands
Any of these will exit:exitquit/exit/quit:qCtrl+CCtrl+D(EOF)
Progress Indicators
When--logs is disabled (default), a spinner shows the agent is thinking:
--logs is enabled, you see detailed tool usage:
Sessions
Sessions maintain conversation context, including:- Chat history
- Agent memory
- Tool state
- User preferences
Session IDs
Format:channel:chat_id
Examples:
cli:direct(default)cli:project-alphatelegram:123456debugging
Persistent Sessions
Sessions are stored in~/.nanobot/workspace/sessions/:
Clear Session
To start fresh, delete the session file:Configuration
The agent command uses settings from~/.nanobot/config.json:
Exit Codes
- 0: Success
- 1: Error (API key missing, network failure, etc.)
- 130: Interrupted by user (Ctrl+C)
Error Handling
No API Key
Model Not Available
Network Error
Terminal Requirements
Supported Terminals
- Most modern terminals (iTerm2, Terminal.app, GNOME Terminal, etc.)
- Supports ANSI color codes
- UTF-8 encoding
Terminal Features Used
- Bracketed paste mode: Multiline paste
- ANSI colors: Formatted output
- Spinner animation: Progress indicator
- Rich formatting: Markdown rendering
Terminal Issues
Colors not working:Performance Tips
Faster Responses
Use cheaper/faster models for simple queries:Reduce Token Usage
Limit max tokens:Disable Tools
For simple chat without tool usage:Integration with Scripts
Shell Script
Python Script
Related Commands
- gateway - Run agent as background service
- status - Check configuration and model
- onboard - Initialize configuration