mosaic gateway login - Thin wrapper with gateway URL defaulting from meta.json, falling back to localhost:14242. Email and password prompted if not supplied as flags.
mosaic gateway config rotate-token - Requires a stored valid BetterAuth session. Calls POST /api/admin/tokens with the session cookie and writes the returned plaintext to meta.json.
mosaic gateway config recover-token - Stranded-operator entry point. If no valid session exists, prompts for email and password inline, signs in, saves the session, then mints and persists a new admin token.
Installer fix - bootstrapFirstUser in install.ts now offers inline token recovery when admin user exists but no token is on file. In TTY mode it prompts; non-interactive prints the recover-token hint.
All gates green: 100 tests pass, typecheck clean, lint clean, format clean.
Mission: cli-unification-20260404. Tasks: CU-03-03, CU-03-04, CU-03-05, CU-03-06, CU-03-07. Design doc: PR 401.
Commands added:
mosaic gateway login - Thin wrapper with gateway URL defaulting from meta.json, falling back to localhost:14242. Email and password prompted if not supplied as flags.
mosaic gateway config rotate-token - Requires a stored valid BetterAuth session. Calls POST /api/admin/tokens with the session cookie and writes the returned plaintext to meta.json.
mosaic gateway config recover-token - Stranded-operator entry point. If no valid session exists, prompts for email and password inline, signs in, saves the session, then mints and persists a new admin token.
Installer fix - bootstrapFirstUser in install.ts now offers inline token recovery when admin user exists but no token is on file. In TTY mode it prompts; non-interactive prints the recover-token hint.
New files: login.ts, token-ops.ts, login.spec.ts (5 tests), rotate-token.spec.ts (10 tests), recover-token.spec.ts (7 tests).
All gates green: 100 tests pass, typecheck clean, lint clean, format clean.
Add mosaic gateway login subcommand with meta.json URL default, config
rotate-token and recover-token subcommands for admin token minting via
BetterAuth session cookie, fix the bootstrapFirstUser dead-end when admin
exists but no token is on file, and add Vitest tests for all new flows.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Mission: cli-unification-20260404. Tasks: CU-03-03, CU-03-04, CU-03-05, CU-03-06, CU-03-07. Design doc: PR 401.
Commands added:
mosaic gateway login - Thin wrapper with gateway URL defaulting from meta.json, falling back to localhost:14242. Email and password prompted if not supplied as flags.
mosaic gateway config rotate-token - Requires a stored valid BetterAuth session. Calls POST /api/admin/tokens with the session cookie and writes the returned plaintext to meta.json.
mosaic gateway config recover-token - Stranded-operator entry point. If no valid session exists, prompts for email and password inline, signs in, saves the session, then mints and persists a new admin token.
Installer fix - bootstrapFirstUser in install.ts now offers inline token recovery when admin user exists but no token is on file. In TTY mode it prompts; non-interactive prints the recover-token hint.
New files: login.ts, token-ops.ts, login.spec.ts (5 tests), rotate-token.spec.ts (10 tests), recover-token.spec.ts (7 tests).
All gates green: 100 tests pass, typecheck clean, lint clean, format clean.