@circlesac/vlt-cli 26.5.2 → 26.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +150 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# vlt
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@circlesac/vlt-cli)
|
|
4
|
+
|
|
5
|
+
`vlt` is the official CLI for [Circles Vault](https://github.com/circlesac/vault) — a 1Password Connect-compatible secrets manager on Cloudflare Workers. It speaks the same `op://<vault>/<item>/<field>` secret reference syntax as 1Password's `op` CLI, so most workflows that use `op read`, `op inject`, or `op run` work unchanged by setting `OP_CONNECT_HOST`.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# macOS / Linux via Homebrew
|
|
11
|
+
brew install circlesac/tap/vlt
|
|
12
|
+
|
|
13
|
+
# Any Node.js environment (works on GitHub Actions ubuntu-latest)
|
|
14
|
+
npm install -g @circlesac/vlt-cli
|
|
15
|
+
|
|
16
|
+
# Static binaries (no Node required)
|
|
17
|
+
# Download from https://github.com/circlesac/vlt-cli/releases/latest
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Authentication
|
|
21
|
+
|
|
22
|
+
`vlt` resolves credentials in this order:
|
|
23
|
+
|
|
24
|
+
1. **`OP_CONNECT_HOST` + `OP_CONNECT_TOKEN`** — drop-in for `op` CLI; useful when you already have a token.
|
|
25
|
+
2. **`OP_CONNECT_HOST` + GitHub Actions OIDC** — if `ACTIONS_ID_TOKEN_REQUEST_URL`/`_TOKEN` are present (workflow has `id-token: write`), `vlt` fetches a short-lived OIDC token automatically. No stored secrets.
|
|
26
|
+
3. **`crcl` config** (`~/.config/crcl/config`) — interactive user. Run `crcl login`, optionally `--profile dev` to target the dev environment.
|
|
27
|
+
|
|
28
|
+
`vlt whoami` shows the resolved host + org.
|
|
29
|
+
|
|
30
|
+
## Common commands
|
|
31
|
+
|
|
32
|
+
### Read a secret
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
vlt read "op://my-vault/db-credentials/password"
|
|
36
|
+
vlt read -n "op://my-vault/db-credentials/password" # no trailing newline
|
|
37
|
+
vlt read -o /tmp/password "op://..." # write to file
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Inject secrets into a template
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# template.env
|
|
44
|
+
DB_HOST={{op://my-vault/db-credentials/host}}
|
|
45
|
+
DB_PASS={{op://my-vault/db-credentials/password}}
|
|
46
|
+
|
|
47
|
+
# Inject and write
|
|
48
|
+
vlt inject -i template.env -o .env
|
|
49
|
+
|
|
50
|
+
# Or pipe
|
|
51
|
+
cat template.env | vlt inject > .env
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Run a command with secrets injected as env vars
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
DB_PASS="op://my-vault/db-credentials/password" vlt run -- ./deploy.sh
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`vlt run` scans the process env for `op://` references and replaces them with the actual secret values before exec'ing the command.
|
|
61
|
+
|
|
62
|
+
### Manage vaults
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
vlt vault list
|
|
66
|
+
vlt vault create "production"
|
|
67
|
+
vlt vault edit "production" --name "prod-secrets"
|
|
68
|
+
vlt vault delete "old-vault"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Manage items
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
vlt item create --vault prod-secrets --category login --title "DB" username=admin password=secret
|
|
75
|
+
vlt item list --vault prod-secrets
|
|
76
|
+
vlt item get "DB" --vault prod-secrets --format json
|
|
77
|
+
vlt item edit "DB" --vault prod-secrets password=newpass
|
|
78
|
+
vlt item delete "DB" --vault prod-secrets
|
|
79
|
+
vlt item move "DB" --current-vault staging --destination-vault prod-secrets
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Documents
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
vlt document create ./cert.pem --vault prod-secrets --title "TLS Cert"
|
|
86
|
+
vlt document list --vault prod-secrets
|
|
87
|
+
vlt document get "TLS Cert" --vault prod-secrets -o ./cert.pem
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### OIDC grants (operator-only)
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Allow circlesac/my-app's workflows to read any vault in the org
|
|
94
|
+
vlt oidc grant create circlesac/my-app
|
|
95
|
+
|
|
96
|
+
# Narrow by env, restrict to a vault, grant write access
|
|
97
|
+
vlt oidc grant create circlesac/my-app \
|
|
98
|
+
--env production --vault prod-secrets --role write
|
|
99
|
+
|
|
100
|
+
# Org-wildcard
|
|
101
|
+
vlt oidc grant create "circlesac/*" --role read
|
|
102
|
+
|
|
103
|
+
# Inspect / change / revoke
|
|
104
|
+
vlt oidc grant list
|
|
105
|
+
vlt oidc grant get <id>
|
|
106
|
+
vlt oidc grant edit <id> --role write
|
|
107
|
+
vlt oidc grant edit <id> --env null # clear an optional field
|
|
108
|
+
vlt oidc grant delete <id>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`vault create / edit / delete`, `oidc grant *`, and `whoami` require operator (user JWT) auth. OIDC tokens from GitHub Actions are scoped to data-plane operations (read items, write items if `role=write`) and cannot manage vaults or grants regardless of role.
|
|
112
|
+
|
|
113
|
+
## GitHub Actions workflow
|
|
114
|
+
|
|
115
|
+
After registering a grant once, a workflow needs zero stored secrets:
|
|
116
|
+
|
|
117
|
+
```yaml
|
|
118
|
+
permissions:
|
|
119
|
+
id-token: write
|
|
120
|
+
contents: read
|
|
121
|
+
|
|
122
|
+
jobs:
|
|
123
|
+
deploy:
|
|
124
|
+
runs-on: ubuntu-latest
|
|
125
|
+
env:
|
|
126
|
+
OP_CONNECT_HOST: https://vault.circles.ac/<your-org>
|
|
127
|
+
steps:
|
|
128
|
+
- uses: actions/checkout@v4
|
|
129
|
+
- run: npm install -g @circlesac/vlt-cli
|
|
130
|
+
- run: vlt run -- ./deploy.sh
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
`vlt` detects the runner's `ACTIONS_ID_TOKEN_REQUEST_URL` / `_TOKEN` env vars, mints a GitHub OIDC token with the right audience, and sends it to Vault. The server verifies GitHub's signature, matches the claims (`repository`, `environment`, `ref`) against the grant ACL, and serves the request.
|
|
134
|
+
|
|
135
|
+
## Profile / org overrides
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
vlt vault list # default profile, default org
|
|
139
|
+
vlt vault list --profile dev # crcl 'dev' profile
|
|
140
|
+
vlt vault list --org other-org # different org slug
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Further reading
|
|
144
|
+
|
|
145
|
+
- Server-side architecture, schema, audit log, OIDC details: see the [server README](https://github.com/circlesac/vault).
|
|
146
|
+
- `op` CLI compatibility matrix: [`docs/api-compatibility.md`](https://github.com/circlesac/vault/blob/main/docs/api-compatibility.md) in the server repo.
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
Internal — Circles Inc.
|
package/package.json
CHANGED