@rafay99/cvx 0.33.0 → 0.38.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 +37 -6
- package/cvx.1 +31 -4
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -10,6 +10,19 @@ You link a project folder to an account **once**. After that, the moment you
|
|
|
10
10
|
terminals — each grabs its own account as it launches and they all run at the
|
|
11
11
|
same time.
|
|
12
12
|
|
|
13
|
+
```
|
|
14
|
+
(◕‿◕)~@ happy — the right account is active
|
|
15
|
+
(⊙︵⊙)~@ alarmed — this project's team doesn't match the account
|
|
16
|
+
(–ᴗ–)ᶻ~@ asleep — the encrypted vault is locked
|
|
17
|
+
(◕‿<)~@ that's `cvx doctor` coming back clean
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Meet **Vex**, the account chameleon. A chameleon changes color to match its
|
|
21
|
+
surroundings; cvx changes your account to match your project — so Vex wears
|
|
22
|
+
the **active account's color** and her face reacts to what's going on. Every
|
|
23
|
+
account gets a stable color of its own, used across `accounts`, `ls`, and
|
|
24
|
+
switch messages, so you learn to recognize where you are at a glance.
|
|
25
|
+
|
|
13
26
|
## Purpose
|
|
14
27
|
|
|
15
28
|
The Convex CLI only remembers **one** logged-in account at a time — it lives in
|
|
@@ -117,6 +130,14 @@ cd ~/Code/project-b && cvx link work
|
|
|
117
130
|
cd ~/Code/project-c && cvx link personal # one account → many projects
|
|
118
131
|
```
|
|
119
132
|
|
|
133
|
+
## Safety net: the wrong-account guard
|
|
134
|
+
|
|
135
|
+
The Convex CLI stamps a `# team: …` note on the `CONVEX_DEPLOYMENT` line of
|
|
136
|
+
`.env.local`. On every activation (including the automatic cd-hook), cvx
|
|
137
|
+
cross-checks that team against the linked account's teams and warns loudly on
|
|
138
|
+
a mismatch — catching "about to deploy with the wrong account" *before* it
|
|
139
|
+
happens. `cvx status` shows the same warning.
|
|
140
|
+
|
|
120
141
|
## Daily use
|
|
121
142
|
|
|
122
143
|
```bash
|
|
@@ -134,21 +155,24 @@ bun run dev # runs as work — both live simultaneously
|
|
|
134
155
|
| --- | --- |
|
|
135
156
|
| `cvx add [name]` | Store the current `~/.convex` login as an account |
|
|
136
157
|
| `cvx login <name>` | `npx convex login`, then store it as `<name>` |
|
|
137
|
-
| `cvx refresh <account>` | Re-authenticate
|
|
158
|
+
| `cvx refresh <account>` / `--all` | Re-authenticate one account — or every account in one sitting |
|
|
138
159
|
| `cvx link <account> [path]` | Link a project dir (default cwd) to an account |
|
|
139
160
|
| `cvx unlink [path]` | Remove a link |
|
|
140
161
|
| `cvx rename <old> <new>` | Rename an account, keeping its links |
|
|
141
162
|
| `cvx rm <account>` | Forget an account and its links |
|
|
142
|
-
| `cvx use` | Activate this dir's account
|
|
163
|
+
| `cvx use [account]` | Activate by name from anywhere — or this dir's account / an interactive pick |
|
|
143
164
|
| `cvx run <account> -- <cmd>` | Run one command as `<account>` without changing the global login |
|
|
144
165
|
| `cvx open` | Open the Convex dashboard for this project's deployment |
|
|
145
166
|
| `cvx activate [-q]` | Activate this dir's account (the hook calls this) |
|
|
146
167
|
| `cvx status [--json]` | Show the active account and this dir's link |
|
|
147
|
-
| `cvx accounts` | List stored accounts |
|
|
168
|
+
| `cvx accounts` | List stored accounts (with when each token was last verified) |
|
|
148
169
|
| `cvx ls` | List linked projects |
|
|
149
170
|
| `cvx which [path]` | Print the account name for a dir (scripting) |
|
|
150
171
|
| `cvx prompt` | Print the active account name (for a shell prompt segment) |
|
|
151
172
|
| `cvx keychain <status\|enable\|disable>` | Store tokens in the OS keychain instead of a file |
|
|
173
|
+
| `cvx vault <status\|encrypt\|decrypt\|unlock\|lock>` | Passphrase-encrypt stored tokens (unlock once per session) |
|
|
174
|
+
| `cvx export [file]` / `cvx import <file>` | Encrypted vault backup / restore — new-machine setup in one command |
|
|
175
|
+
| `cvx upgrade` | Check for a newer release and print the exact upgrade command |
|
|
152
176
|
| `cvx doctor` | Check setup + per-account token health |
|
|
153
177
|
| `cvx completions <shell>` | Print a completion script (zsh/bash/fish/powershell) |
|
|
154
178
|
| `cvx hook [--install] [--shell …]` | Install the cd-hook (zsh/bash/fish/nu/powershell) |
|
|
@@ -199,11 +223,18 @@ a single binary, so the split costs nothing at build time.
|
|
|
199
223
|
|
|
200
224
|
```
|
|
201
225
|
bin/cvx.ts entry point + command dispatch
|
|
202
|
-
src/
|
|
203
|
-
src/
|
|
204
|
-
src/
|
|
226
|
+
src/paths.ts the ONE place HOME is resolved (CVX_HOME sandbox support)
|
|
227
|
+
src/store.ts data layer: vault I/O, the config swap, token verify
|
|
228
|
+
src/ui.ts the gradient logo, Vex the mascot, welcome, help
|
|
229
|
+
src/colors.ts the palette: brand gradient + per-account colors (re-theme here)
|
|
230
|
+
src/spinner.ts braille spinner for network waits (TTY only)
|
|
205
231
|
src/commands.ts one function per subcommand
|
|
206
232
|
src/hooks.ts zsh / bash / PowerShell shell-hook snippets
|
|
233
|
+
src/keychain.ts OS keychain / DPAPI token backends
|
|
234
|
+
src/crypto.ts scrypt + AES-256-GCM (vault encryption, export files)
|
|
235
|
+
src/vault.ts passphrase-encrypted vault + session unlock
|
|
236
|
+
src/transfer.ts cvx export / import (encrypted backups)
|
|
237
|
+
src/upgrade.ts cvx upgrade (release check)
|
|
207
238
|
src/system.ts external-tool checks (node/npx)
|
|
208
239
|
src/args.ts flag parsing
|
|
209
240
|
man/cvx.1 man page (installed by Homebrew/npm → `man cvx`)
|
package/cvx.1
CHANGED
|
@@ -52,10 +52,12 @@ PowerShell \fB$PROFILE\fR). The shell is auto-detected when \fB--shell\fR is omi
|
|
|
52
52
|
Print a shell completion script (completes commands and account names).
|
|
53
53
|
.SS Everyday
|
|
54
54
|
.TP
|
|
55
|
-
.B cvx use \fR[\fIpath\fR]
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
.B cvx use \fR[\fIaccount\fR|\fIpath\fR]
|
|
56
|
+
With an account name: activate that account globally, from anywhere. With a
|
|
57
|
+
path (or nothing): activate the directory's linked account; if unlinked and
|
|
58
|
+
the terminal is interactive, pick from a list (uses \fBfzf\fR if installed)
|
|
59
|
+
and optionally link the directory. A name wins over a same-named directory
|
|
60
|
+
\(em use \fI./dir\fR to force the path meaning.
|
|
59
61
|
.TP
|
|
60
62
|
.B cvx run \fIaccount\fR \fR[\fB--\fR] \fIcommand\fR ...
|
|
61
63
|
Run \fIcommand\fR with the given account active for that process only, by
|
|
@@ -97,6 +99,24 @@ Show or change where account tokens are stored. \fBenable\fR moves them into the
|
|
|
97
99
|
OS keychain (macOS Keychain, libsecret on Linux, DPAPI on Windows); \fBdisable\fR
|
|
98
100
|
moves them back to the chmod-600 file vault.
|
|
99
101
|
.TP
|
|
102
|
+
.B cvx vault \fR<\fBstatus\fR|\fBencrypt\fR|\fBdecrypt\fR|\fBunlock\fR|\fBlock\fR>
|
|
103
|
+
Passphrase-encrypt the stored tokens (AES-256-GCM, scrypt-derived key).
|
|
104
|
+
\fBunlock\fR caches the key for the session (cleared by \fBlock\fR or a
|
|
105
|
+
reboot); while locked, tokens are unreadable and commands point at
|
|
106
|
+
\fBcvx vault unlock\fR. Scripts can set \fBCVX_PASSPHRASE\fR instead.
|
|
107
|
+
.TP
|
|
108
|
+
.B cvx export \fR[\fIfile\fR] / \fBcvx import \fR\fIfile\fR [\fB--force\fR]
|
|
109
|
+
Write a passphrase-encrypted backup of the vault (accounts + links), and
|
|
110
|
+
restore it on another machine. Import merges; existing names are kept unless
|
|
111
|
+
\fB--force\fR.
|
|
112
|
+
.TP
|
|
113
|
+
.B cvx refresh --all
|
|
114
|
+
Re-authenticate every stored account in one sitting (a browser sign-in each).
|
|
115
|
+
.TP
|
|
116
|
+
.B cvx upgrade
|
|
117
|
+
Check for a newer cvx release and print the exact upgrade command for how it
|
|
118
|
+
was installed (Homebrew, npm/bun, or GitHub tarball).
|
|
119
|
+
.TP
|
|
100
120
|
.B cvx doctor \fR[\fB--no-tokens\fR]
|
|
101
121
|
Check your setup and report problems: Node/npx availability, whether you have a
|
|
102
122
|
Convex login, vault integrity, the token storage backend, the active account,
|
|
@@ -125,6 +145,13 @@ The Convex CLI's global login, which \fBcvx\fR rewrites.
|
|
|
125
145
|
.TP
|
|
126
146
|
.B NO_COLOR
|
|
127
147
|
Disable colored output.
|
|
148
|
+
.TP
|
|
149
|
+
.B CVX_HOME
|
|
150
|
+
Relocate everything cvx touches (vault, global Convex config, hook rc files)
|
|
151
|
+
under this directory \(em a fully isolated sandbox for testing.
|
|
152
|
+
.TP
|
|
153
|
+
.B CVX_PASSPHRASE
|
|
154
|
+
Non-interactive passphrase for \fBcvx vault\fR and \fBcvx export\fR/\fBimport\fR.
|
|
128
155
|
.SH EXAMPLES
|
|
129
156
|
.PP
|
|
130
157
|
Add two accounts and wire up projects:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rafay99/cvx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "Switch Convex accounts per project automatically — run many Convex accounts across projects at once, no login/logout churn, no deploy keys, no tokens in your repos",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"convex", "convex-dev", "convex-cli", "cli", "command-line",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"files": ["launcher.cjs", "cvx.1", "README.md", "LICENSE"],
|
|
20
20
|
"engines": { "node": ">=16" },
|
|
21
21
|
"optionalDependencies": {
|
|
22
|
-
"@rafay99/cvx-darwin-arm64": "0.
|
|
23
|
-
"@rafay99/cvx-darwin-x64": "0.
|
|
24
|
-
"@rafay99/cvx-linux-x64": "0.
|
|
25
|
-
"@rafay99/cvx-linux-arm64": "0.
|
|
26
|
-
"@rafay99/cvx-win32-x64": "0.
|
|
22
|
+
"@rafay99/cvx-darwin-arm64": "0.38.0",
|
|
23
|
+
"@rafay99/cvx-darwin-x64": "0.38.0",
|
|
24
|
+
"@rafay99/cvx-linux-x64": "0.38.0",
|
|
25
|
+
"@rafay99/cvx-linux-arm64": "0.38.0",
|
|
26
|
+
"@rafay99/cvx-win32-x64": "0.38.0"
|
|
27
27
|
}
|
|
28
28
|
}
|