Skip to main content
This page is the single source of truth for Celly’s operational surfaces: the admin page, logs, log rotation, backups, and restore. The deployment guides link here instead of repeating it.

Admin page

ADMIN_PORT (default 4560, 0 disables) serves a loopback-only ops console and JSON API. It binds 127.0.0.1 only and has no authentication by design: it is safe precisely because it is not network-exposed. It is never reachable from another device or the network, so never bind it to 0.0.0.0, publish it, or port-forward it. The console shows live project cards with Start / Stop / Restart / Remove, usage and cost, the audit trail, and per-project logs and sessions, and it can create projects. It updates over server-sent events. For remote access, tunnel the loopback port over SSH:
Then open http://127.0.0.1:4560 on your local machine. Set ADMIN_PORT=0 to disable the page entirely. The page trusts anything on the host, so local code shares the host trust boundary. See Security for the threat model. An owner can post the console URL to Discord with /dashboard. The link only opens from the Celly host or an SSH tunnel; ADMIN_PORT=0 reports it disabled.

What the console shows

  • Projects. Live cards with sandbox status, host port, sandbox name, last activity, spend, tokens, and session count, each with Start / Stop / Restart and Remove actions.
  • New project. Create a directory under PROJECTS_ROOT, optionally cloning an https:// repository — the same operation as /project create.
  • Usage and cost. Cumulative spend and tokens, with prompt/completion and cache read/write breakdowns.
  • Audit. The recent audit.jsonl entries.
  • Logs and sessions. Per-project redacted log tails and the project’s sessions, each with its terminal attach command.
The page updates live over server-sent events, so it does not need a manual refresh. Removing a project stops the sandbox and deletes the Discord channel, but keeps the host directory.

Endpoints

The JSON API is the surface the page is built on:
  • GET / — HTML console.
  • GET /api/projects — list; POST /api/projects — create.
  • DELETE /api/projects/<channelId> — remove (keeps the host directory).
  • POST /api/projects/<channelId>/start|stop|restart.
  • GET /api/health.
  • GET /api/logs/<channelId>?lines=200 — redacted log tail (capped at 2000).
  • GET /api/audit?limit=100 — recent audit entries (capped at 1000).
  • GET /events — server-sent event stream of live console fragments.
  • GET /assets/<name> — vendored console assets.
The HTML page additionally uses /partials/* fragment routes. Those are an implementation detail of the console, not a stable API.

Logs

Celly logs to the console (colored on a TTY) and to DATA_DIR/bot.log as JSONL. Each project’s supervised opencode serve child appends to DATA_DIR/logs/<project>.log. LOG_LEVEL (debug, info, warn, error) sets console verbosity. Tokens, passwords, and Authorization headers are redacted before they reach either sink. When a pending approval or question is dropped before a member decides it, the WARN line records the threadId, sessionId, requestId, and a cause: run-ended, server-resolved, permission-replied, question-replied, question-rejected, or timeout. Matching that requestId against a “this request is no longer active” reply from an approval click shows why the request was gone. Pending approvals live in memory only, so a bot restart drops every one of them; those drops leave no log line.

Session cleanup

Archiving a managed thread prompts in its parent channel to remove the session (see Archived threads). Choosing Remove session deletes the OpenCode session and the thread record and folds its usage into the channel totals, so /cost and the admin usage figures stay accurate. Removals are audited with kind: "session".

Backups and log rotation

Celly backs up DATA_DIR/bot.db with SQLite VACUUM INTO on an interval and prunes old copies. It also rotates bot.log and every per-project server log. At boot any existing bot.log is moved aside as bot.log.prev (one generation) instead of being truncated, so the crash tail survives a restart. Backups are written to DATA_DIR/backups/bot-<ISO>.db (for example bot-2026-09-27T00-00-00-000Z.db). Each backup is VACUUM INTO a temp name, verified (it opens, carries the migrated schema version, and has at least one table), and only then renamed into place, so a crash mid-backup never leaves a partial file under the final name. Pruning removes unverifiable files and crash leftovers.

Restore

Stop the bot first so the database is not open while it is replaced.