diff --git a/docs/commands.md b/docs/commands.md index a34673c90..09d8f7c23 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -96,7 +96,7 @@ See [Parallel Orchestration](./parallel-orchestration.md) for full documentation | `gsd --list-models [search]` | List available models and exit | | `gsd sessions` | Interactive session picker — list all saved sessions for the current directory and choose one to resume | | `gsd --debug` | Enable structured JSONL diagnostic logging for troubleshooting dispatch and state issues | -| `gsd config` | Re-run the setup wizard (LLM provider + tool keys) | +| `gsd config` | Set up global API keys for search and docs tools (saved to `~/.gsd/agent/auth.json`, applies to all projects). See [Global API Keys](./configuration.md#global-api-keys-gsd-config). | | `gsd update` | Update GSD to the latest version | | `gsd headless new-milestone` | Create a new milestone from a context file (headless — no TUI required) | diff --git a/docs/configuration.md b/docs/configuration.md index b4db57641..d10c6f52f 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -50,6 +50,32 @@ token_profile: balanced - **Array fields** (`always_use_skills`, etc.): concatenated (global first, then project) - **Object fields** (`models`, `git`, `auto_supervisor`): shallow-merged, project overrides per-key +## Global API Keys (`/gsd config`) + +Tool API keys are stored globally in `~/.gsd/agent/auth.json` and apply to all projects automatically. Set them once with `/gsd config` — no need to configure per-project `.env` files. + +```bash +/gsd config +``` + +This opens an interactive wizard showing which keys are configured and which are missing. Select a tool to enter its key. + +### Supported keys + +| Tool | Environment Variable | Purpose | Get a key | +|------|---------------------|---------|-----------| +| Tavily Search | `TAVILY_API_KEY` | Web search for non-Anthropic models | [tavily.com/app/api-keys](https://tavily.com/app/api-keys) | +| Brave Search | `BRAVE_API_KEY` | Web search for non-Anthropic models | [brave.com/search/api](https://brave.com/search/api) | +| Context7 Docs | `CONTEXT7_API_KEY` | Library documentation lookup | [context7.com/dashboard](https://context7.com/dashboard) | + +### How it works + +1. `/gsd config` saves keys to `~/.gsd/agent/auth.json` +2. On every session start, `loadToolApiKeys()` reads the file and sets environment variables +3. Keys apply to all projects — no per-project setup required +4. Environment variables (`export BRAVE_API_KEY=...`) take precedence over saved keys +5. Anthropic models don't need Brave/Tavily — they have built-in web search + ## All Settings ### `models` diff --git a/docs/getting-started.md b/docs/getting-started.md index c2e991f58..56f00ac9f 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -10,6 +10,17 @@ Requires Node.js ≥ 20.6.0 (22+ recommended) and Git. GSD checks for updates once every 24 hours. When a new version is available, you'll see an interactive prompt at startup with the option to update immediately or skip. You can also update from within a session with `/gsd update`. +### Set up API keys + +If you use a non-Anthropic model, you'll need a search API key for web search. Run `/gsd config` to set keys globally — they're saved to `~/.gsd/agent/auth.json` and apply to all projects: + +```bash +# Inside any GSD session: +/gsd config +``` + +See [Global API Keys](./configuration.md#global-api-keys-gsd-config) for details on supported keys. + ### VS Code Extension GSD is also available as a VS Code extension. Install from the marketplace (publisher: FluxLabs) or search for "GSD" in VS Code extensions. The extension provides: