Kimai Time Tracking Skill
Complete API integration for Kimai time-tracking software. Enables full control over timesheets, projects, customers, activities, teams, invoices, and system configuration.
When to use
Activate this skill when the user requests:
- Start/stop/restart time tracking (timers)
- List, filter, or export timesheets
- Manage customers, projects, or activities
- Create invoices or export data
- Administrative tasks (users, teams, rates)
- Query system status (version, plugins, config)
Activation triggers:
- Keywords: "kimai", "zeiterfassung", "timesheet", "timer", "stunden", "erfasse Zeit", "starte Tracking", "Projekt anlegen", "Rechnung erstellen"
- "Start tracking for project X"
- "Show my timesheets from last week"
- "Create new customer in Kimai"
- "Export timesheets to CSV"
- "List all active timers"
- "Stop current time tracking"
Do NOT activate for:
- General time questions ("What time is it?")
- Other time-tracking tools (Toggl, Clockify, etc.)
- Calendar/scheduling without Kimai context
Environment Setup
Required Environment Variables:
KIMAI_BASE_URL - Full URL to Kimai instance (e.g., https://kimai.example.com)
KIMAI_API_TOKEN - Bearer token for authentication
Optional:
KIMAI_WORKSPACE - Path for exports/temp files (defaults to ~/.openclaw/workspace/kimai)
API Permissions required depend on operation:
view_own_timesheet, create_own_timesheet, edit_own_timesheet, delete_own_timesheet
view_other_timesheet (for viewing other users' entries)
view_customer, edit_customer, delete_customer
view_project, edit_project, delete_project
view_activity, edit_activity, delete_activity
view_team, edit_team, create_team, delete_team
view_invoice (for invoice operations)
view_user (for user management)
Compatibility: Requires Kimai 2.x with REST API enabled. Internet access required. Linux/macOS supported.
Workflow
1. Quick Time Tracking
# List recent activities (to find project/activity IDs)
./scripts/kimai_cli.py timesheets recent
# Start tracking
./scripts/kimai_cli.py timesheets start --project 1 --activity 5 --description "Implementing API"
# Check active timers
./scripts/kimai_cli.py timesheets active
# Stop tracking
./scripts/kimai_cli.py timesheets stop --id 123
2. Data Management Workflow
# Create customer → Project → Activity hierarchy
./scripts/kimai_cli.py customers create --name "Acme Corp" --country DE --currency EUR --timezone Europe/Berlin
./scripts/kimai_cli.py projects create --name "Website Redesign" --customer 1
./scripts/kimai_cli.py activities create --name "Development" --project 1
# List with filters
./scripts/kimai_cli.py timesheets list --customer 1 --begin "2024-01-01T00:00:00" --exported 0
3. Export/Invoice Workflow
# Mark timesheets as exported (locks them)
./scripts/kimai_cli.py timesheets export --id 123
# List invoices
./scripts/kimai_cli.py invoices list --status pending --begin 2024-01-01T00:00:00
CLI Tool Reference
Use scripts/kimai_cli.py for all operations. Structure follows API endpoints:
Timesheets (timesheets)
list - List entries (supports pagination, filters: user, customer, project, activity, tags, date range, exported status)
get <id> - Fetch single entry
create - Create manual entry or start timer (omit --end for active tracking)
update <id> - Patch existing entry
delete <id> - Requires confirmation (destructive)
stop <id> - Stop active timer
restart <id> - Restart finished entry (creates new)
duplicate <id> - Copy entry (resets export status)
active - List currently running timers
recent - Recent unique working sets (last activity per project/activity combination)
export <id> - Toggle export/lock status
Customers (customers)
list - List customers (filter: visible, term)
get <id> - Fetch customer details
create - Create new customer
update <id> - Update customer
delete <id> - Requires confirmation (cascades to projects/activities/timesheets)
meta <id> - Update custom fields
rates <id> - Manage customer-specific rates
Projects (projects)
list - List projects (filter: customer, visible, date range)
get <id> - Fetch project
create - Create project (requires customer ID)
update <id> - Update project
delete <id> - Requires confirmation (cascades to activities/timesheets)
rates <id> - Manage project rates
Activities (activities)
list - List activities (filter: project, visible, global only)
get <id> - Fetch activity
create - Create activity (can be global or project-specific)
update <id> - Update activity
delete <id> - Requires confirmation (cascades to timesheets)
rates <id> - Manage activity rates
Teams (teams)
list, get, create, update, delete
member-add <team-id> <user-id> - Add team member
member-remove <team-id> <user-id> - Remove member
grant-customer <team-id> <customer-id> - Grant customer access
grant-project <team-id> <project-id> - Grant project access
grant-activity <team-id> <activity-id> - Grant activity access
Users (users)
list - List users (requires view_user permission)
me - Current user info
get <id> - User details
create - Create user (admin)
update <id> - Update user
Invoices (invoices)
list - List invoices (filter: date range, customer, status)
get <id> - Invoice details
System (system)
ping - Test connectivity
version - Kimai version info
plugins - Installed plugins
config - Timesheet configuration
colors - Color codes
Safety & Boundaries
⚠️ DESTRUCTIVE OPERATIONS
delete operations on customers, projects, activities, timesheets, teams, or tags require explicit user confirmation.
- Deleting customers cascades to all linked projects, activities, and timesheets [1].
- Deleting projects cascades to activities and timesheets [1].
- The CLI will show a preview of affected data and require "yes" confirmation.
API Security:
- API token is passed via
Authorization: Bearer header [1].
- Token is never logged or stored in CLI output.
- Use
--dry-run flag for testing (simulates API calls without executing).
Rate Limiting & Pagination:
- API returns paginated results (default 50 items) [1].
- CLI auto-handles pagination for
list commands (fetches all pages or respects --limit).
- Use
--page and --size for manual pagination control.
Data Privacy:
- Timesheet data may contain sensitive information.
- Export files are saved to workspace with restricted permissions (600).
- Redact personal data (emails, names) when sharing debug output.
Workspace Safety:
- All file exports (CSV, JSON) default to
KIMAI_WORKSPACE or ~/.openclaw/workspace/kimai.
- Never write to system directories outside workspace without explicit confirmation.
Input/Output Specifications
Inputs:
- Entity IDs (integers)
- ISO 8601 datetime strings (YYYY-MM-DDTHH:mm:ss)
- JSON data for create/update operations (via --json file or CLI args)
- Filter parameters (customer, project, activity IDs, date ranges, visibility)
Outputs:
- JSON (default, pipe-friendly)
- Table format (
--format table for human readability)
- CSV (
--format csv for exports)
- Exit codes: 0 (success), 1 (API error), 2 (validation error), 3 (cancelled by user)
Success Criteria:
- HTTP 200/201 for successful operations
- Valid JSON response structure matching API schemas [1]
- For exports: File created in workspace with expected record count
Examples
Start tracking with description
./scripts/kimai_cli.py timesheets create \
--project 5 \
--activity 12 \
--description "Client meeting - requirements analysis" \
--tags "meeting,urgent"
List and export non-exported hours
# Find billable hours not yet exported
./scripts/kimai_cli.py timesheets list \
--exported 0 \
--billable 1 \
--begin "2024-01-01T00:00:00" \
--end "2024-01-31T23:59:59" \
--format csv > january_hours.csv
Update custom fields (meta)
./scripts/kimai_cli.py customers meta 42 \
--name "order_number" \
--value "PO-2024-001"
Create team and assign resources
./scripts/kimai_cli.py teams create --name "Development Team" --members '[{"user": 1, "teamlead": true}]'
./scripts/kimai_cli.py teams grant-project 1 5
Error Handling
Common HTTP codes:
200 - Success
201 - Created
204 - No content (successful delete)
400 - Bad request (validation error, missing fields)
401 - Unauthorized (invalid/expired token)
403 - Forbidden (insufficient permissions)
404 - Not found (invalid ID)
409 - Conflict (overlapping timesheet if not allowed by config)
CLI behavior:
- Validates required fields before API call (e.g., project+activity for timesheets [1])
- Pretty-prints validation errors from API
- Suggests fixes (e.g., "Did you mean to use 'PATCH' instead of DELETE? Try setting visible=false to hide instead of delete")
Validation
Validate this skill using the Openclaw skills validator:
skills-ref validate ./kimai-time-tracking
Test API connectivity:
export KIMAI_BASE_URL="https://your-kimai.example.com"
export KIMAI_API_TOKEN="your-api-token"
./kimai-time-tracking/scripts/kimai_cli.py system ping
References
1---2name: kimai-time-tracking3description: Complete Kimai time-tracking API integration. Manage timesheets, customers, projects, activities, teams, invoices and exports via REST API. Supports time tracking workflows, reporting, and administrative operations. Keywords - kimai, zeiterfassung, timesheet, tracking, project, customer, activity, invoice, export, timer, stunden4---5
6# Kimai Time Tracking Skill
7
8Complete API integration for [Kimai](https://www.kimai.org/) time-tracking software. Enables full control over timesheets, projects, customers, activities, teams, invoices, and system configuration.
9
10## When to use
11
12**Activate this skill when the user requests:**
13- Start/stop/restart time tracking (timers)
14- List, filter, or export timesheets
15- Manage customers, projects, or activities
16- Create invoices or export data
17- Administrative tasks (users, teams, rates)
18- Query system status (version, plugins, config)
19
20**Activation triggers:**
21- Keywords: "kimai", "zeiterfassung", "timesheet", "timer", "stunden", "erfasse Zeit", "starte Tracking", "Projekt anlegen", "Rechnung erstellen"
22- "Start tracking for project X"
23- "Show my timesheets from last week"
24- "Create new customer in Kimai"
25- "Export timesheets to CSV"
26- "List all active timers"
27- "Stop current time tracking"
28
29**Do NOT activate for:**
30- General time questions ("What time is it?")
31- Other time-tracking tools (Toggl, Clockify, etc.)
32- Calendar/scheduling without Kimai context
33
34## Environment Setup
35
36**Required Environment Variables:**
37- `KIMAI_BASE_URL` - Full URL to Kimai instance (e.g., `https://kimai.example.com`)
38- `KIMAI_API_TOKEN` - Bearer token for authentication
39
40**Optional:**
41- `KIMAI_WORKSPACE` - Path for exports/temp files (defaults to `~/.openclaw/workspace/kimai`)
42
43**API Permissions required depend on operation:**
44- `view_own_timesheet`, `create_own_timesheet`, `edit_own_timesheet`, `delete_own_timesheet`
45- `view_other_timesheet` (for viewing other users' entries)
46- `view_customer`, `edit_customer`, `delete_customer`
47- `view_project`, `edit_project`, `delete_project`
48- `view_activity`, `edit_activity`, `delete_activity`
49- `view_team`, `edit_team`, `create_team`, `delete_team`
50- `view_invoice` (for invoice operations)
51- `view_user` (for user management)
52
53**Compatibility:** Requires Kimai 2.x with REST API enabled. Internet access required. Linux/macOS supported.
54
55## Workflow
56
57### 1. Quick Time Tracking
58
59```bash
60# List recent activities (to find project/activity IDs)
61./scripts/kimai_cli.py timesheets recent
62
63# Start tracking
64./scripts/kimai_cli.py timesheets start --project 1 --activity 5 --description "Implementing API"
65
66# Check active timers
67./scripts/kimai_cli.py timesheets active
68
69# Stop tracking
70./scripts/kimai_cli.py timesheets stop --id 123
71```
72
73### 2. Data Management Workflow
74
75```bash
76# Create customer → Project → Activity hierarchy
77./scripts/kimai_cli.py customers create --name "Acme Corp" --country DE --currency EUR --timezone Europe/Berlin
78./scripts/kimai_cli.py projects create --name "Website Redesign" --customer 1
79./scripts/kimai_cli.py activities create --name "Development" --project 1
80
81# List with filters
82./scripts/kimai_cli.py timesheets list --customer 1 --begin "2024-01-01T00:00:00" --exported 0
83```
84
85### 3. Export/Invoice Workflow
86
87```bash
88# Mark timesheets as exported (locks them)
89./scripts/kimai_cli.py timesheets export --id 123
90
91# List invoices
92./scripts/kimai_cli.py invoices list --status pending --begin 2024-01-01T00:00:00
93```
94
95## CLI Tool Reference
96
97Use `scripts/kimai_cli.py` for all operations. Structure follows API endpoints:
98
99### Timesheets (`timesheets`)
100- `list` - List entries (supports pagination, filters: user, customer, project, activity, tags, date range, exported status)
101- `get <id>` - Fetch single entry
102- `create` - Create manual entry or start timer (omit --end for active tracking)
103- `update <id>` - Patch existing entry
104- `delete <id>` - **Requires confirmation** (destructive)
105- `stop <id>` - Stop active timer
106- `restart <id>` - Restart finished entry (creates new)
107- `duplicate <id>` - Copy entry (resets export status)
108- `active` - List currently running timers
109- `recent` - Recent unique working sets (last activity per project/activity combination)
110- `export <id>` - Toggle export/lock status
111
112### Customers (`customers`)
113- `list` - List customers (filter: visible, term)
114- `get <id>` - Fetch customer details
115- `create` - Create new customer
116- `update <id>` - Update customer
117- `delete <id>` - **Requires confirmation** (cascades to projects/activities/timesheets)
118- `meta <id>` - Update custom fields
119- `rates <id>` - Manage customer-specific rates
120
121### Projects (`projects`)
122- `list` - List projects (filter: customer, visible, date range)
123- `get <id>` - Fetch project
124- `create` - Create project (requires customer ID)
125- `update <id>` - Update project
126- `delete <id>` - **Requires confirmation** (cascades to activities/timesheets)
127- `rates <id>` - Manage project rates
128
129### Activities (`activities`)
130- `list` - List activities (filter: project, visible, global only)
131- `get <id>` - Fetch activity
132- `create` - Create activity (can be global or project-specific)
133- `update <id>` - Update activity
134- `delete <id>` - **Requires confirmation** (cascades to timesheets)
135- `rates <id>` - Manage activity rates
136
137### Teams (`teams`)
138- `list`, `get`, `create`, `update`, `delete`
139- `member-add <team-id> <user-id>` - Add team member
140- `member-remove <team-id> <user-id>` - Remove member
141- `grant-customer <team-id> <customer-id>` - Grant customer access
142- `grant-project <team-id> <project-id>` - Grant project access
143- `grant-activity <team-id> <activity-id>` - Grant activity access
144
145### Users (`users`)
146- `list` - List users (requires view_user permission)
147- `me` - Current user info
148- `get <id>` - User details
149- `create` - Create user (admin)
150- `update <id>` - Update user
151
152### Invoices (`invoices`)
153- `list` - List invoices (filter: date range, customer, status)
154- `get <id>` - Invoice details
155
156### System (`system`)
157- `ping` - Test connectivity
158- `version` - Kimai version info
159- `plugins` - Installed plugins
160- `config` - Timesheet configuration
161- `colors` - Color codes
162
163## Safety & Boundaries
164
165**⚠️ DESTRUCTIVE OPERATIONS**
166- `delete` operations on customers, projects, activities, timesheets, teams, or tags **require explicit user confirmation**.
167- Deleting customers cascades to all linked projects, activities, and timesheets [1].
168- Deleting projects cascades to activities and timesheets [1].
169- The CLI will show a preview of affected data and require "yes" confirmation.
170
171**API Security:**
172- API token is passed via `Authorization: Bearer` header [1].
173- Token is never logged or stored in CLI output.
174- Use `--dry-run` flag for testing (simulates API calls without executing).
175
176**Rate Limiting & Pagination:**
177- API returns paginated results (default 50 items) [1].
178- CLI auto-handles pagination for `list` commands (fetches all pages or respects `--limit`).
179- Use `--page` and `--size` for manual pagination control.
180
181**Data Privacy:**
182- Timesheet data may contain sensitive information.
183- Export files are saved to workspace with restricted permissions (600).
184- Redact personal data (emails, names) when sharing debug output.
185
186**Workspace Safety:**
187- All file exports (CSV, JSON) default to `KIMAI_WORKSPACE` or `~/.openclaw/workspace/kimai`.
188- Never write to system directories outside workspace without explicit confirmation.
189
190## Input/Output Specifications
191
192**Inputs:**
193- Entity IDs (integers)
194- ISO 8601 datetime strings (YYYY-MM-DDTHH:mm:ss)
195- JSON data for create/update operations (via --json file or CLI args)
196- Filter parameters (customer, project, activity IDs, date ranges, visibility)
197
198**Outputs:**
199- JSON (default, pipe-friendly)
200- Table format (`--format table` for human readability)
201- CSV (`--format csv` for exports)
202- Exit codes: 0 (success), 1 (API error), 2 (validation error), 3 (cancelled by user)
203
204**Success Criteria:**
205- HTTP 200/201 for successful operations
206- Valid JSON response structure matching API schemas [1]
207- For exports: File created in workspace with expected record count
208
209## Examples
210
211### Start tracking with description
212
213```bash
214./scripts/kimai_cli.py timesheets create \
215 --project 5 \
216 --activity 12 \
217 --description "Client meeting - requirements analysis" \
218 --tags "meeting,urgent"
219```
220
221### List and export non-exported hours
222
223```bash
224# Find billable hours not yet exported
225./scripts/kimai_cli.py timesheets list \
226 --exported 0 \
227 --billable 1 \
228 --begin "2024-01-01T00:00:00" \
229 --end "2024-01-31T23:59:59" \
230 --format csv > january_hours.csv
231```
232
233### Update custom fields (meta)
234
235```bash
236./scripts/kimai_cli.py customers meta 42 \
237 --name "order_number" \
238 --value "PO-2024-001"
239```
240
241### Create team and assign resources
242
243```bash
244./scripts/kimai_cli.py teams create --name "Development Team" --members '[{"user": 1, "teamlead": true}]'
245./scripts/kimai_cli.py teams grant-project 1 5
246```
247
248## Error Handling
249
250**Common HTTP codes:**
251- `200` - Success
252- `201` - Created
253- `204` - No content (successful delete)
254- `400` - Bad request (validation error, missing fields)
255- `401` - Unauthorized (invalid/expired token)
256- `403` - Forbidden (insufficient permissions)
257- `404` - Not found (invalid ID)
258- `409` - Conflict (overlapping timesheet if not allowed by config)
259
260**CLI behavior:**
261- Validates required fields before API call (e.g., project+activity for timesheets [1])
262- Pretty-prints validation errors from API
263- Suggests fixes (e.g., "Did you mean to use 'PATCH' instead of DELETE? Try setting visible=false to hide instead of delete")
264
265## Validation
266
267Validate this skill using the Openclaw skills validator:
268
269```bash
270skills-ref validate ./kimai-time-tracking
271```
272
273Test API connectivity:
274
275```bash
276export KIMAI_BASE_URL="https://your-kimai.example.com"
277export KIMAI_API_TOKEN="your-api-token"
278./kimai-time-tracking/scripts/kimai_cli.py system ping
279```
280
281## References
282
283- Kimai REST API Docs: https://www.kimai.org/documentation/rest-api.html
284- Pagination Guide: https://www.kimai.org/documentation/api-pagination.html
285- API Spec: `references/api-reference.json` (complete OpenAPI schema)