@keywaysh/cli 0.1.15 → 0.2.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 CHANGED
@@ -1,168 +1,127 @@
1
1
  <div align="center">
2
2
  <h1>Keyway CLI</h1>
3
- <strong>The simplest way to sync your project's environment variables.</strong><br/>
4
- Stop sending <code>.env</code> files on Slack. One command and you're in sync.
5
- <br/><br/>
6
- <a href="https://keyway.sh">keyway.sh</a> ·
7
- <a href="https://github.com/keywaysh/cli">GitHub</a> ·
8
- <a href="https://www.npmjs.com/package/@keywaysh/cli">NPM</a> ·
3
+ <p><strong>Sync .env files across your team in 30 seconds.</strong></p>
4
+ <p>Stop sharing secrets on Slack. One command and everyone's in sync.</p>
5
+ <br/>
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@keywaysh/cli.svg?style=flat-square)](https://www.npmjs.com/package/@keywaysh/cli)
8
+ [![npm downloads](https://img.shields.io/npm/dm/@keywaysh/cli.svg?style=flat-square)](https://www.npmjs.com/package/@keywaysh/cli)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?style=flat-square)](https://opensource.org/licenses/MIT)
10
+ [![.env by Keyway](https://keyway.sh/badge.svg?repo=keywaysh/cli)](https://keyway.sh)
11
+
12
+ <br/>
13
+ <a href="https://keyway.sh">Website</a> •
14
+ <a href="https://docs.keyway.sh">Docs</a> •
15
+ <a href="https://keyway.sh/security">Security</a> •
9
16
  <a href="https://status.keyway.sh">Status</a>
10
- <br/><br/>
11
-
12
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
13
- [![npm version](https://img.shields.io/npm/v/@keywaysh/cli.svg)](https://www.npmjs.com/package/@keywaysh/cli)
14
-
15
17
  </div>
16
18
 
17
- ## Why Keyway?
18
-
19
- Most devs store secrets in... chaotic places:
20
-
21
- - Slack
22
- - Notion
23
- - Discord
24
- - Google Docs
25
- - Lost `.env` files
26
- - Messages you can't find anymore
27
- - Machine of the dev who left the project
28
-
29
- **Keyway fixes that.**
19
+ <br/>
30
20
 
31
- If you have GitHub access to a repo → you have access to its secrets.
32
- No invites. No dashboards. No complex config.
33
- Just one command that works.
34
-
35
- ## Install
21
+ ## Quick Start (30 seconds)
36
22
 
23
+ **1. Setup your project:**
37
24
  ```bash
38
25
  npm install -g @keywaysh/cli
39
- ```
40
-
41
- ## Quick Start
42
-
43
- Inside any project connected to GitHub:
44
-
45
- ```bash
46
- keyway login
47
26
  keyway init
48
27
  ```
49
28
 
50
- What happens:
51
-
52
- 1. Keyway authenticates via GitHub OAuth
53
- 2. Detects your GitHub repo
54
- 3. Creates a vault for this repo
55
- 4. Asks if you want to sync your `.env`
56
-
57
- Then any teammate can simply run:
58
-
29
+ **2. Teammates pull secrets:**
59
30
  ```bash
60
31
  keyway pull
61
32
  ```
62
33
 
63
- And boom: your `.env` is recreated locally.
64
-
65
- ## Commands
66
-
67
- ### `keyway login`
68
-
69
- Authenticate with GitHub through the Keyway OAuth/device flow.
70
-
71
- ```bash
72
- keyway login
73
- ```
74
-
75
- If you prefer using a fine-grained PAT:
76
-
34
+ **3. Deploy to Vercel:**
77
35
  ```bash
78
- keyway login --token
36
+ keyway sync vercel
79
37
  ```
80
38
 
81
- ### `keyway init`
39
+ <br/>
82
40
 
83
- Initialize a vault for the current repository.
41
+ <details>
42
+ <summary><strong>See it in action</strong></summary>
84
43
 
85
- ```bash
86
- keyway init
87
44
  ```
45
+ $ keyway init
46
+ ✓ Logged in as @nicolas
47
+ ✓ Detected repo: acme/backend
48
+ ✓ Vault created
49
+ ? Push your .env to the vault? Yes
50
+ ✓ 12 secrets encrypted and stored
88
51
 
89
- Creates a vault, pushes your `.env`, and sets everything up.
52
+ $ keyway pull
53
+ ✓ .env synced (12 secrets)
54
+ ```
90
55
 
91
- ### `keyway push`
56
+ </details>
92
57
 
93
- Push your local `.env` to the vault.
58
+ <br/>
94
59
 
95
- ```bash
96
- # Push to development (default)
97
- keyway push
60
+ ## Why Keyway?
98
61
 
99
- # Push to a specific environment
100
- keyway push --env production
62
+ Your secrets are probably in:
101
63
 
102
- # Push a different file
103
- keyway push --file .env.staging --env staging
104
- ```
64
+ - 💬 Slack DMs
65
+ - 📝 Notion pages
66
+ - 📧 Old emails
67
+ - 🤷 The laptop of the dev who left
105
68
 
106
- Useful when:
107
- - you added a new variable
108
- - you rotated a key
109
- - you fixed a staging/production mismatch
69
+ **Keyway fixes that.** If you have GitHub repo access → you have secret access. No invites, no dashboards, no YAML.
110
70
 
111
- ### `keyway pull`
71
+ <br/>
112
72
 
113
- Pull secrets from the vault and write them to `.env`.
73
+ ## Install
114
74
 
115
75
  ```bash
116
- # Pull development environment (default)
117
- keyway pull
76
+ # npm
77
+ npm install -g @keywaysh/cli
118
78
 
119
- # Pull from a specific environment
120
- keyway pull --env production
79
+ # pnpm
80
+ pnpm add -g @keywaysh/cli
121
81
 
122
- # Pull to a different file
123
- keyway pull --file .env.local
124
- ```
82
+ # yarn
83
+ yarn global add @keywaysh/cli
125
84
 
126
- Perfect for:
127
- - onboarding a new dev
128
- - syncing your local environment
129
- - switching between machines
85
+ # bun
86
+ bun add -g @keywaysh/cli
87
+ ```
130
88
 
131
- ### `keyway doctor`
89
+ <br/>
132
90
 
133
- Diagnostic command to check your setup.
91
+ ## Commands
134
92
 
135
- ```bash
136
- keyway doctor
93
+ | Command | What it does |
94
+ |---------|--------------|
95
+ | `keyway login` | Authenticate with GitHub |
96
+ | `keyway init` | Create a vault for this repo |
97
+ | `keyway push` | Upload `.env` to vault |
98
+ | `keyway pull` | Download secrets to `.env` |
99
+ | `keyway sync vercel` | Deploy secrets to Vercel |
100
+ | `keyway doctor` | Debug your setup |
137
101
 
138
- # Output as JSON (for CI/CD)
139
- keyway doctor --json
102
+ <br/>
140
103
 
141
- # Strict mode (treat warnings as failures)
142
- keyway doctor --strict
143
- ```
104
+ ### Push & Pull
144
105
 
145
- **Checks performed:**
146
- - Node.js version (≥18.0.0 required)
147
- - Git installation and repository status
148
- - API connectivity
149
- - File system write permissions
150
- - `.gitignore` configuration
151
- - System clock synchronization
106
+ ```bash
107
+ # Push your local .env
108
+ keyway push
152
109
 
153
- ### `keyway logout`
110
+ # Push to a specific environment
111
+ keyway push --env production
154
112
 
155
- Clear stored Keyway credentials.
113
+ # Pull secrets
114
+ keyway pull
156
115
 
157
- ```bash
158
- keyway logout
116
+ # Pull from production
117
+ keyway pull --env production
159
118
  ```
160
119
 
161
- ### `keyway sync`
120
+ <br/>
162
121
 
163
- **One command to deploy your secrets everywhere.**
122
+ ### Sync to Providers
164
123
 
165
- Sync your vault to Vercel, Netlify, and more. No more copy-pasting environment variables between dashboards.
124
+ Deploy your secrets to Vercel, Netlify, or Railway with one command:
166
125
 
167
126
  ```bash
168
127
  keyway sync vercel
@@ -170,153 +129,108 @@ keyway sync netlify
170
129
  keyway sync railway
171
130
  ```
172
131
 
173
- The CLI handles everything:
174
- 1. OAuth connection (first time only)
175
- 2. Project auto-detection
176
- 3. Smart diff (only updates what changed)
177
-
178
- Your local `.env`, Vercel, Netlify, Railway — all in sync with one command.
179
-
180
- ## Security
181
-
182
- Keyway is designed to be **simple and secure** — a major upgrade from Slack or Notion, without the complexity of Hashicorp Vault or AWS Secrets Manager.
183
-
184
- **What we do:**
185
- - AES-256-GCM encryption server-side and client-side token storage
186
- - TLS everywhere (HTTPS enforced)
187
- - GitHub read-only permissions
188
- - No access to your code
189
- - Secrets stored encrypted at rest
190
- - No analytics on secret values (only metadata)
191
- - Encrypted token storage with file permissions
192
-
193
- **What we don't do:**
194
- - No zero-trust enterprise model
195
- - No access to your cloud infrastructure
196
- - No access to your production deployment keys
197
-
198
- For detailed security information, see [SECURITY.md](./SECURITY.md) and [keyway.sh/security](https://keyway.sh/security)
199
-
200
- ## Who is this for?
201
-
202
- Keyway is perfect for:
203
- - Solo developers
204
- - Small teams
205
- - Side-projects
206
- - Early SaaS
207
- - Agencies managing many repos
208
- - Rapid prototyping
132
+ First time: OAuth flow. After that: instant sync.
209
133
 
210
- **Not designed for:**
211
- - Banks
212
- - Governments
213
- - Enterprise zero-trust teams
214
- *(you're looking for Vault, Doppler, or AWS Secrets Manager)*
134
+ <br/>
215
135
 
216
- ## Example Workflow
136
+ ## Real-World Workflows
217
137
 
138
+ **New dev joins the team:**
218
139
  ```bash
219
- git clone git@github.com:acme/backend.git
220
- cd backend
140
+ git clone git@github.com:acme/app.git
141
+ cd app
221
142
  keyway pull
222
- # secrets pulled
223
- npm run dev
143
+ npm run dev # Ready to code
224
144
  ```
225
145
 
226
- Add a new secret:
227
-
146
+ **Rotate an API key:**
228
147
  ```bash
229
- echo "STRIPE_KEY=sk_live_xxx" >> .env
148
+ # Update .env locally, then:
230
149
  keyway push
231
- # 1 secret updated
150
+ # Done. Everyone pulls the update.
232
151
  ```
233
152
 
234
- ## Configuration
235
-
236
- ### GitHub Token (alternative to login)
237
-
238
- If you cannot use the login flow, set a GitHub token manually:
239
-
153
+ **Deploy to production:**
240
154
  ```bash
241
- # Environment variable
242
- export GITHUB_TOKEN=your_github_personal_access_token
243
-
244
- # Or via git config
245
- git config --global github.token your_github_personal_access_token
155
+ keyway push --env production
156
+ keyway sync vercel
246
157
  ```
247
158
 
248
- ### API URL
159
+ <br/>
249
160
 
250
- By default, Keyway uses the production API. To point to another API:
161
+ ## Security
251
162
 
252
- ```bash
253
- export KEYWAY_API_URL=http://localhost:3000
254
- ```
163
+ Keyway is a **major upgrade from Slack** without the complexity of Vault or AWS Secrets Manager.
255
164
 
256
- ### Disable Telemetry
165
+ | Feature | Status |
166
+ |---------|--------|
167
+ | AES-256-GCM encryption | ✅ |
168
+ | Encrypted at rest | ✅ |
169
+ | TLS 1.3 everywhere | ✅ |
170
+ | GitHub-based access control | ✅ |
171
+ | No access to your code | ✅ |
172
+ | SOC2 / enterprise compliance | ❌ |
257
173
 
258
- ```bash
259
- export KEYWAY_DISABLE_TELEMETRY=1
260
- ```
174
+ **We never track secret values.** Only metadata (command usage, repo names).
261
175
 
262
- ## Privacy & Analytics
176
+ [Full security details](https://keyway.sh/security)
263
177
 
264
- **NEVER tracked:**
265
- - Secret names or values
266
- - Environment variable content
267
- - Access tokens
268
- - File contents
178
+ <br/>
269
179
 
270
- **Only tracked:**
271
- - Command usage (init, push, pull)
272
- - Repository names (public info)
273
- - Error messages (sanitized)
180
+ ## Who is this for?
274
181
 
275
- ## Troubleshooting
182
+ **Perfect for:**
183
+ - Solo devs
184
+ - Small teams (2-20)
185
+ - Side projects
186
+ - Agencies
187
+ - Early-stage startups
276
188
 
277
- ### "Not in a git repository"
189
+ **Not for:**
190
+ - Banks, governments, enterprises needing SOC2/zero-trust
191
+ - (Try Vault, Doppler, or AWS Secrets Manager)
278
192
 
279
- ```bash
280
- git init
281
- git remote add origin git@github.com:your-org/your-repo.git
282
- ```
193
+ <br/>
283
194
 
284
- ### "GitHub token not found"
195
+ ## Configuration
285
196
 
286
197
  ```bash
287
- keyway login
288
- # or
289
- export GITHUB_TOKEN=your_token
290
- ```
198
+ # Use a different API
199
+ export KEYWAY_API_URL=https://your-api.com
291
200
 
292
- ### "Vault not found"
293
-
294
- ```bash
295
- keyway init
201
+ # Disable telemetry
202
+ export KEYWAY_DISABLE_TELEMETRY=1
296
203
  ```
297
204
 
298
- ### "You do not have access to this repository"
205
+ <br/>
299
206
 
300
- Make sure you're a collaborator or admin on the GitHub repository.
207
+ ## Troubleshooting
301
208
 
302
- ## TL;DR
209
+ | Error | Fix |
210
+ |-------|-----|
211
+ | "Not in a git repository" | Run `git init && git remote add origin ...` |
212
+ | "Vault not found" | Run `keyway init` |
213
+ | "No access to repository" | Check you're a GitHub collaborator |
303
214
 
304
- ```bash
305
- npm i -g @keywaysh/cli
306
- keyway login
307
- keyway init
308
- keyway pull
309
- ```
215
+ Run `keyway doctor` for full diagnostics.
310
216
 
311
- No more Slack. No more outdated `.env`.
312
- Your team stays perfectly in sync.
217
+ <br/>
313
218
 
314
- ## Support
219
+ ## Links
315
220
 
316
- - **Issues**: [github.com/keywaysh/cli/issues](https://github.com/keywaysh/cli/issues)
317
- - **Email**: hello@keyway.sh
318
- - **Website**: [keyway.sh](https://keyway.sh)
221
+ - **Website:** [keyway.sh](https://keyway.sh)
222
+ - **Docs:** [docs.keyway.sh](https://docs.keyway.sh)
223
+ - **Issues:** [GitHub Issues](https://github.com/keywaysh/cli/issues)
224
+ - **Email:** hello@keyway.sh
225
+
226
+ <br/>
319
227
 
320
228
  ## License
321
229
 
322
- MIT © Nicolas Ritouet
230
+ MIT © [Nicolas Ritouet](https://github.com/nicolasritouet)
231
+
232
+ ---
233
+
234
+ <div align="center">
235
+ <sub>Built with ☕ by <a href="https://keyway.sh">Keyway</a></sub>
236
+ </div>
@@ -3,7 +3,7 @@ import {
3
3
  getAuthFilePath,
4
4
  getStoredAuth,
5
5
  saveAuthToken
6
- } from "./chunk-F4C46224.js";
6
+ } from "./chunk-IVZM2JTT.js";
7
7
  export {
8
8
  clearAuth,
9
9
  getAuthFilePath,
@@ -72,7 +72,6 @@ async function getStoredAuth() {
72
72
  }
73
73
  return auth;
74
74
  } catch {
75
- console.error("Failed to decrypt stored auth, clearing...");
76
75
  clearAuth();
77
76
  return null;
78
77
  }