@kendoo.agentdesk/agentdesk 0.17.4 → 0.17.6
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 +10 -0
- package/cli/init.mjs +48 -1
- package/cli/tracker-check.mjs +9 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,16 @@ All user-facing changes to AgentDesk. Each entry is tagged:
|
|
|
8
8
|
|
|
9
9
|
Internal refactors, infrastructure changes, and architectural notes are not listed here.
|
|
10
10
|
|
|
11
|
+
## [0.17.6] — 2026-04-18
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- `[CLI]` Picking "Skip — configure later" on the GitHub auth prompt now actually skips the verification step. Previously it would still run the silent check against whichever gh account was globally logged in, which defeated the point of skipping.
|
|
15
|
+
|
|
16
|
+
## [0.17.5] — 2026-04-18
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- `[CLI]` `agentdesk init` now explicitly asks how you want to authenticate with GitHub instead of silently reusing whichever account the gh CLI was last logged in as. Three choices: use the existing gh CLI auth (showing which account it's currently on), paste a personal access token for a different account, or skip and configure later. When a per-project token is saved, the verify step uses it so gh picks the right identity.
|
|
20
|
+
|
|
11
21
|
## [0.17.4] — 2026-04-18
|
|
12
22
|
|
|
13
23
|
### Fixed
|
package/cli/init.mjs
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
10
10
|
import { join } from "path";
|
|
11
11
|
import { createInterface } from "readline";
|
|
12
|
+
import { execSync } from "child_process";
|
|
12
13
|
import { detectProject } from "./detect.mjs";
|
|
13
14
|
import { loadConfig, pushConfig } from "./config.mjs";
|
|
14
15
|
import { getStoredApiKey } from "./login.mjs";
|
|
@@ -256,16 +257,62 @@ export async function runInit(cwd, opts = {}) {
|
|
|
256
257
|
console.log("");
|
|
257
258
|
}
|
|
258
259
|
|
|
260
|
+
let skipGithubVerify = false;
|
|
259
261
|
if (tracker === "github") {
|
|
260
262
|
const current = existingConfig.github?.repo || "";
|
|
261
263
|
const answer = await ask(rl, ` GitHub repo${current ? ` (${current})` : ""} (owner/repo): `);
|
|
262
264
|
const r = answer.trim() || current;
|
|
263
265
|
if (r) config.github = { repo: r };
|
|
264
266
|
console.log("");
|
|
267
|
+
|
|
268
|
+
// Ask which identity to use for this project, regardless of whether
|
|
269
|
+
// `gh auth` is already set up globally. Without this prompt the wizard
|
|
270
|
+
// silently reuses whichever account the user last ran `gh auth login`
|
|
271
|
+
// with, which is surprising on a machine with multiple GitHub identities.
|
|
272
|
+
let ghLogin = null;
|
|
273
|
+
try {
|
|
274
|
+
const out = execSync("gh api user --jq .login", { stdio: ["ignore", "pipe", "ignore"], encoding: "utf-8" }).trim();
|
|
275
|
+
if (out) ghLogin = out;
|
|
276
|
+
} catch {}
|
|
277
|
+
const ghOptionLabel = ghLogin
|
|
278
|
+
? `Use gh CLI — currently authenticated as @${ghLogin}`
|
|
279
|
+
: `Use gh CLI — you'll run 'gh auth login' after this wizard`;
|
|
280
|
+
const authChoice = await selectOption(rl, "GitHub authentication for this project:", [
|
|
281
|
+
{ label: ghOptionLabel, value: "gh" },
|
|
282
|
+
{ label: "Paste a personal access token (use a different account)", value: "pat" },
|
|
283
|
+
{ label: "Skip — configure later in the dashboard", value: "skip" },
|
|
284
|
+
]);
|
|
285
|
+
console.log("");
|
|
286
|
+
|
|
287
|
+
if (authChoice.value === "skip") {
|
|
288
|
+
skipGithubVerify = true;
|
|
289
|
+
console.log(" Skipping verification. Configure GitHub auth later via the dashboard or re-run `agentdesk init`.");
|
|
290
|
+
console.log("");
|
|
291
|
+
} else if (authChoice.value === "pat") {
|
|
292
|
+
if (!quick) {
|
|
293
|
+
console.log(" Create a token:");
|
|
294
|
+
console.log(" 1. Open https://github.com/settings/tokens");
|
|
295
|
+
console.log(" 2. Click \"Generate new token (classic)\"");
|
|
296
|
+
console.log(" 3. Name: AgentDesk. Scope: repo. Click Generate.");
|
|
297
|
+
console.log(" 4. Copy the token and paste below.");
|
|
298
|
+
console.log("");
|
|
299
|
+
}
|
|
300
|
+
while (true) {
|
|
301
|
+
const tokenInput = (await ask(rl, " GitHub token: ")).trim();
|
|
302
|
+
if (!tokenInput) {
|
|
303
|
+
console.log(" Token is required. Press Ctrl+C to abort.");
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
saveEnvVar(cwd, "GITHUB_TOKEN", tokenInput);
|
|
307
|
+
console.log(" ✓ Saved to .env (as GITHUB_TOKEN). This overrides any global gh CLI auth for this project.");
|
|
308
|
+
console.log("");
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
265
312
|
}
|
|
266
313
|
|
|
267
314
|
// --- Step 3: Verify tracker permissions (with re-prompt on failure) ---
|
|
268
|
-
if (tracker) {
|
|
315
|
+
if (tracker && !skipGithubVerify) {
|
|
269
316
|
let verified = false;
|
|
270
317
|
while (!verified) {
|
|
271
318
|
console.log(" Checking tracker permissions...");
|
package/cli/tracker-check.mjs
CHANGED
|
@@ -158,6 +158,11 @@ async function checkGitHub({ repo }, creds) {
|
|
|
158
158
|
const errors = [];
|
|
159
159
|
let identity = null;
|
|
160
160
|
|
|
161
|
+
// If a per-project GITHUB_TOKEN is configured, let gh use it via env —
|
|
162
|
+
// takes precedence over whichever account `gh auth` is logged into.
|
|
163
|
+
const env = { ...process.env };
|
|
164
|
+
if (creds?.GITHUB_TOKEN) env.GH_TOKEN = creds.GITHUB_TOKEN;
|
|
165
|
+
|
|
161
166
|
// Check if gh CLI is available
|
|
162
167
|
try {
|
|
163
168
|
execSync("gh --version", { stdio: "pipe" });
|
|
@@ -167,19 +172,19 @@ async function checkGitHub({ repo }, creds) {
|
|
|
167
172
|
|
|
168
173
|
// Check auth status and grab the authenticated login
|
|
169
174
|
try {
|
|
170
|
-
execSync("gh auth status", { stdio: "pipe" });
|
|
175
|
+
execSync("gh auth status", { stdio: "pipe", env });
|
|
171
176
|
try {
|
|
172
|
-
const who = execSync(`gh api user --jq '{login: .login, name: .name}'`, { stdio: "pipe", encoding: "utf-8" }).trim();
|
|
177
|
+
const who = execSync(`gh api user --jq '{login: .login, name: .name}'`, { stdio: "pipe", encoding: "utf-8", env }).trim();
|
|
173
178
|
const j = JSON.parse(who);
|
|
174
179
|
identity = { name: j.name || j.login, login: j.login };
|
|
175
180
|
} catch {}
|
|
176
181
|
} catch {
|
|
177
|
-
return { ok: false, errors: ["GitHub CLI is not authenticated — run 'gh auth login'"] };
|
|
182
|
+
return { ok: false, errors: ["GitHub CLI is not authenticated — run 'gh auth login', or paste a GITHUB_TOKEN"] };
|
|
178
183
|
}
|
|
179
184
|
|
|
180
185
|
// Check repo access and permissions
|
|
181
186
|
try {
|
|
182
|
-
const result = execSync(`gh api repos/${repo} --jq ".permissions"`, { stdio: "pipe", encoding: "utf-8" });
|
|
187
|
+
const result = execSync(`gh api repos/${repo} --jq ".permissions"`, { stdio: "pipe", encoding: "utf-8", env });
|
|
183
188
|
const perms = JSON.parse(result.trim());
|
|
184
189
|
|
|
185
190
|
if (!perms.pull) {
|