Edit this page on GitHub ↗

Operations

Daythread is designed to be operated by one person on one machine. Everything it needs lives under DAYTHREAD_HOME, and nothing leaves the machine unless you configure a provider.

The home directory

$DAYTHREAD_HOME/            default ~/.daythread
  daythread.db              facts, runs, ledger, usage
  sandbox/                  tool scratch space
  backups/                  checksummed backup bundles
  api.token                 bearer token, mode 0600
  notifications/            outbox
  notes/ drafts/            artifacts

Back up the home, not just the database. The token and the outbox are part of the operating state.

Configuration

dt config show
dt config set <key> <value>

Settings include api.rate_limit_per_minute, net.allow_private, net.allow_hosts, net.max_bytes, model.egress, and retention knobs. dt doctor checks the obvious breakage before you debug the subtle kind.

Models

The default provider is local and deterministic. A remote provider is an explicit configuration, not a default:

dt ask "summarise today" --no-cache
dt model list
dt model usage

The gateway supports OpenAI-compatible HTTP and SSE, a fallback chain with bounded backoff, an encrypted response cache, a daily token budget, and a usage ledger. model.egress=local_only rejects non-local providers; streaming is opt-in.

Connectors

Connectors are manifest-based. Mock providers exist for tests; real providers use OAuth2 + PKCE with a loopback callback.

dt connector list
dt connector auth google
dt connector sync google --kind calendar
dt connector state google
dt connector revoke google

Google and Microsoft 365 cover Calendar and Mail; Feishu/Lark cover Calendar and Tasks. Read sync uses retry/backoff, pagination and incremental cursors (syncToken, deltaLink). Write actions are approval-gated.

Tokens are stored encrypted and refreshed on expiry. dt connector revoke removes the grant and the local token.

MCP

dt mcp add <name> --command <cmd>
dt mcp tools <name>
dt mcp call <name> <tool> --arg k=v
dt mcp serve

Servers run without a shell, tool calls are external by default, and the child environment is scoped. dt mcp serve exposes briefs, memory, tasks, calendar, approvals, connectors, and approval-gated plan proposals. Sensitive resources are blocked; the server is read-only by default.

Scheduler and daemon

dt tick --job morning
dt tick --job evening
dt tick --job maintenance
dt daemon --interval 60
dt notifications

Ticks are idempotent. The notification outbox respects quiet hours and defers rather than drops.

Backup and restore

dt backup --out ./backups
dt restore ./backups/<file> --verify
dt restore ./backups/<file> --replace --trust

Backups are checksummed, HMAC-signed, optionally passphrase-encrypted, versioned, and redact known secrets. Test a restore before you need one.

Sync and relay

dt sync export --passphrase-env DAYTHREAD_PASSPHRASE
dt sync verify
dt sync push --if-match <etag> --on-conflict fail
dt relay serve --dir ./relay --port 8788

Sync bundles are authenticated with AES-GCM. Secrets are excluded by design. The self-hosted relay only sees ciphertext.

Retention and evidence

dt maintenance stats
dt maintenance prune --older-than 90 --keep-runs 200 --vacuum
dt metrics
dt audit
dt compliance evidence --out compliance.json

Pruning removes old events, steps, audit rows, usage, messages and connector items; pending runs are always kept.

The server and container

dt serve --port 8765 --print-token
dt serve --rotate-token
docker build -t daythread .

The API binds 127.0.0.1 by default, supports optional TLS with --certfile/--keyfile, and exposes an OpenAPI document at /v1/openapi.json.

Deployment checklist

  1. Python 3.9+, a writable DAYTHREAD_HOME, and a 0600 token.
  2. Keep the API and dashboard on loopback; do not expose them to a LAN or the internet.
  3. Set model.egress=local_only unless a remote provider is intended.
  4. Register only the MCP servers you audited.
  5. Back up the home and verify a restore.
  6. Run dt maintenance prune on a schedule that matches your retention policy.
  7. Treat the instance as single-user. There is no hosted multi-tenant isolation.

Read next