@devkitvault/recall 1.0.2 → 1.0.4

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,10 +1,12 @@
1
1
  # @devkitvault/recall
2
2
 
3
- Global **recall** CLI for **Node.js 18+**. Same vault as [recall.devkitvault.com](https://recall.devkitvault.com) and the [VS Code extension](https://marketplace.visualstudio.com/items?itemName=devkitvault.recall-cmd).
3
+ **recall** is a cloud-synced CLI command vault save terminal commands once, search and run them from any machine.
4
+
5
+ Works with [recall.devkitvault.com](https://recall.devkitvault.com) and the [VS Code extension](https://marketplace.visualstudio.com/items?itemName=devkitvault.recall-cmd).
4
6
 
5
7
  ## Requirements
6
8
 
7
- - **Node.js 18+**
9
+ - [Node.js](https://nodejs.org/) **18 or newer**
8
10
 
9
11
  ## Install
10
12
 
@@ -12,30 +14,68 @@ Global **recall** CLI for **Node.js 18+**. Same vault as [recall.devkitvault.com
12
14
  npm install -g @devkitvault/recall
13
15
  ```
14
16
 
15
- ## Use
17
+ Verify the install:
18
+
19
+ ```sh
20
+ recall --version
21
+ recall doctor
22
+ ```
23
+
24
+ ## Quick start
16
25
 
17
26
  ```sh
18
- recall --help
19
27
  recall auth login
20
- recall save "docker compose up -d" -n "start stack"
28
+ recall save "docker compose up -d" --name start-stack --tags docker
21
29
  recall search docker
30
+ recall list
31
+ recall run start-stack
22
32
  ```
23
33
 
24
- ## Native binary (no Node)
34
+ Run `recall --help` for the full command list.
35
+
36
+ ## Authentication
37
+
38
+ After `recall auth login`, your session is stored locally so you stay signed in between runs.
39
+
40
+ ```sh
41
+ recall auth login # sign in (browser or email/password)
42
+ recall auth logout # sign out on this machine
43
+ recall auth whoami # show the signed-in account
44
+ ```
25
45
 
26
- [Install from devkitvault.com](https://devkitvault.com) standalone executable for Windows, macOS, and Linux.
46
+ ## Prefer a standalone binary?
27
47
 
28
- ## Publishing (maintainers)
48
+ If you do not want Node.js, use the native installer instead — same commands, no runtime required:
29
49
 
30
- From the **monorepo root**, with `pnpm` installed:
50
+ - **macOS / Linux:** `curl -fsSL https://devkitvault.com/recall/install.sh | sh`
51
+ - **Windows:** `irm https://devkitvault.com/recall/install.ps1 | iex`
31
52
 
32
- ```powershell
33
- cd packages/npm-cli
34
- npm publish
53
+ See [devkitvault.com/recall](https://devkitvault.com/recall) for downloads and docs.
54
+
55
+ ## Update
56
+
57
+ ```sh
58
+ npm update -g @devkitvault/recall
35
59
  ```
36
60
 
37
- `prepublishOnly` runs **`pnpm --filter @recall/cli run build`** and copies **`packages/cli/dist`** into **`packages/npm-cli/dist`**. Ensure the CLI compiles before publishing.
61
+ ## Troubleshooting
62
+
63
+ ```sh
64
+ recall doctor # check install, auth, and API connectivity
65
+ recall auth whoami # confirm you are signed in
66
+ ```
67
+
68
+ If something still fails, open an issue on [GitHub](https://github.com/devkitvault/recall/issues) or visit [recall.devkitvault.com](https://recall.devkitvault.com).
69
+
70
+ ## Links
71
+
72
+ | | |
73
+ | --- | --- |
74
+ | Website | [devkitvault.com/recall](https://devkitvault.com/recall) |
75
+ | Dashboard | [recall.devkitvault.com](https://recall.devkitvault.com) |
76
+ | VS Code | [Marketplace](https://marketplace.visualstudio.com/items?itemName=devkitvault.recall-cmd) |
77
+ | Issues | [github.com/devkitvault/recall](https://github.com/devkitvault/recall/issues) |
38
78
 
39
79
  ## License
40
80
 
41
- MIT © [devkitvault](https://devkitvault.com)
81
+ MIT — see [LICENSE](./LICENSE). © [devkitvault](https://devkitvault.com)
@@ -83,10 +83,14 @@ async function loginWithBrowser() {
83
83
  const open = (await Promise.resolve().then(() => __importStar(require('open')))).default;
84
84
  const state = crypto.randomBytes(16).toString('hex');
85
85
  const spinner = (0, ora_1.default)('Opening browser...').start();
86
+ const closeHeaders = { Connection: 'close' };
86
87
  const { token, username } = await new Promise((resolve, reject) => {
88
+ let settled = false;
89
+ const timeoutMs = 5 * 60 * 1000;
87
90
  const server = http.createServer((req, res) => {
88
91
  const url = new URL(req.url, 'http://localhost:9876');
89
92
  if (url.pathname !== '/callback') {
93
+ res.writeHead(404, closeHeaders);
90
94
  res.end();
91
95
  return;
92
96
  }
@@ -94,13 +98,23 @@ async function loginWithBrowser() {
94
98
  const returnedToken = url.searchParams.get('token');
95
99
  const returnedUser = url.searchParams.get('username') ?? '';
96
100
  if (returnedState !== state || !returnedToken) {
97
- res.writeHead(400);
101
+ if (!settled) {
102
+ settled = true;
103
+ clearTimeout(timeoutId);
104
+ }
105
+ res.writeHead(400, closeHeaders);
98
106
  res.end('Invalid callback.');
99
- reject(new Error('Invalid state'));
107
+ const srv = server;
108
+ srv.closeAllConnections?.();
109
+ server.close(() => reject(new Error('Invalid state')));
100
110
  return;
101
111
  }
102
- // Return simple response — browser already shows success UI
103
- res.writeHead(200, { 'Content-Type': 'text/html' });
112
+ if (!settled) {
113
+ settled = true;
114
+ clearTimeout(timeoutId);
115
+ }
116
+ // Loopback callback: tell the browser to close the socket so server.close() can finish promptly.
117
+ res.writeHead(200, { 'Content-Type': 'text/html', ...closeHeaders });
104
118
  res.end(`<!DOCTYPE html>
105
119
  <html>
106
120
  <head><meta charset="utf-8"></head>
@@ -109,18 +123,23 @@ async function loginWithBrowser() {
109
123
  <p style="color:#6b7e94;font-family:monospace;">You can close this tab and return to your terminal.</p>
110
124
  </body>
111
125
  </html>`);
112
- server.close();
113
- resolve({ token: returnedToken, username: returnedUser });
126
+ const srv = server;
127
+ srv.closeAllConnections?.();
128
+ server.close(() => resolve({ token: returnedToken, username: returnedUser }));
114
129
  });
130
+ const timeoutId = setTimeout(() => {
131
+ if (settled)
132
+ return;
133
+ settled = true;
134
+ const to = server;
135
+ to.closeAllConnections?.();
136
+ server.close(() => reject(new Error('Timed out after 5 minutes')));
137
+ }, timeoutMs);
115
138
  server.listen(9876, () => {
116
139
  const authUrl = `https://recall.devkitvault.com/cli-login?state=${state}&redirect=http://localhost:9876/callback`;
117
140
  open(authUrl);
118
141
  spinner.text = 'Waiting for browser authentication...';
119
142
  });
120
- setTimeout(() => {
121
- server.close();
122
- reject(new Error('Timed out after 5 minutes'));
123
- }, 5 * 60 * 1000);
124
143
  });
125
144
  await (0, auth_1.setToken)(token);
126
145
  (0, config_1.saveConfig)({ username });
@@ -138,7 +157,7 @@ exports.loginCommand = new commander_1.Command('login')
138
157
  message: 'How would you like to log in?',
139
158
  choices: [
140
159
  { name: 'Login with credentials (username + password)', value: 'credentials' },
141
- { name: 'Login with browser (opens devkitvault.com)', value: 'browser' },
160
+ { name: 'Login with browser (opens recall.devkitvault.com, then localhost)', value: 'browser' },
142
161
  ],
143
162
  },
