Roadmap QL11: Non-interactive taibai init --token flag #7
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
Findings:
init.pycurrently 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 TEXTparameter toinit_command. When provided, skip steps 1–3 and callAPClient.create+verify_credentialsdirectly. Storeclient_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.pywith three tests (valid token, invalid token, overwrite prompt). Implementation insrc/taibai/commands/init.py. Human-facing docs indocs/getting-started.md,README.md,CLAUDE.md.