tgltrk
Unofficial Toggl Track CLI — a thin wrapper over the Toggl Track API v9 for managing time tracking from the command line.
Installation
GitHub Releases
Download a prebuilt binary for your platform from Releases.
Supported platforms:
- Linux (x86_64)
- macOS (Apple Silicon)
- Windows (x86_64)
Build from source
Requires Rust 1.85.0 or later.
Setup
Set your Toggl Track API token. You can find it in Profile Settings.
# Interactive input (recommended - not saved in shell history)
# Or use an environment variable
Check authentication status:
)
Usage
Timer
# Show current timer
#12345678 Code review 01:23:45 [running]
# Start a timer
#12345679 Code review 00:00:00 [running] [bug, review]
# Stop the timer
#12345679 Code review 00:45:12
Time entries
# List recent entries
#12345677 Weekly meeting 2024-01-15 10:00-11:00 01:00:00 (Internal)
#12345676 Bug fix 2024-01-15 09:00-09:30 00:30:15 (Project A [Acme])
#12345675 Design review 2024-01-14 14:00-16:15 02:15:00 (Project A [Acme]) [design]
# Filter by date range
# Get entry details
#12345677 Weekly meeting 01:00:00
# Create an entry with specific times
#12345678 Morning meeting 01:30:00
# Create with duration instead of stop time
#12345679 Coding session 02:00:00
# Edit an entry
#12345677 Standup meeting 01:00:00
# Edit start/stop time
#12345677 Standup meeting 00:45:00
# Delete an entry
# Continue a previous entry (starts a new timer with the same settings)
#12345680 Bug fix 00:00:00 [running]
Projects
#1001 Website Redesign [Acme Corp]
#1002 Mobile App [Acme Corp]
#1003 API Migration [Globex] (archived)
# Create a project with a client
#1004 New Project
#1004 Renamed Project
Clients
#101 Acme Corp
#102 Globex Inc
#101 Acme Corp
#103 New Client
#103 Renamed Client
Tags
#501 bug
#502 review
#503 design
#504 urgent
Workspaces
#1234 My Workspace
#5678 Team Workspace
#1234 My Workspace
Cache
User info, projects, clients, tags, and workspaces are cached for 72 hours to reduce API calls. Toggl Track API has rate limits, and caching helps stay within those limits during normal usage.
Cache is automatically invalidated when you create, update, or delete projects/tags. Switching accounts via auth login clears all cached data.
Global options
--json Output in JSON format
--workspace Override workspace ID
JSON output includes cache hit metadata:
Credential storage
API tokens are stored in the OS native keyring (macOS Keychain / Windows Credential Manager / Linux Secret Service). If the keyring is unavailable, use the TOGGL_API_TOKEN environment variable instead.
Note: When TOGGL_API_TOKEN is set, it always takes precedence over the keyring. auth login and auth clear still operate on the keyring, but the environment variable will be used for API calls.
Limitations
- No bulk operations: batch edit/delete of multiple entries or projects is not supported
- No reporting: Toggl Track's reporting endpoints (Summary, Detailed, Weekly) are not supported
- No workspace management: workspaces can be listed but not created or modified;
--workspaceselects an existing one - Paid features: features exclusive to paid Toggl Track plans (e.g., tasks, project templates, time estimates, required fields) are not supported
- Rate limits: Toggl Track API enforces rate limits. The CLI caches data for 72 hours to minimize API calls. If you hit rate limits, wait for the reset before retrying
API endpoints not covered
The following Toggl Track API v9 endpoints are available but not implemented in this CLI:
PUT /me— Update user profile (timezone, email, etc.)GET /me/projects,GET /me/clients,GET /me/tags— Cross-workspace listing (single-workspace listing via--workspaceis supported)GET /me/features— Account feature flagsGET /me/location— IP-based locationGET /me/web-timer— Web timer state (usetimer currentinstead)PATCH /workspaces/{wid}/time_entries/{ids}— Bulk update time entriesPATCH /workspaces/{wid}/projects/{ids}— Bulk update projects
License
MIT OR Apache-2.0