ds secrets
On this page
Defined in cli/commands/secrets.ts. The secrets bundles that every checkout's .env is built from: a shared bundle, one bundle per machine, and an agent bundle, all in the dev account's Secrets Manager. It skips the wrapper's AWS gate and stage bind — pull must still work from its cache when your login has lapsed — and both subcommands check themselves that the session reaches the dev account.
ds secrets pull#
ds secrets pull
Writes .env into every pool checkout that exists (main, wt1, wt2) from the shared and machine bundles, machine winning on the same key, and writes the agent bundle to one private file outside every checkout: ~/.config/devstride/agent.env (mode 600; DEVSTRIDE_AGENT_ENV_FILE moves it). No flags.
-
Agent credentials never enter a
.env. Onlyds agent,ds quickbooks,ds graph,ds workandds -b stripe billing-inventoryread the agent file. Why: everydscommand loads the checkout's.env, so a token kept there would travel with every command in every checkout. On a machine that pulled before this change, one pull removes the old copies from each.env; until then the file wins over them. -
Offline fallback: it keeps a copy in the main checkout's
.ds/secrets-cache.json. If AWS cannot be reached, it writes from that copy with a warning naming the login command. With no cache yet, it fails with that command instead. A cache is never reused under a different machine name. -
Before the bundles are seeded: with no shared bundle it refuses and changes nothing — fill
.envin by hand from.env.sampleuntil then. -
Machine name:
DEVSTRIDE_MACHINE_NAME, else the hostname. With no bundle for this machine it pulls shared and agent keys only, with a warning. If the machine's bundle disappears after a previous pull used one — usually a changed hostname — it refuses rather than drop the machine's stage identity from every.env. -
A hand-made
.envis kept once, as.ds/env-before-secrets-pull. After that, every pull rewrites.envcompletely.
ds secrets set#
pbpaste | ds secrets set <shared|machine|agent> <KEY> [--machine <name>] [--mirror]
Sets one key in one bundle as a new version. The value is read from stdin, never the command line, so it stays out of your shell history; the command refuses to run with a terminal on stdin. One trailing newline is dropped; every other byte, including a certificate's final newline, is kept. Run ds secrets pull afterwards to update .env.
| Flag | Description |
|---|---|
<target> |
shared, machine or agent. Agent service credentials always go to agent |
<key> |
The environment variable name |
--machine <name> |
Set another machine's bundle. Default: this machine |
--mirror |
Also set the key in GitHub Actions — only for a shared key on the repository's mirror allow-list (cli/commands/secrets/mirror-allowlist.ts), which lists only keys the owner has approved for CI. Machine and agent keys are never mirrored; the command says why when it does not mirror |