Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6520e73
fix(login): report an existing session instead of re-prompting
kojiwakayama Aug 15, 2026
4d71f81
Keep bare login aligned with stored sessions
kojiwakayama Aug 15, 2026
53f2c7c
fix(login): say when an existing session came from the environment
kwakayama Aug 15, 2026
f635412
fix(login): bound the existing-session preflight with a deadline
kojiwakayama Aug 15, 2026
bbc148f
Bound login preflight to one credential deadline
kojiwakayama Aug 15, 2026
cf5c736
Keep login output on one declared contract
kojiwakayama Aug 15, 2026
4637eb3
Keep environment-backed account switching truthful
kojiwakayama Aug 15, 2026
e1474e2
Keep environment login precedence truthful
kojiwakayama Aug 15, 2026
56e7723
Describe environment precedence without erasing stored state
kojiwakayama Aug 15, 2026
8d5f92d
Keep credential precedence explicit in login guidance
kojiwakayama Aug 15, 2026
80f9ec6
Keep unverified credentials out of login claims
kojiwakayama Aug 15, 2026
dc149ce
Honor login JSON output for valid existing sessions
kojiwakayama Aug 15, 2026
4fec6c9
Keep JSON login failures machine-readable
kojiwakayama Aug 15, 2026
3444f67
Preserve login preflight network failures
kojiwakayama Aug 15, 2026
cf3e1c9
Preserve login JSON validation failure causes
kojiwakayama Aug 15, 2026
33770c9
Preserve login JSON validation failure classes
kojiwakayama Aug 15, 2026
d96d0e5
Preserve environment login validation priority
kojiwakayama Aug 15, 2026
32bdbf6
Preserve malformed environment login failures
kojiwakayama Aug 15, 2026
8cc8b84
Keep JSON login validation outcomes precise
kojiwakayama Aug 15, 2026
5ea395b
Keep explicit JSON login failures routable
kojiwakayama Aug 15, 2026
dbf7b7d
Keep shell token precedence visible in login
kojiwakayama Aug 15, 2026
e863559
Honor dotenv token precedence in login
kojiwakayama Aug 15, 2026
d9edc39
Keep stored-token precedence over dotenv login
kojiwakayama Aug 15, 2026
0b653d5
Keep login precedence mergeable with main
kojiwakayama Aug 15, 2026
590ee3b
Honor config-file token precedence in login
kojiwakayama Aug 15, 2026
0d5b04e
Honor config API metadata during login preflight
kojiwakayama Aug 15, 2026
854cc5f
Respect configured API URL for login preflight
kojiwakayama Aug 15, 2026
de23a1e
Keep login preflight bounded to JSON config
kojiwakayama Aug 15, 2026
99c1df5
Clarify config-token account switching
kojiwakayama Aug 15, 2026
84a2297
Stop login under rejected authoritative tokens
kojiwakayama Aug 15, 2026
4cf0e39
Stop replacement login after authoritative validation outages
kojiwakayama Aug 15, 2026
bddb5e9
Propagate unexpected strict credential failures
kojiwakayama Aug 15, 2026
b5f2b63
Align auth consumers with config-file credentials
kojiwakayama Aug 15, 2026
eabcfff
Clarify login JSON-mode method limits
kojiwakayama Aug 15, 2026
b402e05
Keep CLI authentication scoped to the command target
kojiwakayama Aug 15, 2026
9f00d33
Preserve dotenv fallback after stored session expiry
kojiwakayama Aug 15, 2026
65a38c2
Let init deploy with its validated project credential
kojiwakayama Aug 15, 2026
9559ebf
Keep authentication fallbacks usable by target commands
kojiwakayama Aug 15, 2026
029df04
Preserve stored sessions through validation outages
kojiwakayama Aug 16, 2026
840251c
Keep unavailable stored credentials authoritative
kojiwakayama Aug 16, 2026
65d5390
Prevent login help from promising ineffective account switches
kojiwakayama Aug 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 39 additions & 4 deletions cli/auth/exit-code.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,45 @@ describe("cli/auth exit codes", () => {
assertEquals(result.code, 1);
});

// `login --provider anthropic|openai` also exits 1 on failure (see cli/router.ts),
// but it cannot be driven from here: `promptPassword` calls `Deno.stdin.setRaw()`,
// which throws ENODEV on a non-TTY stdin. A subprocess test would exit 1 from that
// crash rather than from the failure path, and would pass with the fix reverted.
it("login --json --token exits as a structured usage error", async () => {
const result = await runUnauthenticated(["login", "--json", "--token"]);

assertEquals(result.code, 2);
assertEquals(JSON.parse(result.stdout), {
success: false,
command: "login",
error: {
code: "USAGE_ERROR",
slug: "invalid-arguments",
registrySlug: "invalid-argument",
message: "Explicit login methods are not supported with --json.",
},
});
assertEquals(result.stderr, "");
});

it("login --json --provider exits as a structured usage error without prompting", async () => {
const result = await runUnauthenticated([
"login",
"--json",
"--provider",
"anthropic",
]);

assertEquals(result.code, 2);
assertEquals(JSON.parse(result.stdout), {
success: false,
command: "login",
error: {
code: "USAGE_ERROR",
slug: "invalid-arguments",
registrySlug: "invalid-argument",
message: "Explicit login methods are not supported with --json.",
},
});
assertEquals(result.stdout.includes("API key"), false);
assertEquals(result.stderr, "");
});

it("whoami still exits zero when a credential validates", async () => {
const server = Deno.serve(
Expand Down
Loading