/gaia-config-env
user-facingWhat it does
/gaia-config-env edits the environments section of .gaia/config/project-config.yaml. The environments section defines your deployment environments (staging, production, etc.) with URLs and credential references. The editor preserves all YAML comments and formatting outside the edited section. Every edit goes through a diff preview and confirmation gate before writing.
When to use it
- You need to add, remove, or modify entries in the
environmentsconfiguration section. - You set up a new project and need to configure the
environmentssection.
Prerequisites
- project-config.yaml must exist. Run
/gaia-initto create one if missing.
How to invoke
/gaia-config-env
What it does step by step
- Locate project-config.yaml Resolves the configuration file path.
- Extract the environments section Reads the current environments block. If the section is missing, offers to scaffold a default.
- Present edit menu Shows the current environments configuration and an operation menu (add, remove, edit, view, exit).
- Apply operation Collects the new values and validates them. Credential values must be environment variable names, not literal secrets.
- Diff preview and confirmation Shows a unified diff of what will change. You must confirm before anything is written.
- Write back Writes only the modified section, preserving all other content byte-for-byte.
- Suggest validation Recommends running
/gaia-config-validateto confirm the file still passes schema validation.
Inputs
| Input | Source | Description |
|---|---|---|
| Project configuration | .gaia/config/project-config.yaml | The file containing the environments section. |
Outputs
| Output | Location | Description |
|---|---|---|
| Updated environments section | .gaia/config/project-config.yaml | The modified environments configuration. |
Example session
> /gaia-config-env
Current environments configuration:
development:
url: http://localhost:3000
staging:
url: https://staging.example.com
Operations: [s] set key [r] remove key [v] view [x] exit
> s
Key: production.url
Value: https://app.example.com
Diff preview:
environments:
development:
url: http://localhost:3000
staging:
url: https://staging.example.com
+ production:
+ url: https://app.example.com
Apply this edit? [y/n]
> y
Environments section updated. Run /gaia-config-validate to verify.
What to run next
/gaia-config-validate-- validate the modified configuration file./gaia-config-show environments-- view the section after editing.
Troubleshooting
environments section not found
The section does not exist in your config file. The command offers to scaffold a default:
environments:
staging:
url: https://staging.example.com
credentials:
db_password: STAGING_DB_PASSWORD_VAREdit cancelled
You chose not to apply the edit. The file remains unchanged.