Skip to content

Configuration

sklad serve, sklad init, sklad token, and sklad share read their settings in three layers, each overriding the one before:

  1. built-in defaults;
  2. sklad.toml in the working directory, if present;
  3. environment variables prefixed SKLAD_.

A nested key’s variable joins the path with double underscores: git.auto_pull.enabled is SKLAD_GIT__AUTO_PULL__ENABLED. A variable with a single underscore in place of __ is silently ignored. The local commands (search, query, check, and the rest) do not read this configuration; they take --root or $KB_ROOT.

Relative paths are relative to the working directory.

Key Environment variable Default Meaning
listen SKLAD_LISTEN 127.0.0.1:8080 Address for MCP, health, and web requests
metrics_listen SKLAD_METRICS_LISTEN 127.0.0.1:9090 Address for Prometheus metrics
log_format SKLAD_LOG_FORMAT pretty pretty or json
kb_path SKLAD_KB_PATH ../know The knowledge base directory
auth_db_path SKLAD_AUTH_DB_PATH state/auth.sqlite Token and share-link database
journal_tz SKLAD_JOURNAL_TZ UTC IANA time zone for “today” in kb_next, journal_append, the web home page, and the dates of new files; UTC when it cannot be parsed
inbox_kind SKLAD_INBOX_KIND inbox The kind inbox_capture writes
journal_kind SKLAD_JOURNAL_KIND journal The kind journal_append writes
watch SKLAD_WATCH true Rebuild the index when files change outside the server
allowed_hosts SKLAD_ALLOWED_HOSTS empty Host values /mcp accepts. Empty means localhost, 127.0.0.1, ::1, and, with OAuth on, the host of the resource URL. Set it for a public host without OAuth; as a variable, write a list: SKLAD_ALLOWED_HOSTS='[kb.example.com]'.
index_db_path SKLAD_INDEX_DB_PATH unset Ignored; the index is in memory. Accepted with a startup warning so old configurations still load.
Key Environment variable Default Meaning
git.auto_push SKLAD_GIT__AUTO_PUSH true Push after every commit the server makes
git.remote SKLAD_GIT__REMOTE origin Remote to push to and pull from
git.branch SKLAD_GIT__BRANCH main Branch to push to and pull from
git.auto_pull.enabled SKLAD_GIT__AUTO_PULL__ENABLED false Fetch and integrate remote commits on a timer
git.auto_pull.interval_secs SKLAD_GIT__AUTO_PULL__INTERVAL_SECS 300 Seconds between pulls; 30 to 86400, otherwise the server does not start
git.auto_pull.strategy SKLAD_GIT__AUTO_PULL__STRATEGY rebase rebase or ff-only

See Keep the checkout in sync for what the strategies do.

Key Environment variable Default Meaning
oauth.enabled SKLAD_OAUTH__ENABLED false Accept OAuth 2.1 access tokens (JWTs)
oauth.issuer SKLAD_OAUTH__ISSUER empty Expected iss claim
oauth.audience SKLAD_OAUTH__AUDIENCE empty Expected aud claim: the public URL of /mcp
oauth.jwks_uri SKLAD_OAUTH__JWKS_URI <issuer>/.well-known/jwks.json Where to fetch signing keys
oauth.jwks_refresh_seconds SKLAD_OAUTH__JWKS_REFRESH_SECONDS 900 Background key refresh; 60 to 86400, otherwise the server does not start
oauth.resource_url SKLAD_OAUTH__RESOURCE_URL the audience The resource in the OAuth metadata
oauth.resource_metadata_url SKLAD_OAUTH__RESOURCE_METADATA_URL derived from resource_url Advertised in 401 responses
oauth.documentation_url SKLAD_OAUTH__DOCUMENTATION_URL <resource_url>/docs/auth resource_documentation in the metadata

The defaults apply only with oauth.enabled = true. With OAuth on, the server does not start while issuer, audience, resource_url, jwks_uri, or resource_metadata_url is empty. See Enable OAuth 2.1.

Key Environment variable Default Meaning
web.enabled SKLAD_WEB__ENABLED false Serve the read-only HTML view and share links
web.public_base_url SKLAD_WEB__PUBLIC_BASE_URL empty Public origin share links are built from; required when the web view is on

The web view’s owner tier has no authentication of its own. Read Browse the web view and share pages before enabling it.

sklad.toml
listen = "0.0.0.0:8080"
kb_path = "/data/know"
auth_db_path = "/data/state/auth.sqlite"
log_format = "json"
journal_tz = "Europe/Berlin"
[git.auto_pull]
enabled = true
strategy = "rebase"
[oauth]
enabled = true
issuer = "https://auth.example.com/oidc"
audience = "https://kb.example.com/mcp"