Select the active setup#
Open Switch setup in godmode. Choose a Key environment and Business profile, then select Use this setup. In the terminal:
godmode use --env acme-test \
--context acme
godmode activeThe named selections must already exist. The pair is saved in active.json for future commands. Recent setups shows up to five prior pairs when history exists. Choose a pair and confirm it before switching.
Automatic uses the selected environment's own profile. To return to the original setup, run godmode use --env default --context -.
Copy a key file#
Copy an existing environment to create an independent snapshot of all its keys:
godmode env create acme-copy \
--copy defaultFor a new client or account, start empty and add only its keys:
godmode env create acme-test
godmode --env acme-test \
--context - setup stripeFuture edits and rotations affect only the file you edit. Each environment uses its own keys.
Reuse one business profile#
If the same business uses both test and live keys, create its profile once:
godmode context create acme
godmode --context acme profileUse --context acme with either key environment to select the same business facts. For a profile that belongs exclusively to one environment, edit it with --env NAME --context -.
Give an agent the selection#
Print a task note with both selections pinned:
godmode --env acme-test \
--context acme agents --printPaste it into the task. For shell commands, godmode active --command prints the prefix for the current pair. godmode run also passes the selected pair to nested Godmode commands.
For each selection, command flags take precedence over shell variables (GODMODE_ENV and GODMODE_CONTEXT), then the saved pair. Pass both flags to pin the entire pair. godmode use with only one flag saves the other axis as currently resolved. An agent already running may hold its own scope, so give it an updated task note to switch.
Inspect the files#
| Command | What it shows |
|---|---|
godmode active --json | The resolved setup, paths, and where each selection came from |
godmode env list --json | Available environments and local paths |
godmode path | The selected key file |
godmode profile path | The selected profile file |
Reuse a saved key name#
A context alias maps a requested key to the name already in the selected environment:
godmode context map acme \
STRIPE_TEST_SECRET_KEY \
ACME_STRIPE_KEY
godmode --env acme-test \
--context acme run \
STRIPE_API_KEY=STRIPE_TEST_SECRET_KEY \
-- stripe balance retrieveHere ACME_STRIPE_KEY must already exist in acme-test. A missing mapped key stops the command. Remove the alias with godmode context unmap acme STRIPE_TEST_SECRET_KEY.
Repair a missing selection#
Run godmode env list and godmode context list to find valid choices, then save an existing pair with godmode use.
If active.json is malformed, pass both selection flags to work around it for one command. Repair the file or move it aside before saving another default.