Skip to content

docs: add environment variables section to CLI reference#1713

Merged
Mossaka merged 2 commits intomainfrom
docs/1562-env-vars-cli-reference
Apr 6, 2026
Merged

docs: add environment variables section to CLI reference#1713
Mossaka merged 2 commits intomainfrom
docs/1562-env-vars-cli-reference

Conversation

@Mossaka
Copy link
Copy Markdown
Collaborator

@Mossaka Mossaka commented Apr 6, 2026

Summary

Test plan

  • Verify the docs site builds successfully
  • Confirm the new section renders correctly between "Options Details" and "Exit Codes"
  • Check that tables, admonitions (:::danger), and formatting match the existing file style

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 6, 2026 17:38
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Mossaka Mossaka force-pushed the docs/1562-env-vars-cli-reference branch from b909e3a to 3618a7d Compare April 6, 2026 17:40
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Documentation Preview

Documentation build failed for this PR. View logs.

Built from commit 3940b66

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an Environment Variables section to the AWF CLI reference so users can understand which env vars affect CLI behavior (auto-detection, API target overrides, audit output, and API-proxy credential handling), addressing #1562.

Changes:

  • Updates CLI reference frontmatter to mention environment variables.
  • Inserts a new “Environment Variables” section between “Options Details” and “Exit Codes”.
  • Documents auto-detection, API target override, audit, and API proxy credential env vars with tables and admonitions.
Show a summary per file
File Description
docs-site/src/content/docs/reference/cli-reference.md Adds an Environment Variables section + updates page description to include env vars.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (5)

docs-site/src/content/docs/reference/cli-reference.md:766

  • The GITHUB_SERVER_URL description is incomplete vs actual behavior: when it’s a *.ghe.com tenant, AWF auto-adds not only the tenant and api.<tenant> domains, but also the Copilot API and Copilot telemetry subdomains (e.g., copilot-api.<tenant> and copilot-telemetry-service.<tenant>). Documenting those explicitly would better match the implementation and avoid users under-allowlisting domains.

This issue also appears on line 767 of the same file.

  --allow-domains custom-llm.example.com \
  -- command

docs-site/src/content/docs/reference/cli-reference.md:767

  • The ENGINE_API_TARGET row is quite vague compared to what AWF actually adds. The code extracts the hostname (and base domain when the host is api.*) and also auto-adds required Copilot domains (e.g., api.githubcopilot.com, api.enterprise.githubcopilot.com, telemetry.enterprise.githubcopilot.com). Consider calling those out so users know what will be included automatically.
**docs-site/src/content/docs/reference/cli-reference.md:771**
* This file consistently uses titled admonitions (e.g., `:::note[Incompatible with --build-local]`, `:::danger[Security Risk]`), but this new block uses `:::note` without a title. To keep formatting consistent (and avoid any parser/theme edge cases), consider adding a bracketed title here as well.

--rate-limit-rpm <n>

Maximum number of requests per minute per provider. Rate limiting is opt-in — it is only enabled when at least one --rate-limit-* flag is provided.

**docs-site/src/content/docs/reference/cli-reference.md:790**
* The Environment Variables section documents `AWF_AUDIT_DIR`, but the CLI also supports `AWF_SESSION_STATE_DIR` (env fallback for `--session-state-dir`) which affects where Copilot CLI session state is written/preserved. Since this section is intended as a reference for env-driven behavior, it would be good to include `AWF_SESSION_STATE_DIR` (and its corresponding flag) alongside the audit directory variable.

Maximum number of requests per hour per provider.

  • Default: 10000 (when rate limiting is enabled)
  • Requires: --enable-api-proxy

docs-site/src/content/docs/reference/cli-reference.md:803

  • The Credential Isolation admonition says credentials are “never exposed to the agent container”. In practice, when --enable-api-proxy is on, the agent may still receive placeholder values for compatibility (e.g., COPILOT_GITHUB_TOKEN is set to a placeholder to prevent --env-all leaks, and other tooling uses placeholder auth tokens). Consider tightening the wording to clarify that the real secret values are never exposed, rather than implying the env vars are entirely absent.
