@rafay99/cvx 0.18.0 → 0.24.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.
Files changed (3) hide show
  1. package/README.md +50 -4
  2. package/cvx.1 +43 -10
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -134,16 +134,62 @@ bun run dev # runs as work — both live simultaneously
134
134
  | --- | --- |
135
135
  | `cvx add [name]` | Store the current `~/.convex` login as an account |
136
136
  | `cvx login <name>` | `npx convex login`, then store it as `<name>` |
137
+ | `cvx refresh <account>` | Re-authenticate an account (refresh its token) |
137
138
  | `cvx link <account> [path]` | Link a project dir (default cwd) to an account |
138
139
  | `cvx unlink [path]` | Remove a link |
140
+ | `cvx rename <old> <new>` | Rename an account, keeping its links |
141
+ | `cvx rm <account>` | Forget an account and its links |
142
+ | `cvx use` | Activate this dir's account — or pick one interactively if unlinked |
143
+ | `cvx run <account> -- <cmd>` | Run one command as `<account>` without changing the global login |
144
+ | `cvx open` | Open the Convex dashboard for this project's deployment |
139
145
  | `cvx activate [-q]` | Activate this dir's account (the hook calls this) |
140
- | `cvx status` | Show the active account and this dir's link |
146
+ | `cvx status [--json]` | Show the active account and this dir's link |
141
147
  | `cvx accounts` | List stored accounts |
142
148
  | `cvx ls` | List linked projects |
143
149
  | `cvx which [path]` | Print the account name for a dir (scripting) |
144
- | `cvx doctor` | Check your setup (node/npx, login, vault, hook) |
145
- | `cvx rm <account>` | Forget an account and its links |
146
- | `cvx hook [--install]` | Print (or install) the zsh cd-hook |
150
+ | `cvx prompt` | Print the active account name (for a shell prompt segment) |
151
+ | `cvx keychain <status\|enable\|disable>` | Store tokens in the OS keychain instead of a file |
152
+ | `cvx doctor` | Check setup + per-account token health |
153
+ | `cvx completions <shell>` | Print a completion script (zsh/bash/fish/powershell) |
154
+ | `cvx hook [--install] [--shell …]` | Install the cd-hook (zsh/bash/fish/nu/powershell) |
155
+
156
+ ### Run a command as another account, without switching
157
+
158
+ ```sh
159
+ cvx run work -- npx convex logs # from anywhere, as the "work" account
160
+ cvx run . -- npx convex deploy # "." = this directory's linked account
161
+ ```
162
+
163
+ `cvx run` sets `CONVEX_OVERRIDE_ACCESS_TOKEN` for that one process only — it never
164
+ touches your global login, so it's safe in scripts and alongside running dev servers.
165
+
166
+ ### Store tokens in the OS keychain (optional)
167
+
168
+ By default tokens live in `~/.convex-switch/` (chmod 600). To move them into the
169
+ **macOS Keychain**, **libsecret** (Linux), or **DPAPI** (Windows):
170
+
171
+ ```sh
172
+ cvx keychain enable # migrates every account into the OS keychain
173
+ cvx keychain disable # moves them back to the file vault
174
+ ```
175
+
176
+ ### Shell prompt + completions
177
+
178
+ ```sh
179
+ cvx completions zsh >> ~/.zshrc # tab-complete commands + account names
180
+ # starship: show the active account in your prompt
181
+ # [custom.cvx] command = "cvx prompt" when = "true" format = "[($output )]($style)"
182
+ ```
183
+
184
+ ## Upgrading from an older version
185
+
186
+ The vault is schema-versioned. The first time you run an interactive `cvx`
187
+ command after updating from an older release, cvx shows a one-time prompt and,
188
+ on confirmation, re-secures your tokens in the best available backend (OS
189
+ keychain if present, otherwise the chmod-600 file vault) and upgrades the vault
190
+ format. It's mandatory and runs once — you never see it again. The cd-hook and
191
+ scripts keep working throughout; the prompt only appears in an interactive
192
+ terminal.
147
193
 
148
194
  ## Project layout
149
195
 
package/cvx.1 CHANGED
@@ -28,6 +28,9 @@ is verified against Convex; if \fIname\fR is omitted the team slug is used.
28
28
  .B cvx login \fIname\fR
29
29
  Force a fresh browser sign-in (\fBconvex login --force\fR), then store it as
30
30
  \fIname\fR. Use this to add a second or third account.
31
+ .TP
32
+ .B cvx refresh \fIaccount\fR
33
+ Re-authenticate an existing account and refresh its stored token.
31
34
  .SS Wire projects to accounts
32
35
  .TP
33
36
  .B cvx link \fIaccount\fR \fR[\fIpath\fR]
@@ -37,19 +40,40 @@ account may be linked to many projects.
37
40
  .B cvx unlink \fR[\fIpath\fR]
38
41
  Remove a link.
39
42
  .TP
40
- .B cvx hook \fR[\fB--install\fR] [\fB--shell\fR \fIzsh\fR|\fIbash\fR|\fIpowershell\fR]
43
+ .B cvx rename \fIold\fR \fInew\fR
44
+ Rename an account, keeping every link that pointed at it.
45
+ .TP
46
+ .B cvx hook \fR[\fB--install\fR] [\fB--shell\fR \fIzsh\fR|\fIbash\fR|\fIfish\fR|\fInu\fR|\fIpowershell\fR]
41
47
  Print the directory-change hook, or with \fB--install\fR wire it into the shell
