HTTP + SSE API service for AtomCode AI agent with file operation tools.
- Node.js >= 18.0.0
- AtomCode CLI — installed and logged in (
atomcode login) - config.toml — auto-generated at
~/.atomcode/config.tomlafter first login
# 1. Clone the repository
git clone https://github.com/Rosenbad/atomcode-daemon.git
cd atomcode-daemon
# 2. Install dependencies
npm install
# 3. Start the server
npm startYou'll see:
🌐 http://127.0.0.1:18788
🔧 CLI available: true
Open http://127.0.0.1:18788 in your browser to use the web UI.
- The daemon reads your AtomCode configuration from
~/.atomcode/config.tomlautomatically. - It spawns the
atomcodeCLI in headless mode (atomcode -p "...") for AI responses. - All providers defined in your config.toml appear in the UI dropdown.
- The CLI has built-in file tools — no separate tool server is needed.
- Sessions and messages are stored locally in
data/store.json.
Create or edit ~/.atomcode/config.toml:
default_provider = "openai"
[providers.openai]
type = "openai"
api_key = "sk-your-key"
model = "gpt-4o"
base_url = "https://api.openai.com/v1"
[daemon]
host = "127.0.0.1"
port = 18788The daemon hot-reloads config.toml when it changes — no restart needed.
- HTTP API with SSE streaming chat
- Web UI for browser-based interaction
- CLI Mode — uses atomcode CLI headless mode with built-in file tools
- API Mode — direct OpenAI-compatible API calls for Vision models
- Image Analysis — vision API support
- Session Management — persistent conversation history (local)
- Authentication — optional token-based auth
- Directory Switching — change working directory from UI or
/cdendpoint
POST /chat— SSE streaming chatPOST /chat/stop— Stop ongoing chat
GET /sessions— List sessionsPOST /sessions— Create new sessionGET /sessions/search?q=query— Search sessions
GET /tools— List available toolsGET /tools/file/read?path=...— Read filePOST /tools/file/write— Write filePOST /tools/file/edit— Search and replaceGET /tools/dir/list— List directoryPOST /tools/bash— Execute commandGET /tools/grep?pattern=...— Search in filesGET /tools/glob?pattern=...— Find files
GET /health— Health checkGET /models— List available modelsPOST /config/reload— Reload configurationPOST /cd— Change working directory
Enable authentication by setting environment variables:
ATOMCODE_AUTH_ENABLED=true
ATOMCODE_ADMIN_KEY=your-admin-keyThen use the token in requests:
curl -H "Authorization: Bearer <token>" http://localhost:18788/tools/file/read?path=README.md- The daemon must be running while you use the web UI.
- The
data/directory stores session history. Deleting it resets all conversations. - The daemon binds to
127.0.0.1by default — not accessible from other machines. - If
CLI available: false, make sureatomcodeis in your PATH or installed atD:\AtomCode\. - Windows users: the daemon searches common AtomCode install paths automatically.
atomcode-daemon/
├── src/
│ ├── index.js # Main server
│ ├── config.js # Configuration management + hot reload
│ ├── auth.js # Token authentication
│ ├── store.js # Session storage (local JSON)
│ ├── engine.js # AI engine (CLI + API modes)
│ ├── tools.js # 10 file/shell operations
│ ├── toml-parser.js # TOML config parser
│ ├── logger.js # Structured logging
│ └── web-ui.js # Static file serving
├── public/
│ └── index.html # Web UI
├── data/
│ └── store.json # Session data (generated at runtime)
├── .gitignore
├── package.json
└── README.md
| Variable | Description | Default |
|---|---|---|
ATOMCODE_AUTH_ENABLED |
Enable token authentication | false |
ATOMCODE_ADMIN_KEY |
Admin key for token management | - |
ATOMCODE_CORS_ORIGIN |
CORS origin | * |
LOG_LEVEL |
Log level (DEBUG, INFO, WARN, ERROR) | INFO |
MIT