KosmoKrator

productivity

Toggl CLI for AI Agents

Use the Toggl CLI from KosmoKrator to call Toggl tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 6 read 1 write API token auth

Toggl CLI Setup

Toggl can be configured headlessly with `kosmokrator integrations:configure toggl`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure toggl --set api_token="$TOGGL_API_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor toggl --json
kosmokrator integrations:status --json

Credentials

Authentication type: API token api_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
api_token TOGGL_API_TOKEN Secret secret yes API Token

Call Toggl Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call toggl.toggl_create_time_entry '{
  "workspace_id": "example_workspace_id",
  "description": "example_description",
  "start": "example_start",
  "stop": "example_stop",
  "duration": 1,
  "project_id": "example_project_id",
  "tags": "example_tags"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:toggl toggl_create_time_entry '{
  "workspace_id": "example_workspace_id",
  "description": "example_description",
  "start": "example_start",
  "stop": "example_stop",
  "duration": 1,
  "project_id": "example_project_id",
  "tags": "example_tags"
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs toggl --json
kosmo integrations:docs toggl.toggl_create_time_entry --json
kosmo integrations:schema toggl.toggl_create_time_entry --json
kosmo integrations:search "Toggl" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Toggl.

toggl.toggl_create_time_entry

Write write

Create a new time entry in a Toggl workspace. Provide a description, start time, and optionally a project and stop time.

Parameters
workspace_id, description, start, stop, duration, project_id, tags

Generic CLI call

kosmo integrations:call toggl.toggl_create_time_entry '{"workspace_id":"example_workspace_id","description":"example_description","start":"example_start","stop":"example_stop","duration":1,"project_id":"example_project_id","tags":"example_tags"}' --json

Provider shortcut

kosmo integrations:toggl toggl_create_time_entry '{"workspace_id":"example_workspace_id","description":"example_description","start":"example_start","stop":"example_stop","duration":1,"project_id":"example_project_id","tags":"example_tags"}' --json

toggl.toggl_get_current_user

Read read

Get the authenticated Toggl user profile. Use this to verify your API token is working.

Parameters
none

Generic CLI call

kosmo integrations:call toggl.toggl_get_current_user '{}' --json

Provider shortcut

kosmo integrations:toggl toggl_get_current_user '{}' --json

toggl.toggl_get_project

Read read

Get details for a single Toggl project by ID.

Parameters
workspace_id, project_id

Generic CLI call

kosmo integrations:call toggl.toggl_get_project '{"workspace_id":"example_workspace_id","project_id":"example_project_id"}' --json

Provider shortcut

kosmo integrations:toggl toggl_get_project '{"workspace_id":"example_workspace_id","project_id":"example_project_id"}' --json

toggl.toggl_get_time_entry

Read read

Get details for a single Toggl time entry by ID.

Parameters
time_entry_id

Generic CLI call

kosmo integrations:call toggl.toggl_get_time_entry '{"time_entry_id":"example_time_entry_id"}' --json

Provider shortcut

kosmo integrations:toggl toggl_get_time_entry '{"time_entry_id":"example_time_entry_id"}' --json

toggl.toggl_list_projects

Read read

List projects in a Toggl workspace. Optionally filter for active projects only.

Parameters
workspace_id, active

Generic CLI call

kosmo integrations:call toggl.toggl_list_projects '{"workspace_id":"example_workspace_id","active":true}' --json

Provider shortcut

kosmo integrations:toggl toggl_list_projects '{"workspace_id":"example_workspace_id","active":true}' --json

toggl.toggl_list_time_entries

Read read

List recent Toggl time entries. Optionally filter by date range.

Parameters
start_date, end_date

Generic CLI call

kosmo integrations:call toggl.toggl_list_time_entries '{"start_date":"example_start_date","end_date":"example_end_date"}' --json

Provider shortcut

kosmo integrations:toggl toggl_list_time_entries '{"start_date":"example_start_date","end_date":"example_end_date"}' --json

toggl.toggl_list_workspaces

Read read

List all Toggl workspaces the authenticated user belongs to. Returns workspace IDs and names needed for other Toggl tools.

Parameters
none

Generic CLI call

kosmo integrations:call toggl.toggl_list_workspaces '{}' --json

Provider shortcut

kosmo integrations:toggl toggl_list_workspaces '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

toggl.toggl_create_time_entry

Create a new time entry in a Toggl workspace. Provide a description, start time, and optionally a project and stop time.

Operation
Write write
Schema command
kosmo integrations:schema toggl.toggl_create_time_entry --json
ParameterTypeRequiredDescription
workspace_id string yes The workspace ID.
description string no Description of the time entry.
start string no Start time (ISO 8601, e.g. "2026-04-05T09:00:00Z"). Defaults to now.
stop string no Stop time (ISO 8601). Omit for a running timer.
duration integer no Duration in seconds. Use -1 for a running timer (default: -1).
project_id string no Project ID to assign the time entry to.
tags array no Tags for the time entry.

toggl.toggl_get_current_user

Get the authenticated Toggl user profile. Use this to verify your API token is working.

Operation
Read read
Schema command
kosmo integrations:schema toggl.toggl_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

toggl.toggl_get_project

Get details for a single Toggl project by ID.

Operation
Read read
Schema command
kosmo integrations:schema toggl.toggl_get_project --json
ParameterTypeRequiredDescription
workspace_id string yes The workspace ID.
project_id string yes The project ID.

toggl.toggl_get_time_entry

Get details for a single Toggl time entry by ID.

Operation
Read read
Schema command
kosmo integrations:schema toggl.toggl_get_time_entry --json
ParameterTypeRequiredDescription
time_entry_id string yes The time entry ID.

toggl.toggl_list_projects

List projects in a Toggl workspace. Optionally filter for active projects only.

Operation
Read read
Schema command
kosmo integrations:schema toggl.toggl_list_projects --json
ParameterTypeRequiredDescription
workspace_id string yes The workspace ID.
active boolean no Filter for active projects only (default: true).

toggl.toggl_list_time_entries

List recent Toggl time entries. Optionally filter by date range.

Operation
Read read
Schema command
kosmo integrations:schema toggl.toggl_list_time_entries --json
ParameterTypeRequiredDescription
start_date string no Start date filter (ISO 8601 date, e.g. "2026-01-01").
end_date string no End date filter (ISO 8601 date).

toggl.toggl_list_workspaces

List all Toggl workspaces the authenticated user belongs to. Returns workspace IDs and names needed for other Toggl tools.

Operation
Read read
Schema command
kosmo integrations:schema toggl.toggl_list_workspaces --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.