Skip to content

Configuration

Configuration comes from TOML files and environment variables. How the layers combine and why: Config layering.

Files

Order File
1 $XDG_CONFIG_HOME/odoo-work-cli/config.toml, default ~/.config/odoo-work-cli/config.toml
2 every .odoo-work-cli.toml from the filesystem root down to the current directory
3 [op_secrets], resolved through 1Password
4 environment variables (highest priority)

--config FILE skips 1 and 2 and loads only that file, then 3 and 4.

Command Does
odoo-work-cli config list the files found, in merge order
odoo-work-cli config --merged print the merged config, secrets left out
odoo-work-cli config install write a commented default config to the global path

Top-level keys

Key Meaning
url Odoo server URL, e.g. https://odoo.example.com
database database name
username login, usually an e-mail address
bundesland German federal state for public holidays in the TUI; default Baden-Württemberg

A password key outside [op_secrets] is rejected at load time. Secrets come from [op_secrets] or environment variables only.

[op_secrets]

Each value is an op:// reference, resolved by the 1Password CLI at startup, or a plain value used as is.

Key Meaning
url, database, username as above
api-key Odoo API key (XML-RPC)
password Odoo login password (web session: clock in / clock out)
totp_secret TOTP secret, base32 or otpauth:// URL (only with 2FA)
[op_secrets]
api-key     = "op://Employee/odoo/api-key"
password    = "op://Employee/odoo/password"
totp_secret = "op://Employee/odoo/totp_secret"

Which credential is needed when: Secrets.

[hours]

Limits for the colours of day and week totals in the TUI.

Key Default Meaning
daily_low 6.0 below: yellow
daily_high 9.0 above: red
weekly_low 35.0 below: yellow
weekly_high 40.0 above: red

[company_colors]

Company name → colour of the row prefix in the TUI. A colour is an ANSI 256 colour number as a string ("5") or a hex value ("#ff8800"). Companies not listed use the default colour.

[keys]

Action → key or list of keys. See TUI keys and views.

[models.<name>]

Per-model settings for project, task and timesheet.

filters restrict every query of that model. They accumulate across config files (AND); a child file's filter on the same field replaces the parent's.

[models.project]
filters = [
  { field = "company_id.name", op = "=", value = "Example Consulting" },
]

[models.task]
filters = [
  { field = "stage_id.name", op = "=", value = "In Progress" },
]

op is an Odoo domain operator: =, !=, ilike, >, <, >=, <=, …

extra_fields fetch additional Odoo fields; they show up as columns and in extra_fields of the JSON output. Currently used for projects:

[models.project]
extra_fields = [
  { name = "product_owner", field = "x_studio_productowner", type = "many2one" },
]

type is the Odoo field type: many2one, char, boolean, integer, float.

The TUI grid ignores [models.timesheet] filters and always shows all of your own bookings, because entries on another company's project carry that company's company_id. The entries and timesheets commands apply them.

Environment variables

Variable Meaning
ODOO_URL server URL
ODOO_DATABASE database name
ODOO_USERNAME login
ODOO_PASSWORD the API key (XML-RPC)
ODOO_WEB_PASSWORD the login password (web session)
ODOO_TOTP_SECRET TOTP secret, base32 or otpauth:// URL
ODOO_WORK_CLI_NO_OP 1: ignore [op_secrets], never call op
ODOO_OP_TIMEOUT timeout of the 1Password call, a Go duration; default 5s
ODOO_WORK_CLI_BACKEND odoo (default) or fake; --backend overrides it
ODOO_WORK_CLI_FAKE_STATE state file of the fake backend
XDG_CONFIG_HOME base directory of the global config file

Example

odoo-work-cli config install writes this file:

# odoo-work-cli configuration
# See: https://github.com/seletz/odoo-work-cli

# Odoo server URL
url = "https://odoo.example.com"

# Odoo database name
database = "odoo"

# Odoo username (login email)
username = "user@example.com"

# NOTE: password/API key must NOT be stored as plain text here.
# Use [op_secrets] below for 1Password, or set ODOO_PASSWORD env var.

# 1Password secret references (requires `op` CLI installed and signed in).
# Values are op:// URIs resolved at runtime via `op read`.
# [op_secrets]
# url      = "op://vault/item/url"
# database = "op://vault/item/database"
# username = "op://vault/item/username"
# api-key  = "op://vault/item/api-key"       # Odoo API key (for XML-RPC)
# password = "op://vault/item/password"       # Odoo login password (for clock in/out)

# German federal state for public holiday detection.
# Valid values: Baden-Württemberg, Bayern, Berlin, Brandenburg, Bremen,
#   Hamburg, Hessen, Mecklenburg-Vorpommern, Niedersachsen,
#   Nordrhein-Westfalen, Rheinland-Pfalz, Saarland, Sachsen,
#   Sachsen-Anhalt, Schleswig-Holstein, Thüringen
bundesland = "Baden-Württemberg"

# Work-hour thresholds for TUI color coding.
[hours]
daily_low = 6.0    # below this: yellow
daily_high = 9.0   # above this: red
weekly_low = 35.0  # below this: yellow
weekly_high = 40.0 # above this: red

# TUI key bindings (action = "key" or action = ["key1", "key2"]).
# All actions and their defaults:
# https://seletz.github.io/odoo-work-cli/reference/50-tui-keys/
# Typing in text fields is never intercepted by bindings; in the search view,
# focus_toggle (tab) moves focus to the results list where cursor keys apply.
# [keys]
# global_quit = ["q", "ctrl+c"]
# global_help = "?"
# focus_toggle = ["tab", "shift+tab"]

# Company-name to color mapping for TUI labels.
# [company_colors]
# "My Company" = "#ff8800"

# Per-model extra fields and default filters.
# [models.timesheet]
# extra_fields = [
#   { name = "product_owner", field = "x_studio_productowner", type = "many2one" },
# ]
# [[models.timesheet.filters]]
# field = "company_id.name"
# op    = "="
# value = "My Company"