chore: use more conventional XDG_CONFIG_HOME for config
This commit is contained in:
26
README.md
26
README.md
@@ -21,10 +21,10 @@ bun install # or use `mise install`
|
||||
**1. Create a config file**
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.nanobot
|
||||
mkdir -p ~/.config/nanobot
|
||||
```
|
||||
|
||||
`~/.nanobot/config.json`:
|
||||
`~/.config/nanobot/config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -59,7 +59,7 @@ bun run nanobot agent [options]
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `-c, --config <path>` | Path to `config.json` (default: `~/.nanobot/config.json`) |
|
||||
| `-c, --config <path>` | Path to `config.json` (default: `~/.config/nanobot/config.json`) |
|
||||
| `-m, --message <text>` | Send a single message and exit (non-interactive) |
|
||||
| `-M, --model <model>` | Override the model for this session |
|
||||
|
||||
@@ -67,7 +67,7 @@ bun run nanobot agent [options]
|
||||
|
||||
```bash
|
||||
bun run nanobot agent
|
||||
bun run nanobot agent -c ~/.nanobot-work/config.json
|
||||
bun run nanobot agent -c ~/.config/nanobot-work/config.json
|
||||
bun run nanobot agent -w /tmp/scratch
|
||||
```
|
||||
|
||||
@@ -90,18 +90,18 @@ bun run nanobot gateway [options]
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `-c, --config <path>` | Path to `config.json` (default: `~/.nanobot/config.json`) |
|
||||
| `-c, --config <path>` | Path to `config.json` (default: `~/.config/nanobot/config.json`) |
|
||||
|
||||
```bash
|
||||
bun run nanobot gateway
|
||||
bun run nanobot gateway -c ~/.nanobot-work/config.json
|
||||
bun run nanobot gateway -c ~/.config/nanobot-work/config.json
|
||||
```
|
||||
|
||||
Handles `SIGINT` / `SIGTERM` for graceful shutdown.
|
||||
|
||||
## Configuration
|
||||
|
||||
Config file: `~/.nanobot/config.json` (or pass `-c <path>` to any command).
|
||||
Config file: `~/.config/nanobot/config.json` (or pass `-c <path>` to any command).
|
||||
|
||||
Environment variable overrides:
|
||||
|
||||
@@ -116,7 +116,7 @@ Environment variable overrides:
|
||||
{
|
||||
"agent": {
|
||||
"model": "openrouter/anthropic/claude-sonnet-4-5",
|
||||
"workspacePath": "~/.nanobot",
|
||||
"workspacePath": "~/.config/nanobot",
|
||||
"maxTokens": 4096,
|
||||
"contextWindowTokens": 65536,
|
||||
"temperature": 0.7,
|
||||
@@ -231,10 +231,10 @@ Run separate instances with different configs — useful for isolated workspaces
|
||||
|
||||
```bash
|
||||
# Instance A
|
||||
bun run nanobot gateway -c ~/.nanobot-a/config.json
|
||||
bun run nanobot gateway -c ~/.config/nanobot-a/config.json
|
||||
|
||||
# Instance B
|
||||
bun run nanobot gateway -c ~/.nanobot-b/config.json
|
||||
bun run nanobot gateway -c ~/.config/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:
|
||||
@@ -242,7 +242,7 @@ Each instance needs its own config file. Set a different `agent.workspacePath` p
|
||||
```json
|
||||
{
|
||||
"agent": {
|
||||
"workspacePath": "~/.nanobot-a"
|
||||
"workspacePath": "~/.config/nanobot-a"
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -250,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 nanobot agent -c ~/.nanobot-a/config.json -m "Hello"
|
||||
bun run nanobot agent -c ~/.config/nanobot-a/config.json -m "Hello"
|
||||
|
||||
# Temporarily override the workspace for a one-off run
|
||||
bun run nanobot agent -c ~/.nanobot-a/config.json -w /tmp/scratch
|
||||
bun run nanobot agent -c ~/.config/nanobot-a/config.json -w /tmp/scratch
|
||||
```
|
||||
|
||||
## Linux service (systemd)
|
||||
|
||||
Reference in New Issue
Block a user