144
163
  ]);
@@ -11,7 +11,7 @@ const os_1 = __importDefault(require("os"));
11
11
  const path_1 = __importDefault(require("path"));
12
12
  const CONFIG_DIR = path_1.default.join(os_1.default.homedir(), '.recall');
13
13
  const CONFIG_FILE = path_1.default.join(CONFIG_DIR, 'config.json');
14
- exports.APP_VERSION = "1.0.0";
14
+ exports.APP_VERSION = "1.0.1";
15
15
  exports.ENVIRONMENTS = {
16
16
  production: 'https://api.devkitvault.com',
17
17
  local: 'http://127.0.0.1:3001',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devkitvault/recall",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "recall CLI — cloud-synced command vault (JavaScript build for npm; no bundled native binary)",
5
5
  "keywords": [
6
6
  "cli",
@@ -41,7 +41,9 @@
41
41
  "access": "public"
42
42
  },
43
43
  "scripts": {
44
- "prepublishOnly": "node scripts/prepublish.cjs && node --check dist/index.js"
44
+ "prepublishOnly": "node scripts/prepublish.cjs && node --check dist/index.js",
45
+ "check:registry": "npm view @devkitvault/recall version",
46
+ "try:published": "npx --yes --package=@devkitvault/recall@latest recall --version"
45
47
  },
46
48
  "dependencies": {
47
49
  "chalk": "^4.1.2",