Skip to content

Environment Variables

Environment variables override stored config and command-line flags follow their own precedence. This page is the source of truth for what the CLI, MCP server, and @opentusk/indexer actually read at runtime.

VariableDefaultUsed for
OPENTUSK_API_KEYAPI key (otk_…) used for all authenticated requests. Required unless a key is stored via opentusk login or opentusk setup.
OPENTUSK_API_URLhttps://api.opentusk.aiAPI base URL. Set to http://localhost:8000 for local development.
OPENTUSK_SUI_PRIVATE_KEYSui Ed25519 private key (suiprivkey1…) used by the MCP server and CLI to SEAL-encrypt/decrypt shared-vault files. Without it, agents can list shared vaults but can’t read filenames or content.
OPENTUSK_ENVproductionSelects the Sui / Walrus network. production → Sui mainnet + Walrus mainnet (real WAL tokens). development → Sui testnet + Walrus testnet (free).

For each variable the runtime resolves the first non-empty value:

  1. Command-line flag (e.g. --api-key, --api-url)
  2. Environment variable
  3. Stored config at ~/.config/opentusk/config.json
  4. Built-in default

Example: opentusk --api-url http://localhost:8000 vault list always wins over OPENTUSK_API_URL in the environment, which always wins over the stored apiUrl.

These are only consulted when @opentusk/indexer is installed.

VariableDefaultUsed for
OPENTUSK_INDEX_MODELall-MiniLM-L6-v2Embedding model key for the local index. Overrides what was chosen during opentusk index setup. Switching models requires opentusk index reset to rebuild.
OPENTUSK_INDEXER_URLHTTP URL of a running indexer daemon (e.g. http://127.0.0.1:7600). When set, the CLI and MCP server talk to that daemon instead of spawning their own stdio indexer. Useful when sharing one index across multiple agents on the same machine.

To run the indexer as a daemon:

Terminal window
opentusk-indexer serve --port 7600
export OPENTUSK_INDEXER_URL=http://127.0.0.1:7600
opentusk search "deployment runbook"

When you run opentusk mcp install-config, these variables are written into the agent’s MCP config file (e.g. .mcp.json, claude_desktop_config.json, ~/.cursor/mcp.json):

{
"mcpServers": {
"opentusk": {
"command": "/usr/local/bin/opentusk",
"args": ["mcp", "serve"],
"env": {
"OPENTUSK_API_KEY": "otk_…",
"OPENTUSK_SUI_PRIVATE_KEY": "suiprivkey1…"
}
}
}
}

OPENTUSK_API_URL is only embedded if you passed --api-url to install-config (otherwise the agent picks up the default). OPENTUSK_SUI_PRIVATE_KEY is only embedded if a key was stored or passed via --sui-priv-key.