codeam-cli 2.4.2 → 2.4.3

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/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to `codeam-cli` are documented here.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [2.4.1] — 2026-05-03
8
+
9
+ ### Added
10
+
11
+ - **cli:** Interactive `claude login` fallback when no local config (v2.4.1)
12
+
13
+ ## [2.4.0] — 2026-05-03
14
+
15
+ ### Added
16
+
17
+ - **cli:** `codeam deploy` — provision a paired cloud workspace in one command (v2.4.0)
18
+
7
19
  ## [2.2.2] — 2026-05-02
8
20
 
9
21
  ### Fixed
package/dist/index.js CHANGED
@@ -179,7 +179,7 @@ var import_qrcode_terminal = __toESM(require("qrcode-terminal"));
179
179
  // package.json
180
180
  var package_default = {
181
181
  name: "codeam-cli",
182
- version: "2.4.2",
182
+ version: "2.4.3",
183
183
  description: "Remote control Claude Code (and other AI coding agents) from your mobile phone. Pair your device, send prompts, stream responses in real-time, and approve commands \u2014 from anywhere.",
184
184
  main: "dist/index.js",
185
185
  bin: {
@@ -5113,21 +5113,70 @@ var GitHubCodespacesProvider = class {
5113
5113
  );
5114
5114
  }
5115
5115
  }
5116
+ let isAuthed = false;
5116
5117
  try {
5117
5118
  await execFileP2("gh", ["auth", "status"], { maxBuffer: MAX_BUFFER });
5118
- return;
5119
+ isAuthed = true;
5119
5120
  } catch {
5120
5121
  }
5121
- await new Promise((resolve2, reject) => {
5122
- const proc = (0, import_child_process5.spawn)("gh", ["auth", "login", "-s", "codespace,repo,read:user"], {
5123
- stdio: "inherit"
5122
+ if (!isAuthed) {
5123
+ await new Promise((resolve2, reject) => {
5124
+ const proc = (0, import_child_process5.spawn)("gh", ["auth", "login", "-s", "codespace,repo,read:user"], {
5125
+ stdio: "inherit"
5126
+ });
5127
+ proc.on("exit", (code) => {
5128
+ if (code === 0) resolve2();
5129
+ else reject(new Error("gh auth login failed."));
5130
+ });
5131
+ proc.on("error", reject);
5124
5132
  });
5125
- proc.on("exit", (code) => {
5126
- if (code === 0) resolve2();
5127
- else reject(new Error("gh auth login failed."));
5133
+ return;
5134
+ }
5135
+ const hasScope = await this.hasCodespaceScope();
5136
+ if (!hasScope) {
5137
+ wt(
5138
+ [
5139
+ "Your existing GitHub login is missing the `codespace` scope.",
5140
+ "I'll run `gh auth refresh` to add it \u2014 your browser will open",
5141
+ "for a one-tap approval."
5142
+ ].join("\n"),
5143
+ "One more permission needed"
5144
+ );
5145
+ await new Promise((resolve2, reject) => {
5146
+ const proc = (0, import_child_process5.spawn)(
5147
+ "gh",
5148
+ ["auth", "refresh", "-h", "github.com", "-s", "codespace"],
5149
+ { stdio: "inherit" }
5150
+ );
5151
+ proc.on("exit", (code) => {
5152
+ if (code === 0) resolve2();
5153
+ else reject(new Error("gh auth refresh failed \u2014 re-run `gh auth refresh -h github.com -s codespace` manually."));
5154
+ });
5155
+ proc.on("error", reject);
5128
5156
  });
5129
- proc.on("error", reject);
5130
- });
5157
+ }
5158
+ }
5159
+ /**
5160
+ * Check whether the current `gh` token includes the `codespace`
5161
+ * OAuth scope. We hit `/user` with `-i` so GitHub echoes the granted
5162
+ * scopes back in the `X-OAuth-Scopes` response header — the most
5163
+ * authoritative source (more reliable than scraping `gh auth status`,
5164
+ * whose format has shifted across `gh` versions).
5165
+ */
5166
+ async hasCodespaceScope() {
5167
+ try {
5168
+ const { stdout } = await execFileP2(
5169
+ "gh",
5170
+ ["api", "-i", "user"],
5171
+ { maxBuffer: MAX_BUFFER }
5172
+ );
5173
+ const m = stdout.match(/^x-oauth-scopes:\s*(.+)$/im);
5174
+ if (!m) return false;
5175
+ const scopes = m[1].split(",").map((s) => s.trim().toLowerCase());
5176
+ return scopes.includes("codespace");
5177
+ } catch {
5178
+ return false;
5179
+ }
5131
5180
  }
5132
5181
  /**
5133
5182
  * Try to install the `gh` CLI for the user. Opt-in via a confirm
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "Remote control Claude Code (and other AI coding agents) from your mobile phone. Pair your device, send prompts, stream responses in real-time, and approve commands — from anywhere.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {