| name | add-adminapi |
| description | Add a token-authenticated HTTP admin API for NanoClaw agent groups (CRUD + config + restart). Installs nanoclaw-adminapi and a thin host adapter. |
/add-adminapi โ Remote Admin HTTP API
Adds a localhost HTTP faรงade over ncl groups so remote control planes and automation can manage agent groups without SSH.
See also: QUICKSTART.md in the npm package.
Prerequisites
- Node.js โฅ 20 (CI uses 22)
- pnpm and a working NanoClaw fork
- Host must expose
ncl group commands (CLI socket / dispatch)
Architecture
Remote client --Bearer token--> adminapi HTTP (:3210/internal/admin)
|
v
dispatch({ caller: 'host' })
|
v
ncl groups handlers + DB / filesystem
Install
Pre-flight (idempotent)
Skip to Credentials if all of these are already in place:
src/adminapi-boot.ts and src/adminapi.ts exist
src/index.ts contains await startAdminApi()
nanoclaw-adminapi is listed in package.json
Otherwise continue. Every step below is safe to re-run.
0. Copy this skill (first time only)
pnpm exec nanoclaw-adminapi sync-skill
1. Install npm package
pnpm add nanoclaw-adminapi@0.1.0
Local monorepo:
pnpm add file:../nanoclaw-adminapi
2. Run the installer
pnpm exec nanoclaw-adminapi install
This will:
- Copy adapter sources into
src/
- Insert the
startAdminApi() boot block after await startCliServer()
- Scaffold
.env keys (ADMINAPI_ENABLED, ADMINAPI_PORT, ADMINAPI_TOKEN)
- Sync this skill to
.claude/skills/add-adminapi/
3. Build and restart
pnpm run build
pnpm exec nanoclaw-adminapi verify
4. Smoke test
source .env
curl -sS -H "Authorization: Bearer $ADMINAPI_TOKEN" \
http://127.0.0.1:3210/internal/admin/health
Credentials / security
- Default bind:
127.0.0.1 (do not expose publicly without TLS + network policy)
- Token is root-equivalent for agent lifecycle โ treat like a host secret
- If
ADMINAPI_ENABLED=true and token unset, the host refuses to start the API
Uninstall
pnpm exec nanoclaw-adminapi uninstall
pnpm remove nanoclaw-adminapi
pnpm run build
See REMOVE.md.