Issue #669: std has no access to environment variables (std::env)

Open and answer this issue on GitHub.

decision · opened 2026-10-18 · updated 2026-10-18 · 0 comments

What is missing

A program cannot read GITHUB_TOKEN or any other environment variable. std::cli::args() gives the arguments; the only way to the environment is a foreign declaration of getenv (crates/nikaia-std/src/lib.rs, the note near line 605).

Where it came from

The Nikaia prototype of scripts/site-issues.py: it takes an optional token from GITHUB_TOKEN/GH_TOKEN. std has no way to write that line.

Question for the owner

Does std get env::var(name) -> String? (absent is null, as the contracts text already says about getenv), and is reading the environment a capability like fs::Root, passed in, or an ordinary call? Every common language offers this.

To build (once decided)

  1. ADR + specification text (including the capability question).
  2. std::env::var, std::env::vars.
  3. Test with a variable set by the test runner.

Back to Open Issues