** Docs: System Prompt Override guide links "Persisting Environment Variables" to an anchor that does not exist in authentication.mdx

Open Beginner friendly
#30,394 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@DZH166 is already working on this.

Since Nov 21, 2026.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
82/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
markdown
Domain
documentation

Research direction

The broken link is on line 27 of docs/cli/system-prompt.md, in the "How to enable" section. Open docs/get-started/authentication.mdx at line 361 to confirm the heading's explicit persisting-vars anchor. Change the fragment in the link to #persisting-vars and check that it matches the section about .env persistence. Done when the link targets that heading and no other lines change.

Written by the indexing model from the issue text.

Description

status/need-triage

Draft issue for root to file BEFORE publishing the PR (issue-first gate: PRs without a linked issue are auto-closed by gemini-cli[bot])

Title: Docs: System Prompt Override guide links "Persisting Environment Variables" to an anchor that does not exist in authentication.mdx

Body:

What happened?

In docs/cli/system-prompt.md (section "How to enable"), the link text "Persisting Environment Variables" points to ../get-started/authentication.mdx#persisting-environment-variables:

You can set the environment variable temporarily in your shell, or persist it
via a `.gemini/.env` file. See
[Persisting Environment Variables](../get-started/authentication.mdx#persisting-environment-variables).

The target heading docs/get-started/authentication.mdx:361 is:

## Persisting environment variables <a id="persisting-vars"></a>

Because of the inline <a> tag, the GitHub auto-slug of this heading is persisting-environment-variables-a-idpersisting-varsa — #persisting-environment-variables matches nothing, so readers land at the top of the Authentication page instead of the "Persisting environment variables" section that explains .env persistence.

What did you expect to happen?

The link should resolve to the section it describes. The target file already provides the correct anchor for exactly this purpose: the explicit <a id="persisting-vars"> in the heading, which authentication.mdx itself uses three times for its own internal links (lines 108, 161, 359). The fragment should be #persisting-vars.

Impact

One dead cross-page anchor in the System Prompt Override guide (the .env persistence explanation the sentence promises is unreachable by click). Docs-only, cosmetic but trivially verifiable.

Verification

$ grep -n "^## Persisting" docs/get-started/authentication.mdx
361:## Persisting environment variables <a id="persisting-vars"></a>
$ grep -n "authentication.mdx#" docs/cli/system-prompt.md
27:[Persisting Environment Variables](../get-started/authentication.mdx#persisting-environment-variables).
$ grep -n "#persisting-vars" docs/get-started/authentication.mdx
108:   [Persisting Environment Variables](#persisting-vars).
161:[Persisting Environment Variables](#persisting-vars).
359:    [Persisting Environment Variables](#persisting-vars).

Rendered-HTML check (github.com blob page of authentication.mdx, fetched 2026-11-21): the heading renders with the explicit anchor preserved as id="user-content-persisting-vars", and GitHub maps the #persisting-vars fragment to it — while no element matches #persisting-environment-variables.

Related context

The current open anchor-cleanup PR (#30375, fixing #30374) covers nine other docs files but does not touch docs/cli/system-prompt.md; this link is still broken on current main (checked at eecccfc).


Note for root (not part of the issue body): after filing, (1) verify via API that it is an ISSUE (no pull_request key on GET /repos/google-gemini/gemini-cli/issues/<N>), (2) replace #ISSUE_TO_BE_FILED in pr-body.md with the new issue number and set manifest.issue, (3) post claim-comment.json on the new issue — it asks maintainers for the help wanted label, because author PRs are nudged at 7 days and closed at 14 days without it (.github/scripts/gemini-lifecycle-manager.cjs, PR_CLOSE_DAYS = 14).

I have a one-line docs fix ready and will link a PR here shortly. If maintainers agree, a help wanted label on this issue would help it survive the 14-day PR lifecycle automation — understood if triage decides otherwise. (Prepared with the help of an AI coding assistant; verified against rendered GitHub HTML.)

Dominant language
TypeScript
Stars
109k
Forks
15k
Avg merge
1d 1h
Merged PRs (30d)
106

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google-gemini/gemini-cli

All issues in google-gemini/gemini-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.