nubase_cli 0.1.3 → 0.1.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
@@ -5,7 +5,7 @@ stdio MCP bridge for Nubase. Use it when Codex, Claude Code, Cursor, IDEA, or an
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- npx nubase_cli
8
+ npx -y nubase_cli@latest
9
9
  ```
10
10
 
11
11
  ## Browser Authorization
@@ -13,7 +13,7 @@ npx nubase_cli
13
13
  Installing skills starts a one-time browser authorization session and prints an authorization URL:
14
14
 
15
15
  ```bash
16
- npx -y nubase_cli install-skills
16
+ npx -y nubase_cli@latest install-skills
17
17
  ```
18
18
 
19
19
  Open the printed URL, sign in to Studio, choose a project, and approve. The URL includes a per-session UUID and points back to the temporary localhost callback started by the install command. After approval, the CLI writes `~/.nubase/config.json` and closes the localhost callback server.
@@ -21,13 +21,13 @@ Open the printed URL, sign in to Studio, choose a project, and approve. The URL
21
21
  For automation, skip the prompt:
22
22
 
23
23
  ```bash
24
- npx -y nubase_cli install-skills --no-authorize
24
+ npx -y nubase_cli@latest install-skills --no-authorize
25
25
  ```
26
26
 
27
27
  You can also start a standalone authorization session:
28
28
 
29
29
  ```bash
30
- npx -y nubase_cli authorize
30
+ npx -y nubase_cli@latest authorize
31
31
  ```
32
32
 
33
33
  Future `nubase_cli` runs read this file when `NUBASE_PROJECT_KEY` is not set.
@@ -35,7 +35,7 @@ Future `nubase_cli` runs read this file when `NUBASE_PROJECT_KEY` is not set.
35
35
  Options:
36
36
 
37
37
  ```bash
38
- npx nubase_cli authorize \
38
+ npx -y nubase_cli@latest authorize \
39
39
  --studio-url http://localhost:3000 \
40
40
  --nubase-url http://localhost:9999 \
41
41
  --agent-id codex
@@ -56,7 +56,7 @@ node packages/mcp-bridge/dist/src/index.js
56
56
  "mcpServers": {
57
57
  "nubase": {
58
58
  "command": "npx",
59
- "args": ["nubase_cli"],
59
+ "args": ["-y", "nubase_cli@latest"],
60
60
  "env": {
61
61
  "NUBASE_AGENT_ID": "claude-code"
62
62
  }
@@ -72,7 +72,7 @@ You may still set `NUBASE_URL` and `NUBASE_PROJECT_KEY` explicitly. Environment
72
72
  Install the bundled Nubase skills into a repository:
73
73
 
74
74
  ```bash
75
- npx -y nubase_cli install-skills
75
+ npx -y nubase_cli@latest install-skills
76
76
  ```
77
77
 
78
78
  Targets:
@@ -77,6 +77,10 @@ async function startAuthorization(options) {
77
77
  return;
78
78
  }
79
79
  try {
80
+ if (req.method === 'OPTIONS' && req.url === '/callback') {
81
+ sendCorsNoContent(res);
82
+ return;
83
+ }
80
84
  if (req.method === 'GET' && req.url?.startsWith('/callback')) {
81
85
  const url = new URL(req.url, origin);
82
86
  if (url.searchParams.get('state') !== state) {
@@ -158,12 +162,24 @@ async function readJson(req) {
158
162
  function sendJson(res, status, body) {
159
163
  res.writeHead(status, {
160
164
  'Content-Type': 'application/json',
161
- 'Access-Control-Allow-Origin': '*',
165
+ ...corsHeaders(),
162
166
  });
163
167
  res.end(JSON.stringify(body));
164
168
  }
169
+ function sendCorsNoContent(res) {
170
+ res.writeHead(204, corsHeaders());
171
+ res.end();
172
+ }
173
+ function corsHeaders() {
174
+ return {
175
+ 'Access-Control-Allow-Origin': '*',
176
+ 'Access-Control-Allow-Methods': 'GET,POST,OPTIONS',
177
+ 'Access-Control-Allow-Headers': 'Content-Type',
178
+ 'Access-Control-Max-Age': '600',
179
+ };
180
+ }
165
181
  function sendHtml(res, status, title, message) {
166
- res.writeHead(status, { 'Content-Type': 'text/html; charset=utf-8' });
182
+ res.writeHead(status, { 'Content-Type': 'text/html; charset=utf-8', ...corsHeaders() });
167
183
  res.end(`<!doctype html><meta charset="utf-8"><title>${escapeHtml(title)}</title><body style="font-family: system-ui, sans-serif; padding: 32px;"><h1>${escapeHtml(title)}</h1><p>${escapeHtml(message)}</p></body>`);
168
184
  }
169
185
  function openBrowser(url) {
package/dist/src/index.js CHANGED
@@ -6,7 +6,7 @@ import { installSkills, parseInstallArgs } from './install-skills.js';
6
6
  import { McpStdioServer } from './mcp-stdio.js';
7
7
  import { NubaseClient } from './nubase-client.js';
8
8
  import { callTool, TOOLS } from './tools.js';
9
- const CLI_VERSION = '0.1.3';
9
+ const CLI_VERSION = '0.1.4';
10
10
  if (process.argv[2] === 'install-skills') {
11
11
  const options = parseInstallArgs(process.argv.slice(3));
12
12
  const installed = await installSkills(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nubase_cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {