How blachniet/tgl works
Project type and purpose
• This is a Rust-based command-line application (“tgl-cli”) that interfaces with the Toggl time-tracking API.
• Its primary function is to let end users execute Toggl operations (e.g., start/stop timers, list projects) directly from the terminal.
File structure
• Top level:
• Cargo.toml, Cargo.lock, src/, examples/
• .github/workflows/ci.yml for CI on GitHub Actions
• src/:
• main.rs → CLI entry point, reads config (API token), invokes library APIs
• lib.rs → crate root, re-exports modules
• api.rs → defines HTTP client logic for interacting with Toggl REST API
• svc.rs → high-level service layer that coordinates use cases (e.g., start/stop) by calling api.rs and handling business logic
• examples/:
• api.rs and svc.rs showing how to use the library in other Rust code
README for additional insights
• Dependencies: uses the system keyring for token storage or environment variable TOGGL_API_TOKEN
• Usage flow described: first-run token prompt → store in keyring → subsequent runs skip prompt
• Irreversible actions: token persistence in OS keyring