tasks

module
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: MIT

README

tasks logo

tasks

A local-first GTD system built for human and AI co-working.

Tasks stores one inspectable JSON record per line and exposes the same domain behavior through a scriptable CLI, a Bubble Tea TUI, and a loopback HTTP API. All writes use checked atomic replacement and a shared content-addressed undo/redo journal.

tasks TUI Dashboard

Install

Homebrew is the supported macOS installation path:

brew install marcus/tap/tasks
tasks --version

The formula installs tasks, tasks-tui, and tasks-api. Release archives for Darwin and Linux on arm64 and amd64 are available from GitHub.

To build from source, install the Go version named by go.mod, then run:

make build
make install PREFIX="$HOME/.local"

For rapid development on this Mac, the repository can switch the commands in Homebrew's bin directory between a local build and the installed formula. The formula remains installed in its Cellar, so switching back does not rebuild or download anything:

make install-local       # canonical main checkout only: build and activate
make install-status      # show source, path, version, and commit
make use-homebrew        # reactivate the released formula

From a Git worktree or non-main branch, activation must be deliberate:

make install-worktree

All three commands (tasks, tasks-tui, and tasks-api) switch together. Local builds are retained under ~/.local/state/tasks/dev-installs; the active links live in the Homebrew prefix as the stable machine selector; task-specific interactive shell aliases point there too, without reordering the rest of PATH. Each local --version includes its branch, commit, and -dirty when built from uncommitted changes.

Configure task data

Task data belongs outside this source repository. Create a directory containing tasks.jsonl, then configure it explicitly:

mkdir -p ~/tasks ~/.config/tasks
cp examples/tasks.jsonl ~/tasks/tasks.jsonl
printf 'dir = %s\n' "$HOME/tasks" > ~/.config/tasks/config
tasks config
tasks check --all-files

Resolution precedence is:

  1. TASKS_FILE, TASKS_ARCHIVE, and TASKS_MEMORY;
  2. TASKS_DIR;
  3. ~/.config/tasks/config (dir, file, archive, and memory).

Without an explicit task-data location, Tasks refuses to read or write and prints setup instructions. It never falls back to the current directory or an installation directory. A per-file setup must provide both the live and archive paths; use TASKS_DIR or dir when they share a directory.

Use

tasks agenda
tasks next
tasks inbox
tasks list --agent-ready --json
tasks capture "Book the hotel" --due "next friday"
tasks done "Book the hotel"
tasks undo
tasks help
tasks help --json

Every owned capability has a deterministic CLI or API path. Human CLI output is paired with structured JSON for scripting; tasks help --json is the command registry and structured-output contract.

Run tasks-tui for the full-screen keyboard and mouse interface. Run tasks-api for the loopback-only API rooted at http://127.0.0.1:4747/api/v1; the contract is docs/api/openapi.yaml.

tasks -p "..." sends a natural-language list-management request through the configured agent adapter. The list-agent contract is embedded in installed binaries from internal/agentcontext/TASK_AGENT.md, so this surface does not depend on a source checkout.

Multi-device Git sync

Task files can live in a private Git repository. Add:

tasks.jsonl merge=tasksjsonl
archive.jsonl merge=tasksjsonl

Then install the record-aware merge driver:

tasks install-merge-driver ~/tasks

See docs/multi-device-sync.md for merge semantics and recovery guidance.

Architecture

  • internal/store owns persistence, atomic writes, validation, and history.
  • internal/application is the shared command/query boundary.
  • cmd/tasks, cmd/tasks-tui, and cmd/tasks-api are thin adapters.
  • internal/config is the single configuration resolver.
  • internal/llm contains provider-agnostic agent adapters.
  • testdata/fixtures contains sanitized regression stores; tests never use real task data.

Schema-v2 is documented in docs/conventions.md. CLI behavior is specified in docs/cli-spec.md, and design rationale lives under docs/adr.

Develop

make test
make test-race
make vet
make fmt-check
make build

After changing code in the canonical main checkout, run make install-local so normal shell and automation consumers exercise the new build. In a worktree, use make install-worktree only when that branch should become machine-wide. Use make install-status before debugging an apparent version mismatch.

All code changes require independent review. Changes affecting the HTTP surface must keep the CLI/application/API contracts aligned and update OpenAPI where the wire contract changes.

The retired Ruby implementation and its differential migration harness are preserved by annotated tag ruby-final-2026-08-04; see docs/plans/implemented/ruby-to-go-migration.md.

License

MIT. See LICENSE.

Directories

