Skip to main content
KiwiFS supports four authentication modes. Choose the one that fits your deployment.

Auth modes

No authentication. Suitable for local development and trusted networks.
.kiwi/config.toml
[auth]
type = "none"
Auth configuration is hot-reloadable — send SIGHUP to the server process to reload from disk without restarting.

Per-space token fields

When using perspace auth, each [[auth.api_keys]] entry supports:
FieldRequiredDescription
keyYesThe API key string (shown once on creation via CLI)
spaceNoRestrict to a specific space (empty = all spaces)
actorNoDefault X-Actor value for git attribution
scopeYesPermission level: read, write, or admin
prefixNoRestrict access to paths under this prefix

Scopes

ScopePermissions
readGET endpoints only — tree, file, search, query, analytics
writeRead + PUT, POST, DELETE on files, drafts, canvas, workflows
adminWrite + space management, webhook CRUD, schema changes, audit log

Managing tokens via CLI

The kiwifs token command creates and manages API keys stored in .kiwi/config.toml.

Create a token

kiwifs token create --root ./knowledge --space docs --scope read --actor ci-reader
The plaintext key is displayed once. Copy it immediately — it cannot be retrieved later.
Created API key: kiwi_ro_abc1deadbeef...
Space: docs | Scope: read | Actor: ci-reader

List tokens

kiwifs token list --root ./knowledge
PREFIX          SPACE        SCOPE   ACTOR
kiwi_ro_abc1   docs         read    ci-reader
kiwi_rw_xyz7   engineering  write   eng-bot
kiwi_admin_a   (all)        admin   admin

Revoke a token

kiwifs token revoke kiwi_ro_abc1
Revocation removes the key from .kiwi/config.toml. Active requests with the revoked key are rejected on the next config reload.
Revoking a token does not require a server restart — KiwiFS watches the config file for changes.

Path-scoped access

Use the prefix field to restrict a token to a specific directory tree:
[[auth.api_keys]]
key = "kiwi_rw_agent_onboarding"
space = "engineering"
actor = "onboarding-bot"
scope = "write"
prefix = "onboarding/"
This token can only read and write files under onboarding/. Requests to other paths return 401.

Cloud authentication

KiwiFS Cloud uses a separate authentication system:
  1. API key — pass kiwi_sk_* as a Bearer token
  2. MCP OAuth 2.1 — browser-based login via WorkOS (PKCE)
kiwifs login                          # OAuth device flow
kiwifs whoami                         # Show current identity
kiwifs connect my-workspace --write cursor  # Generate MCP config
Cloud credentials are stored at ~/.kiwifs/credentials.json. See KiwiFS Cloud for details.

Configuration

Full auth config reference.

API overview

Auth headers and error codes.

Multi-space

Per-space routing and access control.

CLI commands

Token create, list, and revoke commands.
Last modified on May 31, 2026