odoo-work-cli entries add¶
NAME¶
odoo-work-cli-entries-add - Create a new timesheet entry
SYNOPSIS¶
odoo-work-cli entries add --description TEXT --hours H --project-id ID [--date YYYY-MM-DD] [--dry-run] [--task-id ID] [--json | --format FORMAT]
DESCRIPTION¶
Create a timesheet entry of --hours on the day --date (default today) with the description --description, on the project --project-id and, optionally, its task --task-id.
--hours takes decimal hours (2.5) or H:MM (2:30) and must be greater than zero. The input is checked before any connection is made.
With --dry-run the input is validated, project and task are resolved (an unknown project, or a task of another project, is a validation error), and the entry that would be created is printed; nothing is written. Entries of the same day with the same project, task and description are reported as possible duplicates.
OPTIONS¶
--dateYYYY-MM-DD-
Day of the entry, YYYY-MM-DD.
string; optional; default: today
--descriptionTEXT-
TEXT describing the work.
string; required
--dry-run-
Validate and print the entry that would be written, without writing it.
flag; optional
--hoursH-
Hours worked, decimal (2.5) or H:MM (2:30).
string; required
--project-idID-
ID of the project to book on (see projects).
integer; required
--task-idID-
ID of the task to book on (see tasks); must belong to the project.
integer; optional
GLOBAL OPTIONS¶
--formatFORMAT-
Output FORMAT: table, json or jsonl.
one of table, json, jsonl; optional; default: table
--json-
Shorthand for --format json.
flag; optional
--backendBACKEND-
BACKEND: odoo or fake (offline, made-up data; env ODOO_WORK_CLI_BACKEND).
string; optional; default: odoo; env: ODOO_WORK_CLI_BACKEND
--configFILE-
Read only the config FILE (skip discovery).
string; optional
-h,--help- Print the help of the command and exit.
OUTPUT¶
Prints "Created entry ID". With --dry-run, "Dry run: would create this entry; nothing was written." followed by the entry, and a warning per possible duplicate.
With --json the created entry. With --dry-run and --json the proposed entry with id null, dry_run true and duplicates (entry_dry_run.schema.json).
Fields of entry.schema.json:
id- integer
date- string (YYYY-MM-DD)
project_id- integer or null
project- string or null
task_id- integer or null
task- string or null
description- string
hours- number
minutes- integer
employee- string or null
status- string or null
company- string or null
Fields of entry_dry_run.schema.json: those of entry.schema.json, except:
id-
null for add: the entry does not exist yet.
integer or null
dry_run- always true
duplicates-
Entries of the same day with the same project, task and description.
array of object (entry.schema.json)
ENVIRONMENT¶
ODOO_URL- Odoo server URL; overrides url from the config files.
ODOO_DATABASE- Odoo database name; overrides database.
ODOO_USERNAME- Odoo login, usually an e-mail address; overrides username.
ODOO_PASSWORD- Odoo API key, used for XML-RPC. Despite the name, not the login password.
ODOO_WEB_PASSWORD- Odoo login password, used for the web session of clock in and clock out.
ODOO_TOTP_SECRET- TOTP secret (base32 or otpauth:// URL) for accounts with two-factor authentication.
ODOO_OP_TIMEOUT- Timeout of the 1Password call that resolves [op_secrets], a Go duration; default 5s.
ODOO_WORK_CLI_NO_OP- If 1, true, yes or on, [op_secrets] is ignored and the 1Password CLI is never called.
ODOO_WORK_CLI_BACKEND- Backend, odoo (default) or fake; --backend overrides it.
ODOO_WORK_CLI_FAKE_STATE- State file of the fake backend; default odoo-work-cli-fake-state.json in the temporary directory.
XDG_CONFIG_HOME- Base directory of the global config file; default ~/.config.
FILES¶
~/.config/odoo-work-cli/config.toml- Global configuration ($XDG_CONFIG_HOME/odoo-work-cli/config.toml if XDG_CONFIG_HOME is set). Created by odoo-work-cli config install.
.odoo-work-cli.toml- Configuration of a directory tree. Every such file from the filesystem root down to the current directory is merged over the global file, the deepest last. --config FILE loads only FILE instead.
$TMPDIR/odoo-work-cli-fake-state.json- State of the fake backend (--backend fake); ODOO_WORK_CLI_FAKE_STATE sets another path. Delete it to start over with the seed data.
EXIT STATUS¶
0 on success, 1 on any error, including usage errors. With --json or --format json|jsonl the error is printed on standard output as one JSON object, {"error": {"kind": KIND, "message": TEXT}}, and nothing on standard error; otherwise as "Error: TEXT" on standard error, after usage errors followed by the usage.
Error kinds this command can fail with:
auth- Authentication failed: wrong API key or login password, TOTP rejected.
validation- Invalid input: unknown flag, bad argument, malformed date, time or hours, a time in the future, an unknown project.
network- Odoo cannot be reached: DNS, connection refused, timeout, TLS.
config- The local configuration is missing or invalid.
secrets_locked- 1Password is locked or unreachable, so op:// references could not be resolved.
internal- Anything else: an unexpected Odoo response or a bug.
EXAMPLES¶
Preview 90 minutes on a task without writing anything:
$ odoo-work-cli entries add --project-id 1 --task-id 13 --date 2026-04-09 --hours 1:30 --description "Review fuzzy matching" --dry-run
Dry run: would create this entry; nothing was written.
Date: 2026-04-09
Project: Lighthouse Portal (1)
Task: Code review (13)
Hours: 1:30
Description: Review fuzzy matching
Warning: possible duplicate of entry 4018 (same day, project, task and description)
Book 45 minutes:
$ odoo-work-cli entries add --project-id 2 --task-id 22 --date 2026-04-09 --hours 0:45 --description "Answer support mail"
Created entry 5000
Book and print the created entry as JSON:
$ odoo-work-cli entries add --project-id 3 --task-id 31 --date 2026-04-09 --hours 0.5 --description "Standup" --json
{
"id": 5001,
"date": "2026-04-09",
"project_id": 3,
"project": "Internal",
"task_id": 31,
"task": "Meetings",
"description": "Standup",
"hours": 0.5,
"minutes": 30,
"employee": "Alex Demo",
"status": "draft",
"company": "Example Consulting"
}