Skip to main content
TokenDance Code
中文
Updated 2026-10-22

Configuration

Settings files

The Rust settings loader reads ~/.tokendance/settings.json. With config validate --project <path>, it also reads <path>/.tokendance/settings.json; supplied project fields replace the corresponding user fields. A project provider object replaces the whole user provider object.

{
  "provider": {
    "kind": "openai_chat_completions",
    "model": "your-model-id",
    "baseUrl": "https://api.example.com/v1"
  },
  "permissionMode": "default",
  "disallowedTools": ["run_powershell"]
}

This is a configuration schema example, not a working CLI model setup. The current run and interactive entry points still construct the simulated provider and default permission mode directly.

Validate a project

cargo run --locked -p tokendance-cli -- config validate --project . --json

The command checks recognized provider names and permission modes, and rejects a tool listed in both allowedTools and disallowedTools. It does not contact a provider or validate credentials. Without --project, only user settings are loaded.

The accepted provider setting names are openai_chat_completions, openai_responses, and anthropic_messages. Permission modes are default, safe, auto, and yolo.

Credentials and model integration

The Rust adapter implementations read keys from the process environment. See Providers for their variable names and transport gates. Adding these values alone does not activate an adapter in the current CLI.

gateway init currently prints guidance; it does not create a file. The old TypeScript .env preset and config-writing commands should not be used as instructions for this preview.

Edit this page on GitHub