env_generate
Generates a .env file from a .q-ring.json manifest, resolving secret keys from the keyring. Missing, expired, or stale keys are noted as comments.
Instructions
[project] Render a complete .env file body from the project's .q-ring.json manifest, resolving each declared key from the keyring. Use when a build step or local runtime needs a real .env materialized on disk and you want exactly the keys the manifest declares; prefer export_secrets when you want every key in scope (manifest-agnostic) and exec_with_secrets to inject secrets into a child process without writing them to a file. Reads values (records 'read' audit events) and collapses superposition for the requested env. Returns the raw .env text, with # MISSING (required): KEY / # EXPIRED: KEY / # STALE: KEY warnings appended as comments. Missing keys appear as commented-out # KEY= placeholders so the file remains a valid drop-in.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Environment slug used to collapse superposition when a secret has multiple per-env states. Examples: 'dev', 'staging', 'prod'. If omitted, the secret's defaultEnv is used. | |
| projectPath | No | Absolute path to the project root for project-scoped secrets and policy resolution. Defaults to the MCP server's current working directory when omitted. |