How alstes/todomate-cli works
TodoMate CLI is a native terminal client for managing todos, goals, and vision through TodoMate’s API. The principal path is command parsing and dispatch, domain-specific command handling, authenticated API requests, then human-readable or JSON output. Authentication obtains a GitHub token, exchanges it with the API using a user-provided API key, and stores credentials; configuration is handled locally. The README also describes the broader Vision → Goals → Todos product hierarchy and private GitHub-repository data ownership, but those backend storage details are outside this CLI’s sampled implementation. Device flow is documented as not yet implemented.
Main entry points: api/mod.rs API client · main.rs Runtime dispatcher · auth/mod.rs Authentication flow · output.rs Text and JSON output
Components 17
CLI entry and configuration
- Command parser
src/cli.rs - Runtime dispatcher
src/main.rs - Local configuration
src/config.rs
TodoMate domain commands
- Todo commands
src/commands/todos.rs - Goal commands
src/commands/goals.rs - Vision commands
src/commands/vision.rs
API and authentication
- API client
src/api/mod.rs - API data models
src/api/models.rs - Authentication flow
src/auth/mod.rs - GitHub token lookup
src/auth/gh_token.rs - Device flow stub
src/auth/device_flow.rs
Output and local credentials
- Text and JSON output
src/output.rs - Credential storage
src/auth/token_store.rs
Other components
- Terminal user
- GitHub CLI
- TodoMate API
- OS keychain or file
Connections 22
- Terminal user → Command parser: enters commands
README.md - Command parser → Runtime dispatcher: parsed arguments
src/main.rs - Runtime dispatcher → Local configuration: loads or updates
src/main.rs - Runtime dispatcher → Authentication flow: routes auth
src/main.rs - Runtime dispatcher → Todo commands: routes todos
src/main.rs - Runtime dispatcher → Goal commands: routes goals
src/main.rs - Runtime dispatcher → Vision commands: routes vision
src/main.rs - Authentication flow → GitHub token lookup: gets token
src/auth/mod.rs - GitHub token lookup → GitHub CLI: reads token
src/auth/gh_token.rs - Authentication flow → API client: exchanges credentials
src/auth/mod.rs - Authentication flow → Credential storage: saves or checks
src/auth/mod.rs - Credential storage → OS keychain or file: persists credentials
src/auth/token_store.rs - API client → Credential storage: loads refresh credentials
src/api/mod.rs - Todo commands → API client: requests todo operations
src/commands/todos.rs - Goal commands → API client: requests goal operations
src/commands/goals.rs - Vision commands → API client: requests vision operations
src/commands/vision.rs - API client → TodoMate API: sends HTTP requests
src/api/mod.rs - API client → API data models: serializes and parses
src/api/mod.rs - Todo commands → Text and JSON output: formats results
src/commands/todos.rs - Goal commands → Text and JSON output: formats results
src/commands/goals.rs - Vision commands → Text and JSON output: formats results
src/commands/vision.rs - Text and JSON output → API data models: renders domain values
src/output.rs