diff --git a/README.md b/README.md index d0e993c..a004da7 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ mkdir -p ~/.nanobot **2. Chat** ```bash -bun run start agent +bun run nanobot agent ``` That's it. @@ -54,22 +54,21 @@ That's it. Chat with the agent from your terminal. Does not require a running gateway. ``` -bun run start agent [options] +bun run nanobot agent [options] ``` | Option | Description | |--------|-------------| | `-c, --config ` | Path to `config.json` (default: `~/.nanobot/config.json`) | | `-m, --message ` | Send a single message and exit (non-interactive) | -| `-w, --workspace ` | Override the workspace directory | | `-M, --model ` | Override the model for this session | **Interactive mode** (default when no `-m` is given): ```bash -bun run start agent -bun run start agent -c ~/.nanobot-work/config.json -bun run start agent -w /tmp/scratch +bun run nanobot agent +bun run nanobot agent -c ~/.nanobot-work/config.json +bun run nanobot agent -w /tmp/scratch ``` Press `Ctrl+C` to exit. @@ -77,8 +76,8 @@ Press `Ctrl+C` to exit. **Single-shot mode:** ```bash -bun run start agent -m "What time is it in Tokyo?" -bun run start agent -m "Summarize the file ./notes.md" +bun run nanobot agent -m "What time is it in Tokyo?" +bun run nanobot agent -m "Summarize the file ./notes.md" ``` ### `gateway` — Mattermost bot @@ -86,7 +85,7 @@ bun run start agent -m "Summarize the file ./notes.md" Runs the full stack: Mattermost WebSocket channel, agent loop, cron scheduler, and heartbeat. ``` -bun run start gateway [options] +bun run nanobot gateway [options] ``` | Option | Description | @@ -94,8 +93,8 @@ bun run start gateway [options] | `-c, --config ` | Path to `config.json` (default: `~/.nanobot/config.json`) | ```bash -bun run start gateway -bun run start gateway -c ~/.nanobot-work/config.json +bun run nanobot gateway +bun run nanobot gateway -c ~/.nanobot-work/config.json ``` Handles `SIGINT` / `SIGTERM` for graceful shutdown. @@ -110,7 +109,6 @@ Environment variable overrides: |----------|-------------------| | `NANOBOT_CONFIG` | path to config file | | `NANOBOT_MODEL` | `agent.model` | -| `NANOBOT_WORKSPACE` | `agent.workspacePath` | ### Full config reference @@ -198,7 +196,7 @@ For Ollama, set `providers.ollama.apiBase` (default: `http://localhost:11434/api } ``` -4. Run `bun run start gateway` +4. Run `bun run nanobot gateway` `allowFrom` controls which users the bot responds to. Use `["*"]` to allow all users. @@ -233,10 +231,10 @@ Run separate instances with different configs — useful for isolated workspaces ```bash # Instance A -bun run start gateway -c ~/.nanobot-a/config.json +bun run nanobot gateway -c ~/.nanobot-a/config.json # Instance B -bun run start gateway -c ~/.nanobot-b/config.json +bun run nanobot gateway -c ~/.nanobot-b/config.json ``` Each instance needs its own config file. Set a different `agent.workspacePath` per instance to keep memory, sessions, and cron jobs isolated: @@ -252,10 +250,10 @@ Each instance needs its own config file. Set a different `agent.workspacePath` p To run a local CLI session against a specific instance: ```bash -bun run start agent -c ~/.nanobot-a/config.json -m "Hello" +bun run nanobot agent -c ~/.nanobot-a/config.json -m "Hello" # Temporarily override the workspace for a one-off run -bun run start agent -c ~/.nanobot-a/config.json -w /tmp/scratch +bun run nanobot agent -c ~/.nanobot-a/config.json -w /tmp/scratch ``` ## Linux service (systemd) diff --git a/package.json b/package.json index f2c8253..4a7596c 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "type": "module", "module": "index.ts", "scripts": { - "start": "bun run index.ts", + "nanobot": "bun run index.ts", "dev": "bun --watch run index.ts", "typecheck": "tsc --noEmit", "fmt": "oxfmt --check", diff --git a/src/cli/agent.ts b/src/cli/agent.ts index a920d69..ee9304e 100644 --- a/src/cli/agent.ts +++ b/src/cli/agent.ts @@ -13,12 +13,10 @@ export function agentCommand(program: Command, config: Config, workspace: string program .command('agent') .description('Run the agent interactively or send a single message.') - .option('-c, --config ', 'Path to config.json') .option('-m, --message ', 'Single message to process (non-interactive)') - .option('-w, --workspace ', 'Workspace path override') .option('-M, --model ', 'Model override') .action( - async (opts: { config?: string; message?: string; workspace?: string; model?: string }) => { + async (opts: { config?: string; message?: string; model?: string }) => { const model = opts.model ?? config.agent.model; const provider = makeProvider( config.providers, diff --git a/src/cli/commands.ts b/src/cli/commands.ts index 7e325ee..84c77ee 100644 --- a/src/cli/commands.ts +++ b/src/cli/commands.ts @@ -7,6 +7,7 @@ import { gatewayCommand } from './gateway.ts'; export function createCli(): Command { const program = new Command('nanobot') .description('nanobot — personal AI assistant') + .option('-c, --config ', 'Path to config.json') .version('1.0.0'); const globalOpts = program.opts(); diff --git a/src/cli/gateway.ts b/src/cli/gateway.ts index 76726b4..84f56c5 100644 --- a/src/cli/gateway.ts +++ b/src/cli/gateway.ts @@ -16,7 +16,6 @@ export function gatewayCommand(program: Command, config: Config, workspace: stri program .command('gateway') .description('Start the full gateway: Mattermost channel, agent loop, cron, and heartbeat.') - .option('-c, --config ', 'Path to config.json') .action(async (_opts: { config?: string }) => { const provider = makeProvider( config.providers,