- **Default:** `52428800` (~50 MB, when rate limiting is enabled)
- **Requires:** `--enable-api-proxy`

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

🔥 Smoke Test Results

Test Status
GitHub MCP connectivity
GitHub.com HTTP connectivity
File write/read

PR: docs: add environment variables section to CLI reference
Author: @Mossaka

Overall: PASS

📰 BREAKING: Report filed by Smoke Copilot

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Smoke Test Results

Overall: PASS

💥 [THE END] — Illustrated by Smoke Claude

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Smoke Test Results
PR titles reviewed:

  • ⚡ pelis-agent-factory-advisor: pre-fetch content, restrict tools, reduce prompt tokens (~21% token savings)
  • chore: upgrade gh-aw to v0.67.0 and recompile all workflows
    Checks: 1✅ 2❌ 3❌ 4❌ 5✅ 6✅ 7❌ 8✅
    Overall: FAIL

🔮 The oracle has spoken through Smoke Codex

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Smoke Test: GitHub Actions Services Connectivity

Check Result
Redis PING (redis-cli @ host.docker.internal:6379) redis-cli not installed
PostgreSQL ready (pg_isready @ host.docker.internal:5432) ❌ No response (timeout)
PostgreSQL query (psql SELECT 1 @ smoketest db) ❌ Connection timeout (172.17.0.1:5432)

All three checks failed. The services are not reachable from this environment — host.docker.internal resolves to 172.17.0.1 but no services responded on ports 6379 or 5432.

🔌 Service connectivity validated by Smoke Services

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx all passed ✅ PASS
Node.js execa all passed ✅ PASS
Node.js p-limit all passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for issue #1713 · ● 828.9K ·

Copy link
Copy Markdown
Collaborator Author

@Mossaka Mossaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot please work on this

Comment on lines +928 to +939
### Credentials (API Proxy Sidecar)

These variables supply API credentials to the API proxy sidecar when `--enable-api-proxy` is active.

| Variable | Description |
|----------|-------------|
| `OPENAI_API_KEY` | OpenAI API key — held securely in the api-proxy sidecar |
| `ANTHROPIC_API_KEY` | Anthropic API key — held securely in the api-proxy sidecar |
| `COPILOT_GITHUB_TOKEN` | GitHub Copilot token — held securely in the api-proxy sidecar |

:::danger[Credential Isolation]
When `--enable-api-proxy` is active, these credentials are **never exposed to the agent container**. They are held exclusively in the api-proxy sidecar, which injects them into outbound requests on the agent's behalf.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to the front of the environemnt variables.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 28bfa46 — moved the Credentials (API Proxy Sidecar) subsection to the front of the Environment Variables section.

Comment on lines +896 to +908
### Auto-Detection

These variables are read by AWF to automatically add required domains to the allowlist, particularly for GitHub Enterprise Cloud (GHEC) and GitHub Enterprise Server (GHES) deployments.

| Variable | Description |
|----------|-------------|
| `GITHUB_SERVER_URL` | GHEC tenant URL. When set to a `*.ghe.com` host, AWF auto-adds the tenant and API domains to the allowlist. |
| `GITHUB_API_URL` | GHEC API URL. Auto-added to the allowlist when the host matches `*.ghe.com`. |
| `ENGINE_API_TARGET` | GHES API URL. The hostname is extracted and GHES-related domains are added to the allowlist. |

:::note
These variables are typically set automatically by GitHub Actions runners. You do not need to configure them manually in most cases.
:::
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this sub section

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 28bfa46 — deleted the Auto-Detection subsection.

@Mossaka Mossaka merged commit cdf2e4f into main Apr 6, 2026
27 of 30 checks passed
@Mossaka Mossaka deleted the docs/1562-env-vars-cli-reference branch April 6, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: add environment variables section to CLI reference

3 participants