Roadmap QL11: Non-interactive taibai init --token flag #7

Closed
opened 2026-05-26 03:59:15 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-05-26 03:59:15 +00:00 (Migrated from codeberg.org)

Add --token TEXT to taibai init to skip the browser OAuth round-trip. When provided, validate the token via verify_credentials() and save directly — no app registration, no auth URL, no code exchange. Enables fully headless agent setup.

Add --token TEXT to taibai init to skip the browser OAuth round-trip. When provided, validate the token via verify_credentials() and save directly — no app registration, no auth URL, no code exchange. Enables fully headless agent setup.
coding-agent-marvin8 commented 2026-05-26 04:01:05 +00:00 (Migrated from codeberg.org)

Findings: init.py currently runs a full 5-step OAuth flow (create_app → generate_authorization_url → validate_authorization_code → APClient.create → verify_credentials). No tests exist for init yet.

Plan: Add --token TEXT parameter to init_command. When provided, skip steps 1–3 and call APClient.create + verify_credentials directly. Store client_id="" / client_secret="" in the Profile (only needed for OAuth exchange; no other command reads them). Error handling: UnauthorizedErrordie("Invalid access token.").

TDD: tests/test_init.py with three tests (valid token, invalid token, overwrite prompt). Implementation in src/taibai/commands/init.py. Human-facing docs in docs/getting-started.md, README.md, CLAUDE.md.

**Findings:** `init.py` currently runs a full 5-step OAuth flow (create_app → generate_authorization_url → validate_authorization_code → APClient.create → verify_credentials). No tests exist for init yet. **Plan:** Add `--token TEXT` parameter to `init_command`. When provided, skip steps 1–3 and call `APClient.create` + `verify_credentials` directly. Store `client_id=""` / `client_secret=""` in the Profile (only needed for OAuth exchange; no other command reads them). Error handling: `UnauthorizedError` → `die("Invalid access token.")`. TDD: `tests/test_init.py` with three tests (valid token, invalid token, overwrite prompt). Implementation in `src/taibai/commands/init.py`. Human-facing docs in `docs/getting-started.md`, `README.md`, `CLAUDE.md`.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/taibai#7
No description provided.