Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
117 changes: 117 additions & 0 deletions docs/env-vars.md
Original file line number Diff line number Diff line change
@@ -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 `<KEY>`, uppercase the integration key and replace
hyphens with underscores. For example, `kiro-cli` becomes `KIRO_CLI`.

| Variable | Effect |
| --- | --- |
| `SPECKIT_INTEGRATION_<KEY>_EXECUTABLE` | Overrides the executable used to dispatch supported workflow steps to the integration. |
| `SPECKIT_INTEGRATION_<KEY>_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_<EXTENSION>_<KEY>`. 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.
10 changes: 5 additions & 5 deletions docs/extensions/catalogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions docs/overview/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <key>` always takes precedence. |
Expand Down
2 changes: 2 additions & 0 deletions docs/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down