Path Synopsis
cmd
tasks command
Command tasks is the scriptable CLI over the Tasks JSONL store.
Command tasks is the scriptable CLI over the Tasks JSONL store.
tasks-api command
Command tasks-api provides the loopback HTTP surface over one task store.
Command tasks-api provides the loopback HTTP surface over one task store.
tasks-tui command
Command tasks-tui is the interactive terminal surface over tasks.jsonl.
Command tasks-tui is the interactive terminal surface over tasks.jsonl.
internal
agentcontext
Package agentcontext assembles the system-context string handed to any agent.
Package agentcontext assembles the system-context string handed to any agent.
agentdiff
Package agentdiff builds the post-run "what did the agent change?" git diff for `tasks -p`.
Package agentdiff builds the post-run "what did the agent change?" git diff for `tasks -p`.
api
Package api is the Go port of lib/tasks/api — the loopback HTTP surface described by docs/api/openapi.yaml.
Package api is the Go port of lib/tasks/api — the loopback HTTP surface described by docs/api/openapi.yaml.
application
Package application is the persistence-neutral facade shared by the CLI, the TUI, and the HTTP API — the Go counterpart of lib/tasks/application.rb and the operation objects it composes.
Package application is the persistence-neutral facade shared by the CLI, the TUI, and the HTTP API — the Go counterpart of lib/tasks/application.rb and the operation objects it composes.
atomic
Package atomic is durable, all-or-nothing file replacement — the Go counterpart of lib/tasks/atomic.rb, and the only writer the store uses.
Package atomic is durable, all-or-nothing file replacement — the Go counterpart of lib/tasks/atomic.rb, and the only writer the store uses.
check
Package check validates the store-wide metadata and ID invariants.
Package check validates the store-wide metadata and ID invariants.
config
Package config resolves where the task files live and which settings the process runs under.
Package config resolves where the task files live and which settings the process runs under.
determinism
Package determinism turns harness pins into the injectable values the read path already accepts.
Package determinism turns harness pins into the injectable values the read path already accepts.
journal
Package journal carries the two path facts every surface needs about the undo journal: the canonical identity of a store file, and the directory a store's history lives in.
Package journal carries the two path facts every surface needs about the undo journal: the canonical identity of a store file, and the directory a store's history lives in.
jsonout
Package jsonout writes JSON documents the way Ruby's JSON.generate writes them: members in the order the caller states, no whitespace, and Ruby's escape set for strings.
Package jsonout writes JSON documents the way Ruby's JSON.generate writes them: members in the order the caller states, no whitespace, and Ruby's escape set for strings.
lead
Package lead is the read-path half of lib/tasks/lead.rb: how long before its occurrence date a task becomes visible.
Package lead is the read-path half of lib/tasks/lead.rb: how long before its occurrence date a task becomes visible.
links
Package links models formal task links and finds and classifies links in task text.
Package links models formal task links and finds and classifies links in task text.
llm
Package llm is the agent adapter layer: one execution contract, a config-assembled registry, and the built-in harnesses.
Package llm is the agent adapter layer: one execution contract, a config-assembled registry, and the built-in harnesses.
merge
Package merge is the deterministic, record-aware three-way merge for tasks JSONL files — the Go port of lib/tasks/jsonl_merge.rb.
Package merge is the deterministic, record-aware three-way merge for tasks JSONL files — the Go port of lib/tasks/jsonl_merge.rb.
promptfacts
Package promptfacts is the registry of short, labeled facts injected into an agent's system prompt under a "Current environment" heading.
Package promptfacts is the registry of short, labeled facts injected into an agent's system prompt under a "Current environment" heading.
query
Package query contains the shared read-query inputs and operations.
Package query contains the shared read-query inputs and operations.
record
Package record reads the JSONL record format used by tasks.
Package record reads the JSONL record format used by tasks.
recur
Package recur parses and projects interval repeater cookies.
Package recur parses and projects interval repeater cookies.
store
Package store owns the READ path over tasks.jsonl and archive.jsonl: the coherent snapshot, the API-grade checked read, and the revision tokens derived from the exact bytes that read captured.
Package store owns the READ path over tasks.jsonl and archive.jsonl: the coherent snapshot, the API-grade checked read, and the revision tokens derived from the exact bytes that read captured.
taskquery
Package taskquery is the read model over a store snapshot: the structural tree, effective availability, and the selections the read surfaces render.
Package taskquery is the read model over a store snapshot: the structural tree, effective availability, and the selections the read surfaces render.
temporal
Package temporal is the Go counterpart of lib/tasks/temporal_value.rb and lib/tasks/temporal_context.rb: a stored date with an optional wall time and zone, and the reader's own "now" that such a value is resolved against.
Package temporal is the Go counterpart of lib/tasks/temporal_value.rb and lib/tasks/temporal_context.rb: a stored date with an optional wall time and zone, and the reader's own "now" that such a value is resolved against.
timezones
Package timezones resolves IANA zone identifiers, mirroring lib/tasks/timezones.rb as far as the read path and the probe need it: the identifier gate, the detection precedence, and the tzdb self-report.
Package timezones resolves IANA zone identifiers, mirroring lib/tasks/timezones.rb as far as the read path and the probe need it: the identifier gate, the detection precedence, and the tzdb self-report.
tui
Package tui is the Go TUI's shell: the Bubble Tea root model, the screen geometry, view switching, the task list and its selection, and the right panel that shows task and project details.
Package tui is the Go TUI's shell: the Bubble Tea root model, the screen geometry, view switching, the task list and its selection, and the right panel that shows task and project details.
tui/term
Package term is the seam between the TUI shell and the terminal primitives under term/.
Package term is the seam between the TUI shell and the terminal primitives under term/.
tui/term/agent
Package agent is the serial coordinator for autonomous TUI agent requests and the presentation of their transcripts.
Package agent is the serial coordinator for autonomous TUI agent requests and the presentation of their transcripts.
tui/term/ansi
Package ansi holds the SGR-aware, width-aware string helpers.
Package ansi holds the SGR-aware, width-aware string helpers.
tui/term/border
Package border is the single owner of box-drawing chrome: rounded corners plus an angled truecolor gradient swept across a container's border cells.
Package border is the single owner of box-drawing chrome: rounded corners plus an angled truecolor gradient swept across a container's border cells.
tui/term/charwidth
Package charwidth answers the terminal display width of Unicode codepoints and grapheme clusters.
Package charwidth answers the terminal display width of Unicode codepoints and grapheme clusters.
tui/term/clipboard
Package clipboard writes to the system clipboard via whatever tool the platform has, with no third-party dependency.
Package clipboard writes to the system clipboard via whatever tool the platform has, with no third-party dependency.
tui/term/frame
Package frame is a pure frame builder: given content, it returns one string per terminal row, each exactly `width` visible cells wide.
Package frame is a pure frame builder: given content, it returns one string per terminal row, each exactly `width` visible cells wide.
tui/term/hitmap
Package hitmap is pure geometry: it maps a screen (row, col) to a Hit zone using the rectangles a layout publishes.
Package hitmap is pure geometry: it maps a screen (row, col) to a Hit zone using the rectangles a layout publishes.
tui/term/input
Package input holds the terminal input primitives: the raw key sequences the TUI recognizes, a raw-bytes-to-semantic-event key map, and the grapheme-aware single-line/multi-line text editor used by the prompt and by form fields.
Package input holds the terminal input primitives: the raw key sequences the TUI recognizes, a raw-bytes-to-semantic-event key map, and the grapheme-aware single-line/multi-line text editor used by the prompt and by form fields.
tui/term/layout
Package layout is pure geometry for one sampled terminal frame.
Package layout is pure geometry for one sampled terminal frame.
tui/term/mouse
Package mouse is a pure SGR mouse-report decoder plus the (mode, zone, button, action) → intent table.
Package mouse is a pure SGR mouse-report decoder plus the (mode, zone, button, action) → intent table.
tui/term/shortcuts
Package shortcuts is the declarative registry for every keyboard action shown in help.
Package shortcuts is the declarative registry for every keyboard action shown in help.
tui/term/theme
Package theme is the semantic color layer.
Package theme is the semantic color layer.
tui/termform
Package termform is the persistence-neutral form engine the TUI's editor and popups are built from — the Go port of Ruby's lib/term_form/.
Package termform is the persistence-neutral form engine the TUI's editor and popups are built from — the Go port of Ruby's lib/term_form/.
updatestamp
Package updatestamp is the per-record last-write stamp: one sortable token that keeps the timestamp and the device tiebreaker from ever drifting apart.
Package updatestamp is the per-record last-write stamp: one sortable token that keeps the timestamp and the device tiebreaker from ever drifting apart.
pkg
tui
Package tui exposes the Tasks terminal UI as an embeddable Bubble Tea v2 component.
Package tui exposes the Tasks terminal UI as an embeddable Bubble Tea v2 component.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL