Output, Config, And Paths¶
Output Modes¶
JSON is the default:
Table output is for human inspection:
CSV output is for spreadsheets and simple exports:
Scripts should prefer JSON when nested fields or application/runtime errors matter.
Structured Errors¶
For application/runtime failures, stdout remains empty and stderr receives the selected error format. JSON errors include error.error_code, error.message, and optional error.details.
Argument parsing and usage failures are emitted by the CLI parser before command execution, so they use standard plain-text usage diagnostics.
Config Path¶
Default config path:
Fallback:
The config file is optional. With no config file, behavior is unchanged.
Default Timezone¶
With no configured default, now and the current_time MCP tool report UTC when no timezone is given. You can set a default timezone (or an ordered list) in config.toml:
# Single default timezone.
default_timezone = "Europe/Amsterdam"
# Or an ordered list (takes precedence over default_timezone when both are set).
default_timezones = ["Europe/Amsterdam", "UTC"]
Use the special value system (alias local) to detect the operating-system timezone. An explicit TZ environment variable takes precedence and must be an IANA name or zoneinfo path. When TZ is unset, time-keep uses the platform timezone on Linux, macOS, Windows, and other supported targets:
The default is resolved with the following precedence (highest first):
- Explicit
--tzflags onnow(or thetimezonesargument tocurrent_time, including an explicit empty list, which means UTC). - The
TIME_KEEP_TZenvironment variable. Accepts a single IANA name, a comma-separated list, or thesystem/localtoken. default_timezones, thendefault_timezone, fromconfig.toml.- UTC.
TIME_KEEP_TZ is consulted before the config file is read, so a valid environment override works even when the config file is invalid.
Only IANA timezone names are accepted. An invalid name, or a system token that cannot be resolved, produces a structured INVALID_PARAMS error rather than a silent fallback. TIME_KEEP_TZ is handy for one-off overrides:
Because time-keep's public contract requires IANA names, an explicit POSIX TZ rule such as UTC0 cannot be represented and returns INVALID_PARAMS. It is never replaced silently with the machine timezone. An explicitly empty TZ value has the POSIX meaning of UTC.
Scoping and resilience:
- Only the commands that use the default read the config file:
nowwithout--tz, and thecurrent_timeMCP tool without atimezonesargument. A broken config never blocksconfig path, timers, calendar, holiday, or business-day commands. - Unknown config keys are ignored with a warning, so configs written for other time-keep versions keep working. Warnings never prefix or corrupt a structured CLI error.
- The MCP server starts even when the configured default is invalid: it prints a warning at startup, and only
current_timecalls that rely on the default return the structured error. - Defaults are re-resolved on every call, so a long-running MCP server picks up config edits and operating-system timezone changes (the
systemtoken) without a restart.
Data Path¶
Default data directory:
Fallback:
Override with:
time-keep --data-dir /tmp/time-keep-data timer list
TIME_KEEP_DATA_DIR=/tmp/time-keep-data time-keep timer list
Only timers persist.