@psg2/env-sync 1.0.2 → 1.1.1

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.
Files changed (3) hide show
  1. package/README.md +15 -4
  2. package/dist/cli.js +186 -7129
  3. package/package.json +19 -9
package/README.md CHANGED
@@ -7,7 +7,13 @@ Define your env vars and secrets in `env-sync.yaml`, then sync them to local `.e
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- bun add -g @psg2/env-sync
10
+ pnpm add -g @psg2/env-sync
11
+ ```
12
+
13
+ Or run it as a one-off without installing:
14
+
15
+ ```bash
16
+ npx @psg2/env-sync
11
17
  ```
12
18
 
13
19
  ## Quick Start
@@ -78,10 +84,12 @@ targets:
78
84
 
79
85
  #### Vercel
80
86
 
81
- Pushes vars to Vercel environment(s) via the Vercel REST API. Backs up current env vars before overwriting.
87
+ Pushes vars to Vercel environment(s) via the Vercel REST API. Before overwriting, the current variables of each environment are backed up to `.env-sync-backups/vercel-<env>.<timestamp>.env`, in `KEY="value"` format. Sensitive variables can't be read back through the API (nor by `vercel env pull`), so the backup records only their key and type as a comment.
82
88
 
83
89
  Values resolved from `op://` references are stored as **Sensitive** variables (write-only on Vercel; the value can never be read back). Literal values stay as regular readable variables. Re-running the sync converts existing variables to the right type.
84
90
 
91
+ With `redeploy: true`, the latest READY deployment of the environment is redeployed through the API — the same effect as `vercel redeploy`. Skipped for `development`, which has no deployments.
92
+
85
93
  ```yaml
86
94
  targets:
87
95
  vercel-prod:
@@ -92,6 +100,8 @@ targets:
92
100
  redeploy: true # Optional (default: false)
93
101
  ```
94
102
 
103
+ **Authentication:** the token is read from `VERCEL_TOKEN` first, then from the Vercel CLI auth store written by `vercel login` (e.g. `~/Library/Application Support/com.vercel.cli/auth.json` on macOS, `~/.local/share/com.vercel.cli/auth.json` on Linux, `%APPDATA%/com.vercel.cli/auth.json` on Windows). The project and team ids come from `.vercel/project.json`, created by `vercel link` (or written by hand with `projectId` and `orgId`). The `vercel` CLI itself is optional at runtime — it's only needed once, to produce the token and the linked project file.
104
+
95
105
  #### GitHub
96
106
 
97
107
  Pushes vars as GitHub repository secrets via the GitHub CLI.
@@ -124,11 +134,12 @@ Options:
124
134
 
125
135
  | Feature | Requires |
126
136
  |---------|----------|
137
+ | Runtime | Node 24 or newer |
127
138
  | 1Password secrets | [`op` CLI](https://developer.1password.com/docs/cli) + `op signin` |
128
- | Vercel targets | [`vercel` CLI](https://vercel.com/docs/cli) |
139
+ | Vercel targets | `VERCEL_TOKEN` env var, or `vercel login` (CLI optional) |
129
140
  | GitHub targets | [`gh` CLI](https://cli.github.com) |
130
141
 
131
- The CLI checks for required tools before syncing and gives clear error messages.
142
+ The CLI checks for `op` and `gh` before syncing and gives clear error messages; Vercel credentials are validated when the target runs.
132
143
 
133
144
  ## Examples
134
145