@earthlink/dotvault 0.13.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/LICENSE +21 -0
- package/README.md +229 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +2326 -0
- package/dist/index.js.map +1 -0
- package/package.json +56 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 EarthLink Network
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# @earthlink/dotvault
|
|
2
|
+
|
|
3
|
+
dotvault — sync `.env` / `.npmrc` / `.gitconfig` and any config file across
|
|
4
|
+
machines and CI/CD. No AWS account required.
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/@earthlink/dotvault)
|
|
7
|
+
[](../../LICENSE)
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm i -g @earthlink/dotvault
|
|
13
|
+
# or as a project devDependency
|
|
14
|
+
npm i -D @earthlink/dotvault
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Requires Node >= 20.
|
|
18
|
+
|
|
19
|
+
> Upgrading from `@earthlink/env-sync`? The `env-sync` command keeps working
|
|
20
|
+
> as an alias — see [Compatibility alias](#compatibility-alias-env-sync)
|
|
21
|
+
> below.
|
|
22
|
+
|
|
23
|
+
## Quick start
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# 1. Create project-config.json (first time, if not already in repo)
|
|
27
|
+
dotvault init
|
|
28
|
+
|
|
29
|
+
# 2. Log in — stores tokens in OS keychain (Keychain / libsecret / Credential Manager)
|
|
30
|
+
dotvault login -e you@example.com
|
|
31
|
+
|
|
32
|
+
# 3. Pull all synced files to local disk
|
|
33
|
+
dotvault pull
|
|
34
|
+
|
|
35
|
+
# 4. (Optional) Inject secrets into a dev server without writing any file
|
|
36
|
+
dotvault run -- npm run dev
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Common workflows
|
|
40
|
+
|
|
41
|
+
| Workflow | Commands |
|
|
42
|
+
| -------------------------------------- | ------------------------------------------------------------- |
|
|
43
|
+
| First-time setup | `dotvault init` → `dotvault login` → `dotvault pull` |
|
|
44
|
+
| Join existing project (config in repo) | `dotvault login` → `dotvault pull` |
|
|
45
|
+
| Local dev (no .env on disk) | `dotvault run -- npm run dev` |
|
|
46
|
+
| CI/CD (service token) | set `DOTVAULT_TOKEN=est_…` → `dotvault pull --env production` |
|
|
47
|
+
| Audit history | `dotvault versions DATABASE_URL` |
|
|
48
|
+
| Roll back a secret | `dotvault rollback DATABASE_URL --to 4` |
|
|
49
|
+
| Add a file to sync | `dotvault push .npmrc` |
|
|
50
|
+
| Detect committed secrets | `dotvault scan .` |
|
|
51
|
+
| Share a key org-wide | `dotvault global keys` → `dotvault global use <KEY>` |
|
|
52
|
+
|
|
53
|
+
## All commands
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
dotvault init # create project-config.json
|
|
57
|
+
dotvault login # email + password auth (Cognito)
|
|
58
|
+
dotvault pull # write .env / .npmrc etc. to local disk
|
|
59
|
+
dotvault run -- <cmd> # inject secrets into child process (no file written)
|
|
60
|
+
dotvault set KEY=value # set one or more secrets
|
|
61
|
+
dotvault delete KEY # delete a secret
|
|
62
|
+
dotvault import .env.production # bulk-import from a .env file
|
|
63
|
+
dotvault versions KEY # show version history of a key
|
|
64
|
+
dotvault rollback KEY --to N # restore a key to version N
|
|
65
|
+
dotvault list # list (env, file) inventory for this project
|
|
66
|
+
dotvault push .npmrc # add any file to the sync set
|
|
67
|
+
dotvault files # list synced files
|
|
68
|
+
dotvault scan . # detect committed secrets (offline)
|
|
69
|
+
dotvault global keys # list the org's global key-pool inventory
|
|
70
|
+
dotvault global set K=v [-E env] # set a global-pool value (omit -E for the common value)
|
|
71
|
+
dotvault global delete K [-E env] # delete a global-pool value
|
|
72
|
+
dotvault global use K [--as N] # bind a global key into this project's pull
|
|
73
|
+
dotvault global drop K # unbind a global key from this project
|
|
74
|
+
dotvault global status # show this project's active global-key bindings
|
|
75
|
+
dotvault project create --name X # create a project (headless — ADR-0018)
|
|
76
|
+
dotvault token list --org ID # list service tokens
|
|
77
|
+
dotvault token create --org ID … # mint a service token (shown once)
|
|
78
|
+
dotvault token revoke --org ID … # revoke a service token
|
|
79
|
+
dotvault logout # remove tokens from keychain
|
|
80
|
+
dotvault whoami # report active identity (interactive user OR service token)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Run `dotvault <command> --help` for per-command flags and examples.
|
|
84
|
+
|
|
85
|
+
## Init options
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
dotvault init [options]
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
| Option | Default | Description |
|
|
92
|
+
| ------------------- | ---------------------------- | ---------------------------------------- |
|
|
93
|
+
| `-n, --name <name>` | `basename(cwd)` | Project name |
|
|
94
|
+
| `--api <url>` | `https://api.dotvault.io/v1` | API base URL |
|
|
95
|
+
| `-f, --force` | — | Overwrite existing `project-config.json` |
|
|
96
|
+
|
|
97
|
+
**Success output:**
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
Created project-config.json (project=my-app). Next: dotvault login && dotvault pull
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Pull options
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
dotvault pull --project my-app --env staging --file .env.local
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
| Option | Description |
|
|
110
|
+
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
111
|
+
| `-p, --project <name>` | Override project name from `project-config.json` |
|
|
112
|
+
| `-E, --env <env>` | `development` \| `staging` \| `production`, or any custom env the project has declared (Settings → Environments, ADR-0024) |
|
|
113
|
+
| `-f, --file <file>` | Pull only this file |
|
|
114
|
+
|
|
115
|
+
**Success output (one line per file, then a summary; colors/progress bar
|
|
116
|
+
on a TTY only):**
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
✓ Wrote 12 keys to .env.local (project=my-app, env=development, file=env.local). Markers preserved.
|
|
120
|
+
✔ 1 file synced, 0 excluded, 12 keys total
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Project config
|
|
124
|
+
|
|
125
|
+
The CLI reads `project-config.json` in the working directory root (generated by `dotvault init`, schema 2.7.0):
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"name": "my-app",
|
|
130
|
+
"setup": {
|
|
131
|
+
"bootstrap": {
|
|
132
|
+
"proxy": {
|
|
133
|
+
"apiUrl": "https://api.dotvault.io/v1"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"envSync": {
|
|
137
|
+
"enabled": true,
|
|
138
|
+
"files": [".env"],
|
|
139
|
+
"defaultEnv": "development"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Commit this file to your repository — it contains no secrets. The `apiUrl` field is the only value that must match the hosted platform.
|
|
146
|
+
|
|
147
|
+
## Authentication
|
|
148
|
+
|
|
149
|
+
Token resolution order for each CLI invocation (applies to `pull`, `run`, `set`, `delete`, `import`, `versions`, `rollback`, `list`, `push`, `files`, `whoami`):
|
|
150
|
+
|
|
151
|
+
1. `DOTVAULT_TOKEN` environment variable (or legacy `ENV_SYNC_TOKEN`) — `est_…` service tokens (CI/CD/Lambda)
|
|
152
|
+
2. OS keychain — set by `dotvault login` (interactive user)
|
|
153
|
+
|
|
154
|
+
`dotvault whoami` will tell you which mode is active without making a network call:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
$ DOTVAULT_TOKEN=est_ci_secret_abcdefghij dotvault whoami
|
|
158
|
+
Service token (DOTVAULT_TOKEN=est_ci_secre…) — CI / Lambda mode
|
|
159
|
+
|
|
160
|
+
$ dotvault whoami
|
|
161
|
+
you@example.com (token expires in 2847s)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Service tokens (`dotvault token …`)
|
|
165
|
+
|
|
166
|
+
Org admins can manage service tokens entirely from the CLI:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# List
|
|
170
|
+
dotvault token list --org org_abc
|
|
171
|
+
|
|
172
|
+
# Mint (the secret is shown ONCE — save it immediately)
|
|
173
|
+
dotvault token create --org org_abc --name ci-prod --role viewer
|
|
174
|
+
# Optional: --ttl <seconds>, --project <id>
|
|
175
|
+
|
|
176
|
+
# Revoke
|
|
177
|
+
dotvault token revoke --org org_abc --token-id est_meta_a1b2c3d4
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Admin UI alternative: [app.dotvault.io](https://app.dotvault.io) → your org → Service Tokens.
|
|
181
|
+
|
|
182
|
+
### Headless project creation (`dotvault project create`)
|
|
183
|
+
|
|
184
|
+
Create a project without the admin web console — the piece that lets Claude
|
|
185
|
+
Code / CI onboard a repo unattended (ADR-0018). Mint a `provisioner` token once,
|
|
186
|
+
then create projects with no interactive login:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
# one-time (org admin): mint a provisioner token — creates projects, cannot
|
|
190
|
+
# read or write any secret, cannot mint tokens
|
|
191
|
+
dotvault token create --org org_abc --name claude-provision --role provisioner
|
|
192
|
+
|
|
193
|
+
# thereafter (headless): org is taken from the token, so --org is optional
|
|
194
|
+
DOTVAULT_ADMIN_TOKEN=est_… dotvault project create --name myapp
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Credential precedence for `project create`: `DOTVAULT_ADMIN_TOKEN` (or legacy `ENV_SYNC_ADMIN_TOKEN`) →
|
|
198
|
+
`DOTVAULT_TOKEN` (or legacy `ENV_SYNC_TOKEN`) → keychain login. See the
|
|
199
|
+
[Claude Code onboarding runbook](https://github.com/EarthLinkNetwork/dotvault/blob/main/docs/runbooks/claude-code-onboarding.md).
|
|
200
|
+
|
|
201
|
+
## Compatibility alias (`env-sync`)
|
|
202
|
+
|
|
203
|
+
The package still installs an `env-sync` binary alongside `dotvault` — every
|
|
204
|
+
command works identically under either name. Invoking any command via
|
|
205
|
+
`env-sync` prints a one-line stderr notice:
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
env-sync is now dotvault — the env-sync command keeps working as an alias.
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Legacy `ENV_SYNC_*` environment variables (`ENV_SYNC_TOKEN`,
|
|
212
|
+
`ENV_SYNC_ADMIN_TOKEN`, `ENV_SYNC_API_URL`) are still read as a fallback when
|
|
213
|
+
the corresponding `DOTVAULT_*` variable is unset — there is no forced
|
|
214
|
+
migration deadline.
|
|
215
|
+
|
|
216
|
+
## Links
|
|
217
|
+
|
|
218
|
+
- Admin console: <https://app.dotvault.io>
|
|
219
|
+
- Help & FAQ: <https://app.dotvault.io/admin/help>
|
|
220
|
+
- Full documentation: <https://github.com/EarthLinkNetwork/dotvault#readme>
|
|
221
|
+
- Source: <https://github.com/EarthLinkNetwork/dotvault>
|
|
222
|
+
|
|
223
|
+
## Access
|
|
224
|
+
|
|
225
|
+
The Lambda proxy backend is operated by EarthLink Network. Without a Cognito account in the operator's user pool you cannot fetch secrets — this package is intentionally distributable on npm but operationally private to its tenant.
|
|
226
|
+
|
|
227
|
+
## License
|
|
228
|
+
|
|
229
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
|
|
4
|
+
declare const PACKAGE_VERSION: string;
|
|
5
|
+
declare function buildProgram(): Command;
|
|
6
|
+
declare function renameNoticeFor(argv1: string | undefined): string | null;
|
|
7
|
+
declare function main(argv: readonly string[], argv1?: string | undefined): Promise<number>;
|
|
8
|
+
|
|
9
|
+
export { PACKAGE_VERSION, buildProgram, main, renameNoticeFor };
|