ssm-cli is the command-line client for Simple Secrets Manager.
Tip
Using a coding agent (Claude Code, Codex)? Run ssm-cli skills install to
teach it how to use ssm-cli safely — discover secrets without leaking
values, run commands with secrets injected, and ask before any mutation.
One command, project or user scope. See
Skills for coding agents.
Install globally with uv tools:
uv tool install git+https://github.com/bearlike/Simple-Secrets-Manager.git
uv tool update-shell
ssm-cli --helpIf command is not found in a new shell:
export PATH="$(uv tool dir --bin):$PATH"Upgrade later:
uv tool upgrade simple-secrets-managerIf installed from Git and you want a fresh reinstall:
uv tool install --force git+https://github.com/bearlike/Simple-Secrets-Manager.gitUninstall:
uv tool uninstall simple-secrets-managerUse UVX directly when you do not want a persistent install:
uvx --from git+https://github.com/bearlike/Simple-Secrets-Manager.git ssm-cli --helpPin to tag:
uvx --from git+https://github.com/bearlike/Simple-Secrets-Manager.git@v1.5.0 ssm-cli --helpConfigure backend URL:
ssm-cli configure --base-url http://localhost:8080/api --profile devAuthenticate:
ssm-cli login --profile dev
# or
ssm-cli auth set-token --profile dev --token "<token>"Set default project/config for current directory:
ssm-cli setup --project my-project --config dev --profile devRun your app with injected secrets:
ssm-cli run --profile dev -- python app.pyssm-cli run resolves secret references by default (${KEY}, ${config.KEY}, ${project.config.KEY}) through the backend API.
Verify injection against an existing config by printing one expected key from the child environment:
ssm-cli run --profile dev -- printenv EXAMPLE_API_KEYDownload secrets:
ssm-cli secrets download --profile dev --format json
ssm-cli secrets download --profile dev --format env
ssm-cli secrets download --profile dev --format json --rawNote
JSON export meta carries a per-key sensitive flag (absent = sensitive),
and, when the export is requested with include_provenance=true, source
(the config slug that supplied the effective value) and isInherited. With
that flag an env export also prepends a # from <config>[: <description>]
comment above each key. Provenance and sensitivity live in metadata only, so
they never change the export ETag used for change detection.
Set one secret:
ssm-cli secrets set --profile dev --key API_KEY --value "super-secret"
printf '%s' "$TOKEN_VALUE" | ssm-cli secrets set --profile dev --key TOKEN --value-stdinUpload many secrets:
ssm-cli secrets upload --profile dev --env-file .env.production
ssm-cli secrets upload --profile dev --json-file ./secrets.json
cat ./secrets.json | ssm-cli secrets upload --profile dev --stdin --format jsonMaterialize secrets as a dotenv file (for env_file: / EnvironmentFile=):
# Writes <project>-<config>.env into the directory, mode 0640.
ssm-cli secrets materialize --profile dev --dir /run/ssm
# Writes one exact file — what systemd's EnvironmentFile= expects.
ssm-cli secrets materialize --profile dev --path /etc/gluetun.envA container's environment is frozen when it is created, so its secrets have to
be on disk before docker compose up — compose refuses to start a service
whose env_file is missing. This command is that bootstrap (and the systemd
entry point); ssm-reload keeps the same file fresh
afterwards, rendering byte-identical contents so the two never fight. Values
are double-quoted and escaped (\, ", $, newlines), so a secret containing
$ is never interpolated away by the compose client.
Mount secrets to FIFO:
ssm-cli secrets mount --profile dev --path /tmp/ssm-secrets.fifo --format json
ssm-cli secrets mount --profile dev --path /tmp/ssm-secrets.fifo --format env --rawValidate current session:
ssm-cli whoami --profile devDiscover projects, configs, and secret keys (read-only, safe for agents):
ssm-cli projects list --profile dev
ssm-cli configs list --project my-project --profile dev
ssm-cli secrets keys --profile devprojects list and configs list resolve the base URL/token (and, for
configs, the project) through the usual resolution order. secrets keys
prints KEY NAMES only — never values — so an agent can learn what a config
contains without a secret ever landing in a log or transcript.
Workspace and RBAC operations:
ssm-cli workspace settings --profile dev
ssm-cli workspace members --profile dev
ssm-cli workspace member-add --username alice --password 'StrongPass123' --workspace-role viewer --profile dev
ssm-cli workspace groups --profile dev
ssm-cli workspace project-members --project scraper-handler --profile devProfile management:
ssm-cli profile list
ssm-cli profile use dev
ssm-cli profile set dev --base-url http://localhost:8080/api --project my-project --config dev --activateIf you drive a project with a coding agent (Claude Code, Codex),
ssm-cli skills install writes a short using-ssm skill that teaches the
agent to discover secrets safely, run commands with secrets injected, and ask
for consent before any mutation or before revealing a secret value.
# Choose scope interactively (prompts per scope on a TTY)
ssm-cli skills install
# Or be explicit
ssm-cli skills install --target project # ./.claude, ./.codex
ssm-cli skills install --target user # ~/.claude, ~/.codex
ssm-cli skills install --target all --agent claudeFlags:
--agent claude|codex|all(defaultall) — which agent(s) to target.--target user|project|all— install scope. Omit it on an interactive terminal to answer a short y/n prompt per scope; on a non-interactive shell you must pass--targetor the command exits2with a usage hint.
Destinations (the written file is .../skills/using-ssm/SKILL.md):
| Agent | Project scope | User scope |
|---|---|---|
claude |
./.claude/skills/using-ssm/ |
~/.claude/skills/using-ssm/ |
codex |
./.codex/skills/using-ssm/ |
~/.codex/skills/using-ssm/ |
User-scope installs land only where the tool is detected (~/.claude exists
for claude, ~/.codex for codex); an undetected tool is skipped with a
message, not an error. Project scope always installs and creates directories.
The skill file is generated and overwritten on every run.
--base-urlSSM_BASE_URL- active profile in global config
- global
base_url
--project/--configSSM_PROJECT/SSM_CONFIG- local directory config (
.ssm/config.json) - active profile defaults in global config
--profileSSM_PROFILE- local directory profile (
.ssm/config.json) - global active profile
default
SSM_TOKEN- stored token for
<profile>@<base_url>in keyring - stored token in file fallback
- Global config:
~/.config/ssm/config.json - Local config:
<current-dir>/.ssm/config.json - Credential fallback:
~/.config/ssm/credentials.json(0600) - Cache:
~/.cache/ssm/secrets/<hash>.json
Test overrides via env vars:
SSM_GLOBAL_CONFIG_FILESSM_LOCAL_CONFIG_FILESSM_CREDENTIALS_FILESSM_CACHE_DIR
ssm-cli workspace ... covers user/group/RBAC management:
- Settings:
workspace settingsworkspace settings-set --default-workspace-role ... --default-project-role ... --referencing-enabled|--referencing-disabled
- Members:
workspace membersworkspace member-addworkspace member-updateworkspace member-disable
- Groups:
workspace groupsworkspace group-add|group-update|group-deleteworkspace group-members|group-members-set
- Group mappings:
workspace mappingsworkspace mapping-addworkspace mapping-delete
- Project role assignments:
workspace project-members --project <slug>workspace project-member-set --project <slug> --subject-type user|group --subject-id <username|group-slug> --role admin|collaborator|viewer|noneworkspace project-member-remove ...
Role behavior:
owner: full workspace and project management.admin: manage projects/tokens/groups/project-memberships; cannot change workspace settings or create/modify workspace users.collaboratorandviewer: can list workspace members; project access comes from direct/group project role assignments.
runexits with child process exit code.- Configuration/auth errors typically exit
2. - Offline cache miss exits
4. secrets uploadexits1when any key fails to write.
./scripts/quality.sh check
cd frontend && npm run lint && npm run build