@workover/cli 0.4.0 → 0.5.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 +4 -2
- package/bin/workover.mjs +22 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @workover/cli
|
|
2
2
|
|
|
3
|
-
The command line for [Workover](https://workover.
|
|
3
|
+
The command line for [Workover](https://workover.io) — sign in from your terminal so tools like Claude Code can read and cowork on your documents.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -121,7 +121,9 @@ Either surface, same operations, same permissions.
|
|
|
121
121
|
|
|
122
122
|
## Configuration
|
|
123
123
|
|
|
124
|
-
- `WORKOVER_API` — point the CLI at a different Workover API
|
|
124
|
+
- `WORKOVER_API` — point the CLI at a different Workover API. Defaults to `https://api.workover.io`.
|
|
125
|
+
`workover login` prints the environment it signed into, because there is only one stored token and
|
|
126
|
+
signing in replaces it.
|
|
125
127
|
|
|
126
128
|
---
|
|
127
129
|
|
package/bin/workover.mjs
CHANGED
|
@@ -24,8 +24,20 @@ import {
|
|
|
24
24
|
contentCommitted,
|
|
25
25
|
} from '../lib.mjs';
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
/*
|
|
28
|
+
* PRODUCTION is the default, because this package is published to npm and everyone who installs it
|
|
29
|
+
* is a customer.
|
|
30
|
+
*
|
|
31
|
+
* It defaulted to `api.workover.dev` — staging — which is ours, internal, and behind Cloudflare
|
|
32
|
+
* Access. So every command an outside user ran went to an environment they cannot reach, and the
|
|
33
|
+
* only people for whom the CLI worked out of the box were us. It also meant `workover login` from a
|
|
34
|
+
* production checkout silently signed into staging and replaced whatever token was there, which is
|
|
35
|
+
* visible only by running `whoami` afterwards.
|
|
36
|
+
*
|
|
37
|
+
* Point at anything else with WORKOVER_API (https://api.workover.dev for staging,
|
|
38
|
+
* https://api.workover.test for local dev).
|
|
39
|
+
*/
|
|
40
|
+
const API = normalizeApi(process.env.WORKOVER_API || 'https://api.workover.io');
|
|
29
41
|
const CONFIG_DIR = join(homedir(), '.workover');
|
|
30
42
|
const CONFIG_FILE = join(CONFIG_DIR, 'config.json');
|
|
31
43
|
|
|
@@ -156,7 +168,14 @@ async function login() {
|
|
|
156
168
|
const decision = pollDecision(res);
|
|
157
169
|
if (decision === 'complete') {
|
|
158
170
|
saveConfig({ api: API, token: res.access_token });
|
|
159
|
-
|
|
171
|
+
/*
|
|
172
|
+
* NAME THE ENVIRONMENT. There is one token, so signing in REPLACES whichever one was there,
|
|
173
|
+
* and the only way to notice you have swapped environments used to be running `whoami`
|
|
174
|
+
* afterwards. Someone working on production who runs a bare `login` — or who has WORKOVER_API
|
|
175
|
+
* exported from an earlier command — ends up authenticated somewhere else entirely, and the
|
|
176
|
+
* next read fails in a way that looks like missing data rather than the wrong server.
|
|
177
|
+
*/
|
|
178
|
+
console.log(`\n\n \x1b[32m✓\x1b[0m Signed in to ${API}\n`);
|
|
160
179
|
return;
|
|
161
180
|
}
|
|
162
181
|
if (decision === 'denied') {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workover/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Workover command line — sign in and cowork on your documents from the terminal.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "ScaleMath",
|
|
7
|
-
"homepage": "https://workover.
|
|
7
|
+
"homepage": "https://workover.io",
|
|
8
8
|
"bugs": {
|
|
9
|
-
"url": "https://workover.
|
|
9
|
+
"url": "https://workover.io"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
12
|
"workover",
|