JSON output¶
Formats¶
Every command that reads or writes data accepts --format table|json|jsonl
and --json (= --format json). --json together with --format table is
a validation error. fields, config, llm and tui have no JSON
output.
| Format | Output |
|---|---|
table |
for humans; the default |
json |
one indented JSON value: an array for list commands, an object for writes |
jsonl |
one compact object per line |
Conventions¶
- Field names are stable (
snake_case). New fields may be added; existing fields are never renamed or removed. - IDs are numbers. An unset optional relation or string (no task, no
customer, no
status) isnull, never0or"". - Durations come twice: fractional
hours(Odoo's value) and wholeminutes(rounded). Attendance usesworked_hoursandworked_minutes;clock statusaddselapsed_minutesfor the running period. - Timestamps (
check_in,check_out) are RFC 3339 with the local UTC offset, e.g.2026-04-08T08:30:00+02:00. Dates areYYYY-MM-DD. - An empty result is
[], never empty output, also injsonl. - Errors are one envelope on stdout; see Errors.
Output per command¶
| Command | JSON output | Schema |
|---|---|---|
projects |
array of projects | project.schema.json |
tasks [project-id] |
array of tasks | task.schema.json |
entries, timesheets |
array of entries | entry.schema.json |
entries add / update ID |
the created / updated entry | entry.schema.json |
entries delete ID |
the entry as it was before deletion | entry.schema.json |
entries add / update with --dry-run |
the entry that would be written, plus dry_run and duplicates |
entry_dry_run.schema.json |
whoami |
the current user | user.schema.json |
clock status |
clock state with today's periods | clock_status.schema.json |
clock list |
array of attendance records, oldest first | attendance.schema.json |
clock in / clock out |
the created or closed record | attendance.schema.json |
clock add |
the created record | attendance.schema.json |
clock edit |
the record as it is now, plus before (null if created) |
attendance_edit.schema.json |
| any command, on failure | the error envelope | error.schema.json |
The schemas (JSON Schema draft 2020-12) are in
internal/output/schemas/.
They are the contract; the test suite checks every command against them.
Objects¶
project¶
$ odoo-work-cli projects --search portal --json
[
{
"id": 1,
"name": "Lighthouse Portal",
"active": true,
"customer": "Example Harbor Ltd",
"company": "Example Consulting",
"stage": "In Progress",
"project_manager": "Alex Demo",
"extra_fields": {}
}
]
extra_fields holds the configured extra fields
by name.
entry¶
$ odoo-work-cli entries --date 2026-04-09 --json
[
{
"id": 4019,
"date": "2026-04-09",
"project_id": 3,
"project": "Internal",
"task_id": 31,
"task": "Meetings",
"description": "Customer call",
"hours": 0.75,
"minutes": 45,
"employee": "Alex Demo",
"status": "draft",
"company": "Example Consulting"
},
{
"id": 4018,
"date": "2026-04-09",
"project_id": 1,
"project": "Lighthouse Portal",
"task_id": 13,
"task": "Code review",
"description": "Review fuzzy matching",
"hours": 1.5,
"minutes": 90,
"employee": "Alex Demo",
"status": "draft",
"company": "Example Consulting"
},
{
"id": 4017,
"date": "2026-04-09",
"project_id": 2,
"project": "Orchard Mobile App",
"task_id": 21,
"task": "Release 2.4",
"description": "Store screenshots",
"hours": 2,
"minutes": 120,
"employee": "Alex Demo",
"status": "draft",
"company": "Example Consulting"
}
]
entry_dry_run¶
$ odoo-work-cli entries add --project-id 1 --task-id 13 --date 2026-04-09 --hours 1:30 --description "Review fuzzy matching" --dry-run --json
{
"id": null,
"date": "2026-04-09",
"project_id": 1,
"project": "Lighthouse Portal",
"task_id": 13,
"task": "Code review",
"description": "Review fuzzy matching",
"hours": 1.5,
"minutes": 90,
"employee": null,
"status": null,
"company": "Example Consulting",
"dry_run": true,
"duplicates": [
{
"id": 4018,
"date": "2026-04-09",
"project_id": 1,
"project": "Lighthouse Portal",
"task_id": 13,
"task": "Code review",
"description": "Review fuzzy matching",
"hours": 1.5,
"minutes": 90,
"employee": "Alex Demo",
"status": "draft",
"company": "Example Consulting"
}
]
}
attendance¶
$ odoo-work-cli clock list --date 2026-04-08 --json
[
{
"id": 4606,
"employee_id": 7,
"employee": "Alex Demo",
"check_in": "2026-04-08T08:30:00+02:00",
"check_out": "2026-04-08T12:00:00+02:00",
"running": false,
"worked_hours": 3.5,
"worked_minutes": 210
},
{
"id": 4607,
"employee_id": 7,
"employee": "Alex Demo",
"check_in": "2026-04-08T12:30:00+02:00",
"check_out": "2026-04-08T17:00:00+02:00",
"running": false,
"worked_hours": 4.5,
"worked_minutes": 270
}
]
running is true and check_out null while the record is open.
Other objects¶
| Object | Fields |
|---|---|
task |
id, name, project_id, project, company, stage, active |
user |
id, name, login, email, company |
clock_status |
clocked_in, current_id, check_in, elapsed_minutes, periods, total_hours, total_minutes |
attendance_edit |
the attendance fields plus before |