Docs / reference

The reference for the current tree.

A reference for the current source tree: commands, endpoints, configuration, and operations.

Current treeCurrent buildLoopback APIApache-2.0

Start here

If you are new to the tree, read the product boundaries first, then build and verify the install. The reference below assumes a local source build.

Product

What the gateway owns and what it refuses.

Read first

Install

Build, init, serve, and run doctor.

Source build

Integrations

The exact support matrix and failure behavior.

Compatibility

CLI reference

CommandWhat it does
dreenmind initCreate config, workspace, database, and vault. Prompts for a passphrase.
dreenmind serveStart the loopback gateway and optional Telegram channel.
dreenmind statusCheck whether the gateway is ready.
dreenmind chatOpen an interactive client session; /exit leaves.
dreenmind sessionsList sessions.
dreenmind doctor [--repair]Diagnose config, paths, vault, database, and provider shape; rebuild search with --repair.
dreenmind secretsManage vault-backed secret references.
dreenmind approvalsList and decide pending approval requests.
dreenmind versionPrint build version and platform.

All commands accept an explicit config path where applicable. The CLI is an HTTP client for gateway operations; it is not a second database writer.

HTTP API

The API binds to loopback and uses bearer authentication. The CLI is the reference client. The table lists the stable shapes in the current tree.

EndpointPurpose
GET /healthLiveness and readiness information.
POST /v1/messagesSubmit a user message and run a turn.
GET /v1/sessionsList sessions.
GET /v1/sessions/{id}Read a session and its messages.
GET /v1/approvalsList pending approvals.
POST /v1/approvals/{id}Approve or deny a scoped request.

Errors are JSON with a stable shape and sanitized messages. Do not parse provider error text as a contract.

Configuration

FieldDefaultNotes
provider.base_urlNoneHTTPS for remote; loopback HTTP allowed.
provider.modelNoneModel identifier passed to the provider.
provider.api_key_refNoneA secret:// reference, not the key.
telegram.enabledfalseOptional private-chat channel.
telegram.token_refNoneVault reference for the bot token.
tools.workspace_writefalseOpt-in; may require approval.
tools.workspace_movefalseOpt-in; source and destination checked.
tools.web_fetch_hostsEmptyExact host allowlist.
approval.modeSensitive toolsPolicy for sensitive operations.
sandbox.enabledfalseDocker contract; fails closed if unavailable.

Unknown fields are rejected so a typo does not silently disable a boundary. The config file contains references, not plaintext secrets.

Operations

Operate the gateway as a local service with one writer. The important routines are diagnosis, backup, and a controlled binary replacement.

  • Run doctor after any config change.
  • Back up config, database, and vault as a set.
  • Stop serve before replacing the binary or copying the database.
  • Use doctor --repair only for the derived search index.
  • Do not expose the loopback listener to a public interface.

Status vocabulary

LabelMeaning
ImplementedThe code path exists in the current tree.
TestedAn automated test exists and passed locally.
VerifiedTested in the environment the claim names.
PartialSome pieces exist; the missing pieces are named.
PlannedNot implemented; not a delivery promise.
UnverifiedImplemented, but the real external service was not exercised.

Glossary

Gateway
The single process that owns the HTTP API, the turn loop, and the database.
Turn
One user message and the resulting assistant/tool cycle until a final answer or failure.
Receipt
The local record of a turn, tool call, approval, and outcome.
Edge
A provider, channel, tool, or sandbox boundary that connects to the core.
Approval
A scoped, single-use, expiring capability to perform a sensitive action.
Vault
Encrypted local storage for secrets referenced by secret://.
Unverified
Implemented but not tested against the live external service.

Repository map

PathContents
cmd/dreenmindProcess entrypoint.
internal/appCLI commands and application wiring.
internal/gatewayHTTP API, turn orchestration, approvals.
internal/agentProvider loop and tool-call handling.
internal/stateSQLite schema, sessions, messages, search.
internal/providerOpenAI-compatible provider adapter.
internal/channelCLI-facing and Telegram channel code.
internal/toolsWorkspace and web-fetch tools.
internal/sandboxDocker sandbox contract.
internal/vaultArgon2id/AES-GCM secret storage.
internal/configConfig schema and paths.
docsArchitecture, dependencies, release, and PRD notes.