Skip to main content

Module auth

Module auth 

Source
Expand description

rpi auth subcommand — persistent credential management. Mirrors the Rust-relevant slice of the TS packages/coding-agent/src/cli/auth-command.ts

  • main.ts:runAuthCommand + core/auth-check.ts.

v1 ships three actions:

  • rpi auth login — legacy API-key prompt (no echo, via rpassword) for the default provider and persist it to ~/.rpi/auth.json. Mirrors the upstream /login TUI’s type:"secret" prompt + modify.
  • rpi auth check — local-only probe of auth.json + the ANTHROPIC_* env vars; reports ready/not_ready (no network call — the upstream --no-refresh equivalent). --json emits a structured result.
  • rpi auth logout — drop the selected provider entry from auth.json (env vars are left untouched).

§Not ported (deferred — see the initial port notes (retired))

Provider-specific OAuth implementations belong in extensions. The host only understands the standard OAuth action response and scoped credential format.

Functions§

run
rpi auth <sub> [args] entry. args is the slice after auth (i.e. the subcommand + its flags). Returns the process exit code. Async to match the app::run shape, though v1 does no async work here.
run_with_extensions
Run auth with an optional extension snapshot. The caller must keep the matching extension session alive until this future completes.