Skip to content

Commit 7fba57c

Browse files
ostermanclaude
andcommitted
docs(store): document partial stack/component scope
--stack and --component are independent flags: a key can be scoped by stack only, by both, or by neither. The existing examples only showed the two extremes (both set, or neither set), leaving the stack-only case undocumented even though get/delete must match it exactly to find the value set that way. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent c0a7409 commit 7fba57c

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

website/docs/cli/commands/store/usage.mdx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,28 @@ as a secret, use `atmos secret` instead.
8787

8888
## Stack and Component Scope
8989

90-
The `--stack` and `--component` flags are optional for every `atmos store` subcommand. If you
91-
set both flags, Atmos scopes the value the same way [`atmos secret`](/cli/commands/secret/usage)
92-
does. If you set neither flag, Atmos stores a global value:
90+
The `--stack` and `--component` flags are optional for every `atmos store` subcommand, and they
91+
are independent of each other. You can set both flags, only `--stack`, or neither flag. Atmos
92+
uses whichever flags you set to build the key. If you set both flags, Atmos scopes the value the
93+
same way [`atmos secret`](/cli/commands/secret/usage) does. If you set only `--stack`, Atmos
94+
scopes the value to the stack and leaves the component out of the key. If you set neither flag,
95+
Atmos stores a global value:
9396

9497
```shell
95-
# Scoped to a stack and component
98+
# Scoped to a stack and a component
9699
atmos store set app-metadata image_tag sha256:abc123 --stack=prod --component=ecs-service
97100
101+
# Scoped to a stack only (no component)
102+
atmos store set app-metadata region us-east-1 --stack=prod
103+
98104
# Store-global (no stack or component)
99105
atmos store set app-metadata shared_config '{"region":"us-east-1"}'
100106
```
101107

102-
`atmos store get` and `atmos store delete` must use the same `--stack` and `--component` flags
103-
as the `set` command that wrote the value. If `set` used no flags, `get` and `delete` must also
104-
use no flags. Atmos uses the stack and component to build the underlying key.
108+
`atmos store get` and `atmos store delete` must use the exact same `--stack` and `--component`
109+
combination as the `set` command that wrote the value. For example, if `set` used only
110+
`--stack`, `get` and `delete` must also use only `--stack`, with no `--component` flag. Atmos
111+
uses the stack and component together to build the underlying key.
105112

106113
## See Also
107114

0 commit comments

Comments
 (0)