From 03c8f952e8bac3895e1a7536ef391b8d4d52f89d Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 25 Mar 2026 21:04:45 -0700 Subject: [PATCH] docs: clarify where secrets can be templated from (#11865) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: clarify where secrets are resolved from and IDE vs CLI differences Reorganizes the secrets FAQ to lead with how to use secrets, then clearly lists the resolution order. Adds a warning that IDE extensions cannot read shell environment variables — the most common source of confusion. Fixes #9081 * Use Mintlify component instead of :::warning syntax --------- Co-authored-by: continue[bot] <230936708+continue[bot]@users.noreply.github.com> --- docs/faqs.mdx | 69 ++++++++----------- .../guides/configuring-models-rules-tools.mdx | 12 ++-- 2 files changed, 34 insertions(+), 47 deletions(-) diff --git a/docs/faqs.mdx b/docs/faqs.mdx index 007987d98..7c37c807d 100644 --- a/docs/faqs.mdx +++ b/docs/faqs.mdx @@ -270,59 +270,44 @@ If you're getting parse errors with remote Ollama: For running Continue completely offline without internet access, see the [Running Continue Without Internet guide](/guides/running-continue-without-internet). -Continue supports multiple methods for managing secrets locally, searched in this order: +#### How to reference secrets in config.yaml -1. **Workspace `.env` files**: Place a `.env` file in your workspace root directory -2. **Workspace Continue folder**: Place a `.env` file in `/.continue/.env` -3. **Global `.env` file**: Place a `.env` file in `~/.continue/.env` for user-wide secrets -4. **Process environment variables**: Use standard system environment variables +Use the `${{ secrets.SECRET_NAME }}` syntax anywhere in your `config.yaml`: -#### Creating `.env` files - -Create a `.env` file in one of these locations: -- **Per-workspace**: `/.env` or `/.continue/.env` -- **Global**: `~/.continue/.env` - -Example `.env` file: -``` -OPENAI_API_KEY=sk-... -ANTHROPIC_API_KEY=sk-ant-... -CUSTOM_API_URL=https://api.example.com -``` - -#### Using secrets in config.yaml - -Reference your local secrets using the `secrets` namespace: ```yaml models: - provider: openai apiKey: ${{ secrets.OPENAI_API_KEY }} ``` -#### Mission Control-managed secrets +#### Where secrets are resolved from -For centralized team secret management, use `${{ inputs.SECRET_NAME }}` syntax in your config.yaml and manage them at [https://continue.dev/settings/secrets](https://continue.dev/settings/secrets): -```yaml -models: - - provider: openai - apiKey: ${{ inputs.OPENAI_API_KEY }} +When Continue encounters `${{ secrets.X }}`, it searches these sources **in order**: + +1. **Workspace `.env` file**: `/.env` +2. **Workspace Continue `.env` file**: `/.continue/.env` +3. **Global `.env` file**: `~/.continue/.env` +4. **Process environment variables**: Standard system environment variables + + +**IDE extensions (VS Code, JetBrains) cannot read your shell environment variables.** Setting `export OPENAI_API_KEY=...` in your terminal will not make the key available to Continue running inside your IDE. You must use a `.env` file instead. + +Process environment variables (source 4) only work with the [Continue CLI](/cli/configuration), where you can pass them directly: `export OPENAI_API_KEY=sk-... && cn` + + +#### Creating `.env` files + +Create a `.env` file in one of the locations above. Use standard dotenv format: + +``` +OPENAI_API_KEY=sk-... +ANTHROPIC_API_KEY=sk-ant-... +CUSTOM_API_URL=https://api.example.com ``` -#### Important notes - -- **Never commit `.env` files** to version control - add them to `.gitignore` -- The `.env` file uses standard dotenv format (KEY=value, no quotes needed) -- Secrets are loaded when Continue starts, so restart your IDE after changes -- Local `.env` files take precedence over Hub secrets when both exist - -#### Troubleshooting secrets - -If your API keys aren't being recognized: -1. Check the `.env` file is in the correct location -2. Ensure there are no quotes around values in the `.env` file -3. Restart your IDE after adding/changing secrets -4. Verify the variable name matches exactly (case-sensitive) -5. Check that your `.env` file has proper line endings (LF, not CRLF on Windows) +- **Never commit `.env` files** to version control — add them to `.gitignore` +- No quotes around values +- Restart your IDE after adding or changing secrets ### Using Model Addons Locally diff --git a/docs/guides/configuring-models-rules-tools.mdx b/docs/guides/configuring-models-rules-tools.mdx index 4d2c6ae27..934fbba4f 100644 --- a/docs/guides/configuring-models-rules-tools.mdx +++ b/docs/guides/configuring-models-rules-tools.mdx @@ -95,18 +95,20 @@ On Mission Control, you can configure secrets when adding a model or MCP server. This will use mustache notation to pass the secret, eg `${{ secrets.SECRET_NAME }}` -When configuring a local model or MCP server, you can use the same mustache notation for secrets which read from: +When configuring a local model or MCP server, you can use the same mustache notation for secrets which are resolved from these sources in order: + +`.env` file at your project root, or in `/.continue/.env` + + `.env` file in `~/.continue/.env` - - -`.env` file at your project root - +See [Managing Local Secrets and Environment Variables](/faqs#managing-local-secrets-and-environment-variables) for full details on secret resolution and IDE vs CLI differences. + **When to use `secrets.` vs `inputs.`**