Expand description
Startup types and helpers for Tuitbot CLI commands.
Provides API tier detection types, OAuth token management,
PKCE authentication helpers, startup banner formatting, and
diagnostic check types used by the run, auth, and test
CLI commands.
Structs§
- Pkce
Challenge - PKCE code verifier and challenge pair.
- Stored
Tokens - OAuth tokens persisted to disk at
~/.tuitbot/tokens.json. - Tier
Capabilities - Capabilities enabled by the current API tier.
Enums§
- ApiTier
- Detected X API tier.
- Startup
Error - Errors that can occur during startup operations.
Constants§
- X_
AUTH_ URL - X API OAuth 2.0 authorization endpoint.
- X_
TOKEN_ URL - X API OAuth 2.0 token endpoint.
- X_
USERS_ ME_ URL - X API users/me endpoint for credential verification.
Functions§
- build_
auth_ url - Build the X API OAuth 2.0 authorization URL.
- build_
redirect_ uri - Build the redirect URI from config auth settings.
- data_
dir - Default directory for Tuitbot data files (
~/.tuitbot/). - exchange_
auth_ code - Exchange an authorization code for OAuth tokens.
- expand_
tilde - Expand
~at the start of a path to the user’s home directory. - extract_
auth_ code - Extract the authorization code from a callback URL or raw code string.
- format_
startup_ banner - Format the startup banner printed when the agent starts.
- generate_
pkce - Generate a PKCE code verifier, challenge, and state parameter.
- load_
tokens_ from_ file - Load OAuth tokens from the default file path.
- save_
tokens_ to_ file - Save OAuth tokens to the default file path with secure permissions.
- token_
file_ path - Path to the token storage file (
~/.tuitbot/tokens.json). - verify_
credentials - Verify OAuth credentials by calling the X API /2/users/me endpoint.