TAME – V1 spec¶
TAME = TAME Arranges My Errands. Lightweight Taskwarrior-like CLI. TW = Taskwarrior. Repo: github.com/skitourer/tame · License: MIT
1. Scope¶
CLI task manager, Windows 11 first, TW-inspired, simpler. Independent project: no TW code, name or logo reused; TW JSON format compat only.
- Commands installed:
tame(main) +tk(short alias, used in examples).task= opt-in alias only (tame alias install|remove task, shim in uv tools bin dir); never by default (clashes with TW and go-task). Any name[A-Za-z0-9][A-Za-z0-9_-]*buttame/tkworks the same way. - In V1: cmds
add list done delete modify info undo export import help version alias; attrs description, status, project, tags, priority, due, entry, modified, end; hybrid grammar; EN date keywords; urgency sort; colored table; i18n files; TW JSON import/export. - Since 0.2.0:
print; help topicslicenseandcredits; kind words (§5). - Since 0.3.0: schema 3, annotations, depends, wait, start, recur, until stored natively (§3); virtual tags (§4);
nextreport anddefault_commandsetting (§5, §7);annotate/denotate(§5);wait:(§4), schema 3; shell completion (§5). Since 0.3.1:completionsetting (§7). Since 0.3.4: output style (§5),NO_COLOR(§7), help topicsecurity(§5). Since 0.3.5: easter eggs in color (§5). Since 0.3.6: kind words in pools, translatedlovereminders (§5);purge(§5). Since 0.4.0: schema 4sessions;depends:and+BLOCKING,start/stop, recurrence (recur:,until:,+RECURRING), filter operators and/pattern/(§4, §5). - Not yet (see
docs/ROADMAP.md): contexts, custom reports,--json, UDAs, hooks, stats (0.5); sync, TUI. - Hard rule:
corenever prints, never reads argv → future TUI reuses it unchanged.
2. Stack & standards¶
| Area | Choice |
|---|---|
| Lang | Python 3.12 baseline (requires-python >=3.12, ruff target-version py312); no deprecated APIs; full type hints |
| Pkg/env | uv; pyproject.toml (PEP 621), backend hatchling, src/ layout, uv.lock committed |
| Install | uv tool install tame-tasks (PyPI; also git+https://github.com/skitourer/tame; published by release.yml on a vX.Y.Z tag via trusted publishing, after approval in the pypi environment); one-line installers install.ps1/install.sh on the docs site install uv if missing, then TAME; [project.scripts] tame = "tame.__main__:main", tk = "tame.__main__:main" |
| Deps | runtime: rich, python-dateutil only; stdlib sqlite3, tomllib; no argparse (custom parser) |
| Lint/format | ruff check + ruff format, line 100 |
| Types | mypy --strict on src/ |
| Tests | pytest, pytest-cov; coverage ≥90% enforced (fail_under), report in the CI run summary; badge published with the docs site, no third-party service |
| Hooks | pre-commit: ruff, mypy, end-of-file, trailing-ws |
| VCS | GitHub, main protected, PRs, Conventional Commits, SemVer, tags vX.Y.Z |
| CI | GitHub Actions: lint + types + tests on windows-latest and ubuntu-latest, Py 3.12 + latest stable; built wheel installed as a uv tool and smoke-tested (scripts/smoke.py) on both OS |
| Docs site | MkDocs Material (docs dependency group), built --strict on every PR, deployed to GitHub Pages from main with the coverage badge |
| Repo files | README.md, CHANGELOG.md (Keep a Changelog), CONTRIBUTING.md, LICENSE, CLAUDE.md, docs/, .github/ (CI, issue/PR templates) |
| Data dir | Windows: %APPDATA%\tame\ (tasks.db, config.toml). Other OS (XDG): tasks.db in $XDG_DATA_HOME/tame/ (default ~/.local/share/tame/), config.toml in $XDG_CONFIG_HOME/tame/ (default ~/.config/tame/). Env TAME_HOME overrides both and holds both files |
| Output | always UTF-8 on stdout/stderr, also when redirected |
| Perf | lazy-import rich in render only; cold start target <250 ms |
3. Data model¶
Field names = TW names. Datetimes stored UTC ISO 8601, shown local.
| Field | Type | Notes |
|---|---|---|
| uuid | str UUIDv4 | PK, permanent |
| id | int | short id, pending only; renumbered (1..n by entry) after done/delete |
| description | str | required |
| status | pending/completed/deleted | delete = soft |
| project | str? | dotted hierarchy a.b |
| tags | set[str] | no spaces, no leading +/- |
| priority | H/M/L? | |
| due, end | datetime? | |
| entry, modified | datetime | auto |
| annotations | list[{entry, description}] | timestamped notes, sorted by entry; duplicates allowed (schema v2) |
| depends | set[uuid] | tasks this one waits for; never itself; target may be absent (schema v2) |
| wait | datetime? | hidden until then (§4 Waiting tasks) (schema v3) |
| start, until | datetime? | start: beginning of the current work session, set by tk start, cleared by stop/done/delete (since 0.4); until: end of a recurrence (§4 Recurrence, since 0.4) (schema v3) |
| sessions | list[{start, end}] | finished work sessions (schema v4, since 0.4) |
| recur | str? | recurrence period (§4 Recurrence, since 0.4); imported TW values stored as is (schema v3). Monthly and yearly series keep their day of month in extra.recur_anchor (int 1–31) |
CREATE TABLE tasks(uuid TEXT PRIMARY KEY, id INTEGER, description TEXT NOT NULL,
status TEXT NOT NULL CHECK(status IN('pending','completed','deleted')),
project TEXT, priority TEXT CHECK(priority IN('H','M','L')),
due TEXT, entry TEXT NOT NULL, modified TEXT NOT NULL, "end" TEXT,
extra TEXT); -- JSON: unknown TW attrs kept for round-trip
CREATE TABLE task_tags(uuid TEXT REFERENCES tasks(uuid) ON DELETE CASCADE, tag TEXT, PRIMARY KEY(uuid,tag));
CREATE TABLE undo_log(seq INTEGER PRIMARY KEY AUTOINCREMENT, ts TEXT NOT NULL, cmd TEXT NOT NULL, before TEXT NOT NULL); -- JSON snapshot
CREATE TABLE meta(key TEXT PRIMARY KEY, value TEXT); -- schema_version
-- schema v2
CREATE TABLE annotations(id INTEGER PRIMARY KEY, uuid TEXT NOT NULL REFERENCES tasks(uuid) ON DELETE CASCADE,
entry TEXT NOT NULL, description TEXT NOT NULL);
CREATE INDEX idx_annotations_uuid ON annotations(uuid);
CREATE TABLE depends(uuid TEXT NOT NULL REFERENCES tasks(uuid) ON DELETE CASCADE, depends_on TEXT NOT NULL,
PRIMARY KEY(uuid, depends_on), CHECK(uuid <> depends_on)); -- depends_on: no FK, target may be absent
-- schema v3
ALTER TABLE tasks ADD COLUMN wait TEXT; -- also start, recur, "until"
-- schema v4
CREATE TABLE sessions(id INTEGER PRIMARY KEY, uuid TEXT NOT NULL REFERENCES tasks(uuid) ON DELETE CASCADE,
start TEXT NOT NULL, "end" TEXT NOT NULL);
CREATE INDEX idx_sessions_uuid ON sessions(uuid);
Each write cmd = 1 transaction + 1 undo_log row. Migrations keyed on meta.schema_version: on open, each missing version is applied in its own transaction (all or nothing); a database newer than the code → error.db_too_new, nothing changed.
Migration 1 → 2 (0.3.0): creates annotations and depends, then moves each task's extra.annotations / extra.depends into them using the TW import rules (§7) and removes the key from extra. A key with any invalid item stays in extra unchanged. undo_log rows are not rewritten.
Migration 3 → 4 (0.4): creates sessions; nothing moved (a task started before keeps its start).
Migration 2 → 3 (0.3.0): adds wait, start, recur, until to tasks, then moves valid extra.wait/start/until (TW dates) and extra.recur (string) into them (TW import rules, §7); extra.tw_status = "waiting" is dropped once wait is set. 0.4 needs no further schema change.
before = {"tasks": [{uuid, task|null}], "ids"?: {uuid: id}}: prior state of each changed task (null = created by the cmd, undo removes it); ids = pending ids before done/delete renumbering. task includes annotations, depends, wait, start, recur, until; a snapshot written before schema v3 lacks some of them and has them in extra and is read with the TW import rules (§7). Cmds that change nothing log nothing. undo pops the last row: repeated undo goes further back; undo is not itself undoable; empty log → exit 2.
4. CLI grammar¶
tk [filter] <cmd> [args] # TW order (canonical)
tk <cmd> [filter] [args] # classic order (tolerated)
tk [filter] # = tk [filter] list (so `tk` = tk list), or `next` (default_command, §7)
Parse rules (in order):
- First token matching a cmd name (exact or unique prefix, e.g.
mod) = cmd. Cmd names EN only, never translated. A prefix of several cmds → usage error (exit 1), e.g.d→ delete/denotate/done.purge(since 0.3.6) matches its full name only, never a prefix:pstaysprint,puis no cmd. - Tokens before cmd = filter.
add: all tokens after = new task (mods + description); never a filter.- Classic order (nothing before cmd): leading filter-like tokens after cmd (ids, uuid,
+t,-t,attr:v) = filter; rest = args. Formodify,annotateanddenotate, only leading id/uuid tokens are filter. Cmds without args (list next done delete info export print purge start stop): all tokens after cmd = filter (printfirst takes out--file PATH,purgeits--allflag, anywhere before--). --ends parsing: rest = description words (tk add -- +1 vote for the new logo:+1is text, not a tag;tk 3 annotate -- Answer --yes by mail:--yesis text);--is never a cmd.- Unknown
attr:→ usage error (exit 1). - Filter given to a cmd that takes none (
addbefore it,alias completion config help import undo version) → usage error (exit 1).
Filter tokens (AND-combined, except ids and uuid prefixes which together form one OR-ed selection: tk 3 5 = tasks 3 and 5; and/or/not and parentheses since 0.4, see below; default status:pending unless status: given; status:all = any status):
| Token | Meaning |
|---|---|
3 3,5 2-6 |
ids (digits-only token = always ids) |
| 8+ hex chars | uuid prefix (dashes ignored) |
+t / -t |
has / lacks tag (virtual tag if t is one, see below) |
project:x |
project = x or x.*; project: = no project |
pri:H status:completed recur:weekly |
equality (pri = alias of priority; recur compares periods, since 0.4: recur:2w = biweekly = 14d, 12m = yearly, but 4w ≠ 1m; a period TAME does not understand compares as text, case-insensitive); pri: = no priority, recur: = not recurring; status:all = any status |
due.before:fri due.after:today |
date compare |
/pattern/ |
description matches the regular expression (Python re, case-insensitive, anywhere in the text; since 0.4). At least one character between the slashes. Invalid pattern → usage error naming it (exit 1) |
and or not ( ) |
operators (since 0.4, see below) |
| other word | case-insensitive substring of description |
Operators (since 0.4): tk "(+phone or +mail) and pri:H", tk +home or +garden, tk not +work.
- Only when typed: a filter without operators or parentheses parses exactly as before. The words
and,or,not(lowercase, exact) are reserved in filters: to search them in descriptions, use/or/or put them after--. - Terms: a run of plain tokens with no operator between them is one term, read as before (AND-combined, its ids and uuid prefixes one OR-ed selection):
3 5 +home or +urgent= (task 3 or 5, tagged home) or tagged urgent. - Precedence:
not(applies to the next token or parenthesized group:not +a +b= (not +a) and +b) >and(also implied between terms:(+a or +b) pri:H) >or. Left to right otherwise. - Parentheses group. PowerShell and Git Bash give
()a meaning, so quote them:tk '(+a or +b) pri:H'. A filter token holding a parenthesis is split on spaces and around each parenthesis ((+a→(+a); other quoted tokens with spaces stay one word, as before (tk "buy milk"). - Status and waiting: the default
status:pendingapplies to the whole filter when nostatus:appears anywhere in it; otherwise eachstatus:is a plain condition (status:completed or +home= completed tasks, or tasks of any status tagged home). Waiting tasks are shown when ids, uuids,+WAITINGorstatus:allappear anywhere. - Errors (usage error, exit 1): unbalanced parentheses (
Missing ')' in the filter./Unexpected ')' in the filter.), empty parentheses, an operator without a term on each side ('or' needs a filter on each side.,'not' needs a filter after it.). - Where: before the command (TW order) and after commands without args (rule 4:
tk list +a or +b). In classic order formodify,annotate,denotate, only leading ids stay filter, as before. Commands requiring a filter accept any non-empty expression (tk not +keep delete).
Virtual tags (since 0.3.0): computed when filtering, never stored. Uppercase, exact case, EN only. Used like tags in filters: tk +OVERDUE, tk +home -TAGGED. Days, weeks (Monday to Sunday) and months are local calendar periods; now = current time.
| Tag | True when |
|---|---|
OVERDUE |
pending, due < now |
TODAY / TOMORROW |
pending, due on the local day today / tomorrow |
WEEK / MONTH |
pending, due in the current local week / month (earlier days of it included) |
DUE |
pending, now ≤ due < now + 7 days |
BLOCKED |
pending, depends on at least one pending task |
UNBLOCKED |
pending, not BLOCKED |
BLOCKING |
pending, a pending task depends on it (since 0.4) |
ACTIVE |
pending, started (tk start, since 0.4) |
RECURRING |
pending, has a recur (since 0.4) |
WAITING |
pending, wait > now |
ANNOTATED |
has at least one annotation |
PROJECT |
has a project |
TAGGED |
has at least one (real) tag |
Names are reserved: +NAME in add/modify → validation error (exit 1); -NAME in modify removes a stored real tag of that name. Imported real tags with these names are kept and exported unchanged; in filters the name always means the virtual tag. WAITING since wait: (0.3.0), BLOCKING, ACTIVE and RECURRING since 0.4.
Mods (add, modify): attr:v set, attr: unset, +t add tag, -t remove tag, other words = description (modify: replaces it). Attrs: project, pri, due, wait (dates as due), depends, recur, until (dates as due) (since 0.4, see below).
Dependencies (since 0.4, TW semantics): depends:3,4 adds tasks 3 and 4 to the dependencies, depends:-3 removes one, depends: clears them all; items mix freely (depends:5,-3), several depends: tokens combine in order. Items: ids and id ranges (pending tasks), uuid prefixes of 8+ hex digits (any status). In add: additions only (-3 → validation error). Validation errors (exit 1, nothing changed): an id or prefix naming no task (No task 9.), a prefix naming several, an item that is neither (depends:x), a task depending on itself, a cycle among all stored tasks (Dependency cycle: 3 → 5 → 3, tasks by id, else uuid prefix). Bulk modify applies to each task; undoable like any modify. A dependency on a completed, deleted or absent task is kept but blocks nothing. After done, each pending task the completed ones were the last pending dependency of is reported: Task 5 'Paint walls' is now unblocked. Not a filter attribute (use +BLOCKED/+BLOCKING).
Recurrence (since 0.4, fixed schedule as in TW, but no template task and no background job): tk add Backup due:fri recur:weekly until:eoy. The pending task is the series; completing it creates the next one.
- Periods (case-insensitive, stored as typed, lowercased):
daily=1d,weekly=1w,biweekly=2w,monthly=1m,quarterly=3m,yearly=annual=1y,NdNwNmNy(N ≥ 1, days, weeks, calendar months, years),weekdays(Monday to Friday). Anything else inadd/modify→ validation error listing the forms (exit 1). Imported TW values are kept as is, whatever they are. - Rules (validation errors, exit 1, nothing changed):
recurneeds adue(set in the same command or already there); unsettingdueof a recurring task is refused (unsetrecurfirst, or together);untilneeds arecur.recur:stops the series (untiland the anchor are removed with it);until:removes the end. - Anchor: for
mandyperiods, the day of month ofdueis kept inextra.recur_anchorwhenrecuris set, and again whenduechanges. Dates are computed on the local calendar, the due's local time kept (DST-safe). - Next due, at
done: from the completed task'sdue, add the period (d/w: N × 1 or 7 days;m/y: N months or years on the anchor day, clamped to the month's length: Jan 31 → Feb 28 → Mar 31;weekdays: the next day from Monday to Friday) and repeat until the date is after now (missed occurrences are skipped, never created). doneof a recurring pending task: the task is completed as usual, then a new pending task is created in the same command (one undo step:undoremoves it and reopens the old one): same description, project, tags, priority,recur,until, anchor; the next due;waitshifted by the same amount asdueif set; not copied: annotations, dependencies,start/sessions, otherextrakeys. Message after the completion line:Next: task 7 'Backup', due 2026-12-04.If the next due is afteruntil: no new task,Task 3 'Backup' was the last of its series.(dim). A period TAME does not understand (imported), or an importedrecurwithoutdue: no new task, warningTask 3 'Backup': recurrence 'P1W' not understood, no next task.Several tasks done at once: each is handled.deleteof a recurring task ends the series (nothing created). Tasks depending on a completed occurrence are unblocked as usual and never moved to the next one.- Urgency: unchanged by recurrence.
Waiting tasks (since 0.3.0): a pending task with wait > now is waiting. Every filter result leaves waiting tasks out, unless the filter has ids/uuids, +WAITING or status:all; export always includes them. Nothing is stored when the date passes: the task simply shows again (its wait stays, shown by info). Waiting tasks keep their id and urgency. wait in the past or after due is accepted.
Bulk: modify/done/delete/annotate/denotate/start on > confirm_threshold (default 3) tasks → y/N prompt; --yes skips. delete and purge always prompt unless --yes.
modify/done/delete/annotate/denotate/start require a non-empty filter (usage error otherwise). --yes is accepted anywhere before --, only by these 6 cmds and purge. Answer other than y/yes (or the UI language's yes words, confirm.yes), or end of input, = no: nothing changed, exit 0. Messages name tasks by id before renumbering (uuid prefix if no id).
5. Commands¶
| Cmd | Example | Behavior |
|---|---|---|
| add | tk add Call bank project:home +phone due:tomorrow pri:H |
create; print Created task <id>. |
| list | tk project:home list |
table, pending tasks first, then by urgency desc; an annotated task's description ends with its annotation count, dim: Call bank [2]; a Recur column right after Due (since 0.4): the period as stored, dim, hidden when empty; a Wait column after it (hidden when empty); a Dep column after it (since 0.4): ids of the pending tasks it depends on, 3,4, hidden when empty; an Active column after Dep (since 0.4): time since start for active tasks (25min, 1h20), right-aligned, hidden when empty; if waiting tasks were left out, a last line N waiting task(s) hidden: tk +WAITING shows them.; no filter and no task at all (any status) → welcome with first commands, exit 0 |
| next | tk next, tk +home next |
list limited to what can be done now: the tasks matching the filter (pending by default) minus +BLOCKED ones, same sort and colors, first next_limit (default 10) only; columns ID, Project, Pri, Due, Recur (since 0.4), Active, Description, Urg (no Dep: blocked tasks are left out; empty ones hidden; annotation count, Wait column and hidden-waiting line as for list); if more tasks match, the summary line says N of M tasks (§5 Output style); no match → exit 2 (or the welcome message, like list). Since 0.3.0 |
| done | tk 3,5 done |
status=completed, end=now; a recurring task gets its next occurrence (§4 Recurrence, since 0.4) |
| delete | tk 4 delete |
status=deleted, end=now |
| modify | tk 12 modify due:mon -phone |
apply mods |
| annotate | tk 3 annotate Call back Monday |
add an annotation (entry = now) to each matching task; text = all args (-- dropped, rest kept); empty text → usage error; modified = now; undoable; print Annotated task <id> '<description>'. Since 0.3.0 |
| denotate | tk 3 denotate Call |
remove one annotation per matching task: the one whose text equals the arg (case-insensitive), else the only one containing it, else (no arg) the most recent; several contain it → validation error listing them (exit 1, nothing changed); tasks with no match are skipped; none changed → exit 2; modified = now; undoable. Since 0.3.0 |
| info | tk 7 info |
all fields, local times; one row per annotation; virtual tags (§4) |
| start | tk 3 start |
start work: start = now on the matching pending tasks (filter required; y/N above confirm_threshold, --yes); Started task <id> '<description>'.; an active one is skipped (Task 3 '…' is already active., dim). Unless multiple_active (default false): more than one task to start → validation error (Only one task can be active: N match…), and the other active tasks are stopped first, each reported as by stop. One undo step for all. Since 0.4 |
| stop | tk stop, tk 3 stop |
stop the active tasks (no filter: all of them; filter applied with +ACTIVE): a session {start, now} is recorded, start cleared; Stopped task <id> '<description>' after 1h20. (durations 45min, 1h20, 2d 3h); none → No active task., exit 2. done/delete of an active task record its session the same way, silently. Undoable. Since 0.4 |
| undo | tk undo |
revert last write cmd (from undo_log) |
| purge | tk purge, tk project:old purge --yes, tk purge --all |
erase tasks for good (TW semantics). Without --all: the matching deleted tasks (filter optional, applied with status:deleted; any other status: → usage error; no filter = every deleted task); y/N prompt Erase deleted task <ref> '<description>' for good? / Erase N deleted tasks for good?, --yes skips it. Removed with them: their tags, annotations, depends rows, and other tasks' depends rows pointing to them (those tasks' modified unchanged). --all: every task, any status; with a filter → usage error; stdin not a terminal → usage error (even with --yes); y/N Erase ALL N tasks (pending, completed, deleted) for good? (--yes skips it), then Type purge to confirm:, answer must be exactly purge (trimmed; same word in every language), never skipped; meta kept. Before any change, a copy of the database by the SQLite backup API, tame-YYYYMMDD-HHMMSS.db.bak (local time; -2, -3… if taken) next to tasks.db; copy fails → error, nothing purged. Prints Purged N task(s) for good., the backup path, and that undo is gone. Not undoable: clears undo_log. Nothing to purge → exit 2, no prompt, no backup. Backups are never removed by TAME. Since 0.3.6 |
tk +shopping print |
printable HTML page of the matching tasks (A4, black and white): title with the filter, date and time; one section per project (sorted, no project last), tasks by urgency, box to tick (ticked if ended), priority badge !H, tags, due <date> (+ today, or late in bold), annotations under the task (small italic, <date> <text>, oldest first); 3 empty boxed lines at the end; opened in the browser with the print dialog (print or save as PDF); --file PATH saves it without opening; no match → exit 2. Since 0.2.0 |
|
| export | tk status:all export > f.json |
TW JSON to stdout, one task per line, incl. id (0 if not pending) and urgency; waiting tasks always included; no match → [], exit 0 |
| import | tk import f.json |
TW JSON from FILE, or stdin if none or - (UTF-8, or UTF-16 with BOM); merge by uuid; prints added/updated/skipped counts; 1 undo step; any invalid task → nothing imported, error names the task number |
| alias | tk alias install task |
install\|remove NAME: opt-in shim NAME (NAME.cmd on Windows) running python -m tame, in the uv tool bin dir (UV_TOOL_BIN_DIR, XDG_BIN_HOME, $XDG_DATA_HOME/../bin, ~/.local/bin); marked as tame's: never overwrites/removes other files; warns if the dir is not in PATH or another NAME comes first |
| config | tk config set undo.retention 1y |
list / get / set / unset (= default) / path / edit settings (§7) |
| help | tk help [cmd\|topic] |
no arg: implemented cmds + 1-line summaries; cmd (exact or prefix): usage, text, examples; topics filters dates urgency security (since 0.3.4: the database is not encrypted by TAME; how to protect it with BitLocker, whole disk, or EFS, cipher /e /s:"%APPDATA%\tame"; that print and export files are plain too; why TAME does not encrypt: no encryption in stdlib sqlite3, a decrypted temp file would leave plaintext on disk, a password and a slow key derivation at every command) settings (every setting: what it does, values, default; tk help config KEY = one setting, plus its current value if config.toml reads; since 0.3.2) tour (guided tour; its commands run in order are a test) license (TAME's license text + installed libraries with versions and licenses, read from package metadata) credits (author Skitourer, thanks, libraries, tools). Topics, not commands: no new command names, so prefixes like tk l stay unambiguous. --help before -- = tk help [<cmd on the line>]. Works with an invalid config |
| completion | tk completion powershell |
advanced (not in the tk help list; tk help completion works): powershell\|bash prints the completion script for tk, tame and the aliases installed by alias, for shells or profiles TAME does not manage, dotfiles, or the always-current tk completion powershell \| Out-String \| Invoke-Expression. Everyday switch: the completion setting (§7). No arg (or extra words) → usage error giving the usage and tk config set completion true; unknown shell → usage error listing the shells. Since 0.3.0 |
| version | tk version |
app + schema version; second line points to tk help license / tk help credits |
list columns: ID Age Project Tags Pri Due Description Urg; hide empty cols; colors per column (see Output style).
Output style (since 0.3.4). One look for every command, so output, questions, errors and the shell prompt never blend.
- Modes. Styled colors: the stream is a terminal,
color = true,NO_COLORunset or empty. Layout (blank lines, symbols): the stream is a terminal, whatevercolor. Otherwise plain: no colors, no blank lines added, no symbols; table and message texts as before 0.3.4, apart from the summary line and theinfolayout below. stdout and stderr are judged separately. - Breathing space: in a terminal, each command's output starts with a blank line and ends with one, so the next prompt stands apart. Never for data output:
export,completion <shell>,config get,config path,_complete. The kind words line keeps its own blank line before it and moves inside the block (before the closing blank line). - Roles: every color comes from a named role (one table in
cli/render.py), groundwork for the 0.5themesetting; no role is configurable yet. ANSI blue is never used (unreadable on black in Windows Terminal).
| Role | Style | Used for |
|---|---|---|
header |
bold | table headers |
rule |
dim | rule under headers and under the info title |
id |
bold | ID column, task numbers in messages |
age |
dim | Age column |
project |
cyan | Project column, project in info |
tag |
bright magenta | Tags column, real tags in info |
pri.H / pri.M / pri.L |
bold red / yellow / dim | Pri column, priority in info |
due.overdue |
bold red | Due date of overdue tasks, and their ID |
due.today |
bold yellow | Due date of tasks due today, and their ID |
urgency.high / urgency.low |
bold (≥ 10) / dim (< 5) | Urg column, urgency in info |
note |
dim | annotation count, info labels, relative dates, virtual tags, uuid, Wait and Recur columns, end-of-series message |
summary |
dim | summary line (its overdue / due-today counts use due.*), hidden-waiting line, next hint |
success |
bold green ✓ |
prefix of success messages |
error |
bold red | ✗ and text of errors (stderr) |
warning |
bold yellow ! |
prefix of warnings (alias not in PATH or shadowed, completion blocked) |
question |
bold yellow ? |
prefix of y/N prompts; [y/N] dim |
hint |
dim | tips (Tip: …), Nothing changed. |
heading |
bold underline | section labels in help (Usage, Commands, Topics, Examples, …): a capitalized label of 3 words at most, at the start of a line, before : |
command |
cyan | command names in tk help, usage lines, indented tk … example lines (up to a two-space gap before a comment) |
kind |
italic dim | kind words |
- Rows: whole rows are no longer colored; only the Due date and the ID of an overdue / due-today task carry the alert. The rule under headers spans the table, dim.
- Summary line (
list,next): after the table, a blank line thenN tasks · X overdue · Y due today(parts with 0 left out; counts over the matching tasks, waiting ones excepted).nextwith more matches than shown:N of M tasks · …, then the hinttk list shows them all.(replaces the 0.3.0next.moreline). The hidden-waiting line follows unchanged. - Messages: symbols are layout:
✓success messages of write cmds (add done delete modify annotate denotate undo import,config set/unset,alias install/remove,printsaved/opened),✗errors,!warnings,?questions; plain mode prints the messages without them, as before. info: per task, a titleTask <id> <description>(bold; uuid prefix if no id), a dim rule, then label/value lines, labels dim and right-aligned, in blocks separated by a blank line: (1) Status, Project, Tags (real tags, then virtual tags dim), Priority, Urgency, Time spent (since 0.4: sessions plus the current one,2h15 (3 sessions), sessions dim; left out if never started), Depends (since 0.4: one line per task it depends on,3 'Buy paint': pending ones by id, then the others by uuid prefix, then absent onesa1b2c3d4 (missing)), Blocking (one line per pending task depending on it), Recur; (2) Due, Wait, Start, Entered, Modified, End, Until, each date followed by a dim relative form (overdue by 2 days,today,in 3 days,3 days ago); (3) Notes: one line per annotation,<date> <text>, oldest first, label on the first line only; (4) UUID, then Taskwarriorextraattributes (butrecur_anchor, since 0.4). Empty fields and empty blocks left out. NoName/Valueheader any more. Same layout in plain mode, without colors.- Help: section labels in
heading, command names, usage and example lines incommand, the rest unchanged; plain mode prints the text exactly as before.
Exit codes: 0 ok, 1 usage error, 2 no match, 3 internal error. Errors → stderr.
Kind words: short phrases about friends, family, colleagues, free time, nature and not fearing others, translated like any UI text (EN + FR), each shown as ♥ <phrase> on its own line after a blank line (italic, dim when colors are on). Since 0.3.6 they are TOML lists (pools) in the [kindness] section of each locale, their length read from en.toml (no count in the code; a missing translated item falls back to English): empty (15, about a finished list), general (50), reminders (50 tk add <text> +love due:<date> lines). Adding phrases = appending to the lists, same order in every locale. Wording: general relations only (friend, loved one, neighbour, colleague, family), never a specific relative (mum, brother, child…), so no one who lost a relative is hurt; reminders are valid add lines with +love and a due:, without ' " , ; & ( ) $ | < > @ #(they paste into any shell). Each pool has its own shuffled order, all of it before any repeat; phrases added later join from the next order. State inmeta, outside undo:kindness_last(cooldown),kindness_order.. They appear: (1) after a successfullist next add done delete modify annotate denotate info undo, only if stdout is a terminal, at most once every 3 days, then with a 1-in-10 chance per command (general); (2) whendoneleaves no pending task (terminal only;empty); (3) at the foot of aprintpage opened in the browser (not with--file;general); (4) in an easter egg (general, then). Every appearance but a reminder restarts the 3-day cooldown. Settingkindness = false` turns off (1)-(3).
Completion setup (since 0.3.1): the completion setting is the switch. After any successful command run in a terminal (stdout a tty; never in scripts, pipes or tests), TAME aligns the shell profiles with it: true → writes or refreshes, false → removes, a block between the lines # >>> tame completion >>> and # <<< tame completion <<< holding the script of tk completion <shell>; the rest of the file is never changed (encoding and line endings kept; file and folders created if missing). Profiles: on Windows, $PROFILE.CurrentUserCurrentHost of Windows PowerShell and of PowerShell 7 if installed, asked to powershell/pwsh once and cached in meta, and ~/.bashrc (LF line endings) if Git for Windows' Git Bash is installed (git-bash.exe in Git's folder; WSL's bash.exe does not count); elsewhere ~/.bashrc if $SHELL is bash. A PowerShell whose execution policy is Restricted or AllSigned is skipped (profiles would fail at every start) and the user told once. tk config set|unset completion and tk config edit re-detect the profiles and apply at once, with a message: enabled in <path> (open a new terminal), removed from <path>, blocked by the execution policy, or no supported shell. While completion is false and nothing was ever set up, the first command run in a terminal prints once: Tip: Tab completion is available: tk config set completion true.
Completion protocol (since 0.3.0): the scripts call the hidden tk _complete _<current> [words before it...] (current word prefixed with _, so an empty one survives PowerShell 5.1), which prints the candidates, full tokens starting with the current word, one per line, and always exits 0. Never in tk help. Fast path: handled in main() before parsing; no rich/tomlkit import, database read only, opened read-only and never created. Candidates by context: no command yet → command names, attribute names (project: pri: status: recur: due.before: due.after:); +/- → tags of pending tasks and virtual tags (BLOCKING, RECURRING included) (real tags only in add/modify mods); project: → projects of pending tasks; pri: → H M L; status: → statuses and all; due: wait: until: due.before: due.after: → date keywords; recur: → the named periods (daily weekly biweekly monthly quarterly yearly annual weekdays; since 0.4); after add/modify → mods attributes (project: pri: due: wait: depends: recur: until:; nothing after depends:); after help → commands and topics; config → its subcommands, then keys (get set unset), then values for set (languages, booleans, default_command); alias → install remove; completion → shells; after --, import, annotate, denotate → nothing (the shell falls back to file names).
Hidden easter eggs exist: English only, exempt from i18n (but the kind words they show are translated, since 0.3.6), kept unreadable in the code (hashed triggers, ROT13/compressed replies); see tests/cli/test_eggs.py. Since 0.3.5 they use the output frame and their own fixed colors (egg.* roles, 16 ANSI colors, never changed by themes; off with color = false or NO_COLOR, plain in files and pipes).
6. Dates & urgency¶
Date keywords EN only, any UI language. Date without time → 00:00 local.
| Form | Examples |
|---|---|
| ISO | 2026-12-15, 2026-12-15T14:00 |
| Day | today tomorrow yesterday |
| Weekday | monday..sunday, mon..sun → next occurrence, never today |
| Period end | eow eom eoy → 23:59:59 local of last day (week ends Sunday) |
| Offset | +3d +2w +1m +4h -1d (from now; m = calendar month, day clamped) |
ISO with offset/Z and TW 20261215T140000Z kept as is. Keywords case-insensitive. due.before:/due.after: are strict; tasks without due never match. Overdue (red) / due today (yellow) = local calendar day of due vs today.
Urgency U = sum, coeffs in config, shown 1 decimal:
- pri: H 6.0, M 3.9, L 1.8
- due: 12 × f; f linear from 0.2 (due ≥14 d ahead) to 1.0 (overdue ≥7 d)
- age: 2 × min(age_days/365, 1)
- tags: 1.0 if any; project: 1.0 if set
- blocked: −5.0 if pending and depends on a pending task; blocking: 8.0 if pending and a pending task depends on it (since 0.4)
- active: 4.0 if pending and started (since 0.4)
7. i18n, config, TW compat¶
i18n: all UI text via t(key, **kw); files src/tame/locales/<lang>.toml; en.toml = reference; missing key → EN fallback. Cmds, attrs, date keywords never translated. Test: every t() key in code exists in en.toml.
Config config.toml in the config dir (§2), created on first run with commented defaults; missing keys = default:
language = "en"
confirm_threshold = 3
date_format = "%Y-%m-%d"
color = true
kindness = true
default_command = "list" # list | next: what `tk` alone, or `tk <filter>`, runs
next_limit = 10 # tasks shown by `next`, 1 or more
multiple_active = false # since 0.4: true lets several tasks be started at once
completion = false # Tab completion in the shell profile (see below)
[undo]
retention = "3m" # forever | <n>d/w/m/y (m = 30 d, y = 365 d)
[urgency]
pri_H = 6.0
pri_M = 3.9
pri_L = 1.8
due = 12.0
age = 2.0
tags = 1.0
project = 1.0
blocked = -5.0 # since 0.4
blocking = 8.0 # since 0.4
active = 4.0 # since 0.4
NO_COLOR (environment, non-empty, since 0.3.4) turns colors off like color = false, whatever the file says; layout stays (§5 Output style).
Unknown key, wrong type or invalid value → usage error naming key and file (exit 1); every cmd but config stops. Each write cmd purges undo_log rows older than undo.retention.
tk config: no args = list (key = value, non-defaults marked); get KEY; set KEY VALUE (validated; keeps comments, via tomlkit); unset KEY (writes the default); path; edit ($VISUAL/$EDITOR, else Notepad / vi; file validated after). Keys dotted: urgency.pri_H. Bools: true/false/yes/no/on/off/1/0.
TW JSON
- Export: JSON array, TW field names, dates
YYYYMMDDTHHMMSSZ,extrakeys merged back. - Import: JSON array or one object per line. Same uuid → update if incoming
modifiednewer, else skip. Missinguuid→ new one;entry→ now;modified→entry;status→ pending.id,urgencyignored. New pending tasks get the next ids (by entry); if an update changes which tasks are pending, all are renumbered. annotations: array of{entry, description}, both required,entrya TW date → stored natively. Export: array sorted by entry; omitted when empty.depends: array of uuids, or a comma-separated string (TW < 2.6) → stored natively; duplicates and the task's own uuid dropped. Export: array of uuids, sorted; omitted when empty.- Invalid
annotations/dependsvalue (wrong type, missing field, bad date or uuid) → whole key kept inextraunchanged. wait,start,until(TW dates) andrecur(string) → stored natively; exported when set. Invalid value → kept inextraunchanged.- Sessions (since 0.4) ↔ TW
journal.timeannotations: export writes each session as two annotations,Started taskat its start andStopped taskat its end, merged with the notes by entry; import turns eachStarted taskfollowed by aStopped taskback into a session and drops both notes; a lone journal note stays a note, but for a lastStarted taskat the task'sstart(the current session), which is dropped. Round-trip without duplicates. - Recurring series (since 0.4), converted since TAME has no template task: a task with status
recurring(TW template) is not stored; itsrecur,untiland anchor (from itsdue) go to the nearest pending task (earliestdue) whoseparentis its uuid, in the file or the database; if there is none, a new pending task is made from the template, due on its first occurrence after now (§4 Recurrence; a period TAME does not understand: the template's owndue). The other pending tasks of the series loserecur/untiland become plain tasks; completed and deleted ones are stored as they come.parent,mask,imaskstay inextra. After the summary, a lineRecurring series converted from Taskwarrior templates: N.(when N > 0). Templates imported before 0.4 are left as they are (no migration). - Other unsupported TW attrs (UDAs…), and a
priorityother than H/M/L → stored inextra, re-exported unchanged (TAME fields win). - TW status
waiting→pending+wait(TW 3 style; exported aspending); without a validwait:pending, original inextra.tw_status, exported back while the task is still pending (statusrecurringdid the same before 0.4; now see Recurring series above).
8. Layout, quality, release¶
Layers: cli → core.service → storage. Only cli.render imports rich. core returns objects / raises typed errors (TameError subclasses), never prints.
src/tame/
__main__.py # main(): parse → dispatch → exit code
cli/parser.py # tokens → (filter, cmd, args)
cli/commands.py # 1 func per cmd
cli/render.py # rich output
cli/printout.py # tk print: HTML page
core/models.py # Task dataclass
core/filters.py # Filter (syntax-free)
core/dates.py # relative date parser
core/urgency.py
cli/eggs.py # hidden extras (§5)
cli/completion.py # shell completion scripts and candidates (§5)
core/service.py # TaskService: add/modify/complete/delete/query/undo/import
storage/repo.py # SQLite repo
storage/migrations.py
storage/codec.py # datetime <-> DB text
io/tw_json.py # Taskwarrior JSON (§7)
alias.py # opt-in command aliases
i18n.py config.py errors.py
locales/en.toml fr.toml
tests/ # mirrors src; tmp TAME_HOME fixture
scripts/ # tk.ps1/tk.sh sandbox, smoke.py, release_notes.py, spoilers.py
docs/ # SPEC, grammar, commands + site pages (mkdocs.yml); install.ps1/.sh; assets/ (logo: light, dark, site header, favicon SVG; social-preview.png)
.github/workflows/ # ci.yml, docs.yml (Pages), release.yml (PyPI + GitHub release)
Code docs: Google-style docstrings on public modules/classes/funcs; parser rules commented with rule numbers from §4.
Tests: every example in this spec = a test. Focus: parser, dates (frozen clock), urgency, TW round-trip.
Release rule (blocking, every release):
- [ ] Documentation matches current behavior everywhere: README (incl. badges render), docs site pages (
docs/*.md,mkdocs build --strict), SPEC,tk help+ tour in every locale (en.toml,fr.toml), CONTRIBUTING, GitHub About description - [ ] Docstrings up to date on changed code
- [ ] CHANGELOG updated
- [ ]
en.tomlcomplete; i18n key test green - [ ] CI and Docs workflows green (ruff, mypy, pytest, both OS; site built and deployed)
- [ ] Install from GitHub checked (
uv tool install git+…) on a clean tool dir - [ ] Version bumped (SemVer) and CHANGELOG
## [X.Y.Z]section; tagvX.Y.Zpushed →release.ymlpublishes to PyPI (approve it) and creates the GitHub release
Roadmap V1 (1 PR each):
- Repo skeleton, uv, CI,
tame version - Model + SQLite repo + minimal add/list
- Hybrid parser + filters
- done/delete/modify/info
- Dates + urgency
- undo
- Config (7a:
config.toml,configcmd, undo purge; 7b:help; 7c: i18n FR) - TW import/export +
alias(8a:export/import,status:all; 8b:alias) - Extras before release (9a: README; 9b: onboarding; 9c: easter eggs; 9d: badges + coverage gate; 9e: docs site +
docs/commands.md) - Release (10a: install polish, installers, CI install check; 10b: PyPI name + release workflow; 10c: docs pass → v0.1.0)
Roadmap 0.2.0: license/credits help topics; print; kind words; GitHub Actions on Node.js 24.
Roadmap 0.3.0 (1 PR each): schema v2; virtual tags; next; annotate/denotate; wait: + schema 3; shell completion. 0.3.1: completion setting. 0.3.2: tk help settings, tk help config KEY; logo. 0.3.3: completion in both PowerShells and Git Bash. 0.3.4: output style, NO_COLOR, tk help security. 0.3.5: easter eggs in color. 0.3.6: kind words in pools; purge. Next: docs/ROADMAP.md.