Introduction
The nanobot CLI provides a complete command-line interface for managing your personal AI assistant. The CLI supports interactive chat, background gateway services, channel management, and configuration.Installation
Install nanobot via pip:Quick Start
1. Initialize Configuration
Create the default configuration and workspace:2. Configure API Key
Edit~/.nanobot/config.json and add your API key:
3. Chat with the Agent
Single message:Command Structure
The CLI follows this pattern:Available Commands
agent
Interactive chat with the AI agent
gateway
Start the background gateway service
onboard
Initialize configuration and workspace
status
Show system status and configuration
channels
Manage chat channels (WhatsApp, Telegram, etc.)
provider
Authenticate with OAuth providers
Global Options
Display the nanobot version and exit
Show help message for any command
Configuration Files
Config Location
- Config file:
~/.nanobot/config.json - Workspace:
~/.nanobot/workspace/ - History:
~/.nanobot/history/cli_history - Cron jobs:
~/.nanobot/cron/jobs.json
Workspace Structure
Exit Codes
The CLI uses standard exit codes:- 0: Success
- 1: Error (configuration, authentication, runtime)
- 130: Interrupted by user (Ctrl+C)
Environment Variables
Authentication token for WhatsApp bridge (optional)
Error Handling
Common Errors
No API key configured:Interactive Mode
In interactive mode, the CLI provides:- Multiline paste (bracketed paste mode)
- Command history (up/down arrows)
- Tab completion (context-aware)
- Clean display (no terminal artifacts)
Exit Commands
Any of these commands will exit interactive mode:exitquit/exit/quit:qCtrl+CCtrl+D
Signal Handling
The CLI handles these signals gracefully:- SIGINT (Ctrl+C): Clean shutdown
- SIGTERM: Clean shutdown
- SIGHUP: Clean shutdown
- SIGPIPE: Ignored (prevents crash on broken pipes)
Logging
Enable debug logging for troubleshooting:Next Steps
Agent Command
Learn about interactive chat and options
Gateway Service
Set up background service for channels
Configuration
Customize agent behavior and settings
Channels
Connect WhatsApp, Telegram, and more