From 0d360155d5ec7b8b83d635f79e05df8fe531f02e Mon Sep 17 00:00:00 2001 From: Manfred Riem <15701806+mnriem@users.noreply.github.com> Date: Wed, 2 Dec 2026 11:08:34 -0600 Subject: [PATCH] docs: add environment variables reference Assisted-by: GitHub Copilot (model: unknown, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/README.md | 1 + docs/env-vars.md | 117 ++++++++++++++++++++++++++++++++++++ docs/extensions/catalogs.md | 10 +-- docs/overview/core.md | 3 + docs/toc.yml | 2 + 5 files changed, 128 insertions(+), 5 deletions(-) create mode 100644 docs/env-vars.md diff --git a/docs/README.md b/docs/README.md index 5a0d392f27..fb6f644f96 100644 --- a/docs/README.md +++ b/docs/README.md @@ -73,6 +73,7 @@ the site homepage. Process command references and authentication remain under - `overview/history.md` - Project history and stewardship - `toc.yml` - Table of contents configuration - `overview/core.md` - Core CLI commands and shared project configuration +- `env-vars.md` - Environment variables for Specify and its helpers - `overview/mcp.md` - Experimental local stdio MCP server - `overview/artifacts.md` - Artifact inventory and composition reference - `reference/authentication.md` - Authentication configuration guide and reference diff --git a/docs/env-vars.md b/docs/env-vars.md new file mode 100644 index 0000000000..5608a8653f --- /dev/null +++ b/docs/env-vars.md @@ -0,0 +1,117 @@ +# Environment variables + +This reference covers environment variables used by Specify CLI, its +integrations and workflows, and the bundled feature helpers. It also lists +common system variables; Python, dependencies, and external tools can support +additional variables. + +Set variables before running Specify or launching the agent that runs its +helpers. For example, to select an existing project from a monorepo root: + +```bash +export SPECIFY_INIT_DIR=apps/web +specify extension list +``` + +```powershell +$env:SPECIFY_INIT_DIR = "apps/web" +specify extension list +``` + +## Project and feature context + +| Variable | Effect | +| --- | --- | +| `SPECKIT_INTEGRATION_DEFAULT` | Changes the default integration for `specify init` when `--integration` is omitted, including the interactive prompt default. The built-in default is `copilot`; an unknown key produces a warning and falls back to `copilot`. An explicit `--integration` takes precedence. | +| `SPECIFY_INIT_DIR` | Selects an existing project root for project-scoped CLI commands and core helpers. Relative paths resolve from the current directory. The directory must exist and contain `.specify/`; an invalid value is an error, not a fallback. `specify init` uses its explicit target instead. | +| `SPECIFY_FEATURE_DIRECTORY` | Overrides the active feature directory used by feature helpers instead of `.specify/feature.json`. Relative paths are resolved from the project root; absolute paths and paths outside the project are allowed. Helpers may persist this selection unless `SPECIFY_FEATURE_NO_PERSIST` is set. | +| `SPECIFY_FEATURE` | Overrides the feature label reported by the core helpers. It does not select the feature directory; use `SPECIFY_FEATURE_DIRECTORY` or `.specify/feature.json` for that. | +| `SPECIFY_FEATURE_NO_PERSIST` | Set to `1` or `true` to prevent core helpers from writing `.specify/feature.json`. This is useful when separate agents select different feature directories in one checkout. | +| `GIT_BRANCH_NAME` | With the optional Git extension, selects the exact feature branch name instead of generating one. The value must be at most 244 UTF-8 bytes. | + +See [Core Commands](overview/core.md#environment-variables) for feature +resolution details and [Work in a monorepo](how-to/monorepo.md) for project +selection. + +## Catalog selection + +Each variable below replaces the entire active catalog stack for its component +type with the specified URL. The resulting source allows installation, so use +only a catalog you trust and vet its components before installing them. Unset +the variable to restore normal project, user, and built-in catalog resolution. +Bundle catalogs have no corresponding environment override. + +| Variable | Component type | +| --- | --- | +| `SPECKIT_INTEGRATION_CATALOG_URL` | [Integrations](integrations/catalog.md) | +| `SPECKIT_CATALOG_URL` | [Extensions](extensions/catalogs.md) | +| `SPECKIT_PRESET_CATALOG_URL` | [Presets](presets/catalogs.md) | +| `SPECKIT_WORKFLOW_CATALOG_URL` | [Workflows](workflows/catalogs.md) | +| `SPECKIT_STEP_CATALOG_URL` | [Workflow step types](workflow-steps/catalogs.md) | + +See [Catalogs](overview/catalogs.md) for precedence and trust policies. + +## Integration dispatch + +For the names containing ``, uppercase the integration key and replace +hyphens with underscores. For example, `kiro-cli` becomes `KIRO_CLI`. + +| Variable | Effect | +| --- | --- | +| `SPECKIT_INTEGRATION__EXECUTABLE` | Overrides the executable used to dispatch supported workflow steps to the integration. | +| `SPECKIT_INTEGRATION__EXTRA_ARGS` | Supplies additional arguments to a supported integration CLI. Values use POSIX shell quoting; argument placement and precedence can vary by integration. | +| `SPECKIT_COPILOT_ALLOW_ALL_TOOLS` | Copilot workflow dispatch adds `--yolo` by default. Set this variable to `0` to prevent that automatic flag; any other value enables it. | +| `SPECKIT_ALLOW_ALL_TOOLS` | Deprecated fallback for `SPECKIT_COPILOT_ALLOW_ALL_TOOLS`, used only when the latter is unset. | +| `SPECKIT_INTEGRATION_AGY_ALLOW_ALL_TOOLS`, `SPECKIT_AGY_ALLOW_ALL_TOOLS` | Antigravity dispatch does not automatically approve tools by default. Set either to `1`, `true`, `yes`, or `on` to add `--dangerously-skip-permissions`. Values are case-insensitive; the first non-empty variable listed takes precedence. | + +Automatic approval can authorize tool actions without interactive confirmation. +See [Workflow CLI Dispatch](integrations/cli.md#workflow-cli-dispatch), the +[Copilot guide](integrations/copilot.md#runtime-events-and-workflow-permissions), +and the [Antigravity guide](integrations/agy.md#headless-permissions). + +## Workflow execution + +| Variable | Effect | +| --- | --- | +| `SPECKIT_WORKFLOW_RUN_ID` | Overrides the generated ID for a new workflow run. It must start with an ASCII letter or digit and contain only ASCII letters, digits, hyphens, and underscores. Use a unique ID: starting another run with the same ID overwrites saved run state and definition. | +| `SPECKIT_WORKFLOW_DIR` | Set by Specify in shell steps to the resolved workflow source directory. This is an output, not an override; it is reserved and omitted when the workflow has no source path. | + +Shell steps inherit the environment, with their `env` bindings applied to the +child process. See [Shell Step Environment Variables](workflow-steps/types.md#shell-step-environment-variables). + +## Authentication and extension configuration + +Specify's HTTP authentication is opt-in. In `~/.specify/auth.json`, a +`token_env` field names the variable holding a token, such as `GH_TOKEN`, +`GITHUB_TOKEN`, or `AZURE_DEVOPS_PAT`. Azure AD entries use `client_secret_env` +to name the variable holding the client secret. Setting a token variable alone +does not configure Specify's HTTP authentication; configure the matching hosts +and provider as described in [Authentication](reference/authentication.md). + +Extensions using `ConfigManager` can read variables named +`SPECKIT__`. The extension ID is uppercased with hyphens +replaced by underscores, and subsequent underscore-separated components form +nested configuration keys. For example, `SPECKIT_JIRA_PROJECT_KEY` sets +`project.key`. These values override other configuration layers and remain +strings. See the [extension configuration reference](extensions/api.md#environment-variable-pattern). + +## Helpers, installation, and common system variables + +| Variable | Effect | +| --- | --- | +| `SPECKIT_PYTHON_EXECUTABLE` | Selects a Python interpreter for core helpers, including preset template resolution and Unicode feature-name handling. Use Python 3 with PyYAML for preset manifests; helpers can fall back to another interpreter when the override is unavailable or unsuitable. | +| `SPECKIT_PYTHON` | Deprecated fallback for the core helper override above. The Bash and PowerShell helpers in the optional agent-context extension still read this name directly. | +| `SPECIFY_UPGRADE_TIMEOUT_SECS` | Sets a positive, finite timeout in seconds for the `specify self upgrade` installer subprocess. The default is no timeout; invalid values produce a warning and are ignored. | +| `UV_TOOL_DIR`, `PIPX_HOME`, `XDG_DATA_HOME`, `APPDATA`, `LOCALAPPDATA` | Affect detection of relocated or platform-specific uv and pipx installations during self-upgrade. The installer may also use these variables; see the [upgrade guide](upgrade.md). | +| `PATH` | Affects discovery of agent CLIs, Git, Python, and installer executables. | +| `HOME`, `USERPROFILE` | Affect the home directory used for user-level configuration, such as `~/.specify/auth.json` and catalog files, according to the platform's Python home-directory rules. | +| `TMPDIR`, `TEMP`, `TMP` | Can select Python's default temporary directory for operations that do not specify another directory. | +| `LC_ALL`, `LC_CTYPE`, `LANG` | Affect locale selection for the Bash feature helper. A non-empty `LC_ALL` is enforced and can cause Unicode feature names to fail if it is not a usable UTF-8 locale. See [Naming Features](overview/core.md#naming-features-with-the-helper-scripts). | +| `USER`, `USERNAME` | Provide an author fallback for Git extension branch templates when Git has no configured user name or email. Bash uses `USER`; the Python and PowerShell helpers also use `USERNAME`. | +| `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` | Configure proxies and proxy exclusions for Python's HTTP client; lowercase forms are also supported. | +| `SSL_CERT_FILE`, `SSL_CERT_DIR` | Can affect Python/OpenSSL's default certificate trust locations, depending on the platform. | +| `NO_COLOR`, `FORCE_COLOR` | Control Rich-rendered color: `NO_COLOR` suppresses color, while `FORCE_COLOR` can enable it when output is not a terminal. | + +Most child processes inherit the environment. The self-upgrade installer is an +exception: Specify removes GitHub credential-shaped variables from its +environment. diff --git a/docs/extensions/catalogs.md b/docs/extensions/catalogs.md index 083c11631b..78720fd728 100644 --- a/docs/extensions/catalogs.md +++ b/docs/extensions/catalogs.md @@ -211,11 +211,11 @@ specify extension add jira ### Private GitHub-hosted catalogs -`GH_TOKEN` or `GITHUB_TOKEN` authenticates requests to GitHub-hosted URLs -(`raw.githubusercontent.com`, `github.com`, `api.github.com`, and -`codeload.github.com`). Private catalog JSON and extension ZIPs require access -to the relevant repositories. Non-GitHub catalog URLs are fetched without -these credentials. +Configure a GitHub provider in [`~/.specify/auth.json`](../reference/authentication.md) +for the catalog and download hosts, with `token_env` set to `GITHUB_TOKEN` or +`GH_TOKEN`. Setting the variable alone does not enable Specify authentication. +Private catalog JSON and extension ZIPs require access to the relevant +repositories. The following example assumes `token_env` is `GITHUB_TOKEN`: ```bash export GITHUB_TOKEN=$(gh auth token) diff --git a/docs/overview/core.md b/docs/overview/core.md index 1521797e95..d3b41d0094 100644 --- a/docs/overview/core.md +++ b/docs/overview/core.md @@ -75,6 +75,9 @@ specify init my-project --integration copilot --preset compliance ### Environment Variables +For variables used by other parts of Specify, see the +[environment variables reference](../env-vars.md). + | Variable | Description | | ----------------- | ------------------------------------------------------------------------ | | `SPECKIT_INTEGRATION_DEFAULT` | Override the fallback integration used by `specify init` when `--integration` is omitted (interactive prompt default and non-interactive fallback). Set it to any registered integration key (e.g. `gemini`, `claude`). An unrecognized value is ignored with a warning and the built-in default (`copilot`) is used. An explicit `--integration ` always takes precedence. | diff --git a/docs/toc.yml b/docs/toc.yml index 6c82f45677..af600394b9 100644 --- a/docs/toc.yml +++ b/docs/toc.yml @@ -8,6 +8,8 @@ href: overview/history.md - name: Core Commands href: overview/core.md + - name: Environment Variables + href: env-vars.md - name: MCP Server href: overview/mcp.md - name: Artifacts