42
- startup file (\fI~/.zshrc\fR, \fI~/.bashrc\fR, or the PowerShell \fB$PROFILE\fR).
43
- The shell is auto-detected when \fB--shell\fR is omitted (PowerShell on Windows).
48
+ startup file (\fI~/.zshrc\fR, \fI~/.bashrc\fR, fish/nushell config, or the
49
+ PowerShell \fB$PROFILE\fR). The shell is auto-detected when \fB--shell\fR is omitted.
50
+ .TP
51
+ .B cvx completions \fIzsh\fR|\fIbash\fR|\fIfish\fR|\fIpowershell\fR
52
+ Print a shell completion script (completes commands and account names).
44
53
  .SS Everyday
45
54
  .TP
55
+ .B cvx use \fR[\fIpath\fR]
56
+ Activate the account linked to a directory. If the directory isn't linked and
57
+ the terminal is interactive, pick an account from a list (uses \fBfzf\fR if
58
+ installed) and optionally link the directory.
59
+ .TP
60
+ .B cvx run \fIaccount\fR \fR[\fB--\fR] \fIcommand\fR ...
61
+ Run \fIcommand\fR with the given account active for that process only, by
62
+ setting \fBCONVEX_OVERRIDE_ACCESS_TOKEN\fR \(em the global login is never
63
+ touched. Use \fB.\fR as \fIaccount\fR for the current directory's linked account.
64
+ .TP
65
+ .B cvx open
66
+ Open the Convex dashboard for the current project's deployment (read from
67
+ \fI.env.local\fR), or the dashboard home if none is configured.
68
+ .TP
46
69
  .B cvx activate \fR[\fB-q\fR] [\fIpath\fR]
47
70
  Activate the account linked to a directory by rewriting the global config. The
48
71
  shell hook calls this on every \fBcd\fR; \fB-q\fR silences the "nothing to do"
49
72
  cases.
50
73
  .TP
51
- .B cvx status
52
- Show the active account and the current directory's link.
74
+ .B cvx status \fR[\fB--json\fR]
75
+ Show the active account and the current directory's link. \fB--json\fR emits a
76
+ machine-readable object for scripting.
53
77
  .TP
54
78
  .B cvx accounts
55
79
  List stored accounts; the active one is marked.
@@ -59,16 +83,25 @@ List linked projects; the current directory is marked.
59
83
  .TP
60
84
  .B cvx which \fR[\fIpath\fR]
61
85
  Print the account name for a directory (exit 1 if none). For scripting.
86
+ .TP
87
+ .B cvx prompt
88
+ Print the active account name and nothing else \(em for embedding in a shell
89
+ prompt. Fast and never errors.
62
90
  .SS Manage
63
91
  .TP
64
92
  .B cvx rm \fIaccount\fR
65
93
  Forget an account and any links pointing at it.
66
94
  .TP
67
- .B cvx doctor
68
- Check your setup and report problems: Node/npx availability (needed for
69
- \fBcvx login\fR), whether you have a Convex login, vault integrity, the active
70
- account, and whether the shell hook is installed. Exits non-zero if something
71
- needs attention.
95
+ .B cvx keychain \fR[\fIstatus\fR|\fIenable\fR|\fIdisable\fR]
96
+ Show or change where account tokens are stored. \fBenable\fR moves them into the
97
+ OS keychain (macOS Keychain, libsecret on Linux, DPAPI on Windows); \fBdisable\fR
98
+ moves them back to the chmod-600 file vault.
99
+ .TP
100
+ .B cvx doctor \fR[\fB--no-tokens\fR]
101
+ Check your setup and report problems: Node/npx availability, whether you have a
102
+ Convex login, vault integrity, the token storage backend, the active account,
103
+ and whether the shell hook is installed. Also pings Convex to check each stored
104
+ token's health (skip that with \fB--no-tokens\fR). Exits non-zero on any problem.
72
105
  .TP
73
106
  .B cvx welcome
74
107
  Show the welcome screen again.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rafay99/cvx",
3
- "version": "0.18.0",
3
+ "version": "0.24.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.js", "cvx.1", "README.md", "LICENSE"],
20
20
  "engines": { "node": ">=16" },
21
21
  "optionalDependencies": {
22
- "@rafay99/cvx-darwin-arm64": "0.18.0",
23
- "@rafay99/cvx-darwin-x64": "0.18.0",
24
- "@rafay99/cvx-linux-x64": "0.18.0",
25
- "@rafay99/cvx-linux-arm64": "0.18.0",
26
- "@rafay99/cvx-win32-x64": "0.18.0"
22
+ "@rafay99/cvx-darwin-arm64": "0.24.0",
23
+ "@rafay99/cvx-darwin-x64": "0.24.0",
24
+ "@rafay99/cvx-linux-x64": "0.24.0",
25
+ "@rafay99/cvx-linux-arm64": "0.24.0",
26
+ "@rafay99/cvx-win32-x64": "0.24.0"
27
27
  }
28
28
  }