Metadata-Version: 2.5
Name: farora
Version: 0.8.0
Summary: A local-first, plain-text task tracker with a Textual TUI.
Project-URL: Homepage, https://farora.tools
Author-email: Dmytro Shandyba <hi@farora.tools>
License-Expression: LicenseRef-Farora-1.0
License-File: LICENSE
Keywords: cli,local-first,markdown,plain-text,task-tracker,textual,todo,tui
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Utilities
Requires-Python: >=3.14
Requires-Dist: fractional-indexing<0.2,>=0.1.3
Requires-Dist: pydantic<3,>=2.13
Requires-Dist: rich>=14.2
Requires-Dist: textual<9,>=8.2
Requires-Dist: tomli-w>=1.1
Requires-Dist: watchfiles<2,>=1.2
Description-Content-Type: text/markdown

# Farora

A local-first, plain-text task tracker with a Textual TUI.

Tasks live as Markdown files with YAML frontmatter in a plain folder, so they
sync over any file-sync engine, diff cleanly in git, and stay readable without
Farora.

## Install

Use a recent [uv](https://docs.astral.sh/uv/) — it provisions Python 3.14 for you:

```sh
uv self update             # or: brew upgrade uv
```

```sh
uvx farora                 # run without installing
uv tool install farora     # install persistently
```

<details>
<summary>If you see "requirements are unsatisfiable"</summary>

Older uv releases pick whatever interpreter they find first and give up when it
is below 3.14:

```
Because the current Python version (3.12.9) does not satisfy Python>=3.14 and
farora==0.5.0 depends on Python>=3.14, we can conclude that farora==0.5.0
cannot be used.
```

Updating uv is the fix. If you cannot update it, name the interpreter explicitly:

```sh
uvx --python 3.14 farora
uv tool install --python 3.14 farora
```

</details>

## Supported configuration

Farora is developed and tested on **macOS with Python 3.14+**. `uv` provisions
the interpreter for you.

These tools are optional — each unlocks a feature, and Farora degrades cleanly
without it:

| Tool | Unlocks |
|---|---|
| [helix](https://helix-editor.com/) | `e` opens the task body in helix (otherwise `$EDITOR`, then `vi`) |
| [mdcat](https://github.com/swsnr/mdcat) ≥ 2.11 | `v` / `V` live markdown render with inline images |
| [WezTerm](https://wezterm.org/) | `v` renders side by side in a split pane |
| git ≥ 2.30 | Sync a task repo across machines |

Linux and Windows are not supported in this release.

## Commands

| Command | Purpose |
|---|---|
| `farora` | launch the TUI |
| `farora doctor` | validate and reconcile a repo |
| `farora gc [--older-than DURATION]` | purge expired tombstones now |
| `farora task …` | create, read, change, move, copy, delete and restore tasks |
| `farora project …`, `farora status …`, `farora repo info` | create, read and rename projects, and add, change, rename, remove and reorder their statuses |
| `farora op [JSON]` | run operations given as JSON |
| `farora events [--follow]` | print what changed, as JSON Lines |
| `farora schema` | print the JSON Schema of the scripting interface |
| `farora skill install` | teach Claude Code, in the current folder, to use Farora |

Every command that works on a repo accepts `--repo PATH`, before or after the command's
words, defaulting to `$FARORA_REPO`, else `~/.farora`. `farora COMMAND --help` describes
each one. The commands from `farora task` down are covered under Scripting Farora, below.

## Scripting Farora

Everything the TUI does to tasks and projects, a script can do from the command line: one
command per operation, with JSON in and JSON out. There is no server and no port. It is
safe while the TUI is open, and the TUI shows each change as it lands.

### One command per operation

```sh
farora task list FAR                          # a tree: id, status, doby, title
farora task create FAR "Write the docs" --parent FAR-1
farora task status FAR-2 ACTIVE
farora task doby FAR-2 2026-11-30             # or: farora task doby FAR-2 --clear
farora task note FAR-2 "Asked about the API key."
farora task write-body FAR-2 < body.md        # replaces the body with stdin
farora task move FAR-2 --root --first
farora task delete FAR-2                      # farora task restore FAR-2 brings it back
farora status rename FAR NEW TODO             # moves every task on NEW
farora status remove FAR WAITING --replacement ACTIVE
```

`farora task --help` lists every task command. `farora project`, `farora status` and
`farora repo info` cover the rest. `farora project get FAR` shows a project's statuses.

Add `--json` to any of them to get one JSON envelope on stdout instead of text:

```json
{"ok": true, "kind": "task.create", "op_id": "019f…", "result": {"id": "FAR-2", "title": "Write the docs", "status": "NEW", …}}
{"ok": false, "kind": "task.set_status", "op_id": "019f…", "error": {"code": "E_INVALID_STATUS", "message": "'WAITING' is not a status of FAR: NEW, ACTIVE, DONE", "details": {…}}}
```

The exit code is `0` when the command ran, `1` when it failed (the envelope says why), and
`2` when the command line itself was wrong. Put flags after the command's words:
`farora task list --repo PATH --json`.

### Operations as JSON: `farora op`

Each command runs one *operation*. `farora op` takes the operation itself, as one JSON
object, or as JSON Lines on stdin with one operation per line. It prints one envelope per
operation:

```sh
farora op '{"kind": "task.rename", "id": "FAR-2", "title": "Write the README"}'
farora op < operations.jsonl                  # stops at the first failure
farora op --keep-going < operations.jsonl     # runs every line
```

Each operation stands alone. There are no transactions, so a failure part-way leaves the
earlier operations applied. Input that is not JSON, or not a valid operation, fails with
`E_INVALID_INPUT`. `farora schema` prints the JSON Schema of every operation, result,
envelope, error code and event line, and of a task file's frontmatter.

### Writing safely

- **Retries are safe.** Give a write an `op_id` (`--op-id` on a command), a UUIDv7 such
  as `python3 -c 'import uuid; print(uuid.uuid7())'` prints. If a write with that id has
  already landed, it is not applied again: the envelope says `"replayed": true` and holds
  the task as it is now.
- **Don't overwrite a change you haven't seen.** Pass the `updated_at` you read as
  `if_updated_at` (`--if-updated-at`). If the task changed since, the write fails with
  `E_STALE`: read it again and decide again.
- **Beside the TUI.** Writes take turns through a short write lock. A write waits up to
  5 seconds (`--wait SECONDS`) for another Farora process to finish writing, then fails
  with `E_REPO_LOCKED`, and is worth retrying. A second TUI, `farora doctor` and
  `farora gc` are still refused while a TUI is open.
- **Reads take no lock.** A read that spans many tasks while something writes can see
  some of the changes and not others.
- **Git.** These commands never run git. With git tracking on and the TUI open, the TUI
  commits their changes about two seconds after they land. Otherwise the next TUI start
  commits them.

### Following changes: `farora events`

`farora events` prints every change recorded in the repo, oldest first, one JSON object
per line:

```json
{"op_id": "019f…", "ts": "2026-10-25T09:14:03.120Z", "actor": "mbp-a1b2", "op": "task.rename", "project": "FAR", "task_id": "FAR-2", "payload": {"field": "title", "old": "Write the docs", "new": "Write the README"}}
```

`--project SLUG`, `--task ID` and `--since TIMESTAMP` (inclusive) narrow it. `--follow`
keeps running and prints each change as it lands, including the TUI's own; it stops on
Ctrl-C.

Delivery is at least once: the same line can be printed twice, so treat lines with the
same `op_id` and the same content as one. A change merged in from another machine can
carry an earlier `ts` than lines you have already seen. A consumer that must see every
change should re-read the history and drop what it has seen, rather than resume with
`--since`.

### Claude Code

```sh
cd ~/code/my-project
farora skill install                          # writes .claude/skills/farora/
farora skill install --project FAR            # ... and says this folder's tasks are in FAR
```

Claude Code working in that folder then knows how to use Farora. It loads the skill when
you talk about tasks, a backlog or what to do next, or name a task such as `FAR-42`. The
skill pre-approves Farora's read-only commands for the turn it is used in, so listing and
reading tasks run without a prompt. Every write asks for permission as usual. The
installer writes the skill's two files and nothing else: no settings and no permissions.

Run it again after upgrading Farora to update the skill. It never overwrites a skill you
edited, or one Farora did not write, unless you pass `--force`. `--check` says whether the
skill is current and writes nothing. `--repo PATH` records which repo Claude should use;
an absolute path makes the skill specific to this machine.

### What tools may read and write directly

The files are plain text. Some of them are a stable interface; the rest are Farora's own.

- **Stable, to read.** The layout: `farora.toml`, `projects/<SLUG>/project.toml` with its
  status table, and `projects/<SLUG>/tasks/<SLUG>-<n>.md`. A task file's YAML
  frontmatter (`task_frontmatter` in `farora schema`) and its Markdown body. The
  `SLUG-n` id format.
- **Safe to edit in place.** A task's body, and the `title`, `status` and `doby` in an
  existing task's frontmatter. A running TUI notices the edit and records it in the
  task's log. An edit made while no TUI runs is kept, and `farora doctor` records it the
  next time you run it. Doctor skips a body edit when the log does not say what the body
  was before it, which only happens for a body last changed by an older Farora.
- **Internal.** The journals (read them with `farora events` or `farora task log`), the
  counters, the lock files, the format of rank keys, temporary files and conflict copies.
  Create, delete, move, copy and transfer tasks only with the commands, which take care of
  ids, the journal and ordering.

### Compatibility

The scripting interface is the commands and their flags, plus everything `farora schema`
describes.

- Adding operations, optional fields, error codes or event types is not a breaking change,
  so a reader should ignore keys it does not know.
- Removing or renaming any of them, or changing what a field means, is a breaking change.
  Breaking changes are listed under their own heading in the release notes.
- From 1.0 on, breaking changes happen only in a major version.

## Deleted tasks are kept before they are gone

Deleting a task removes its `tasks/FAR-42.md`, but its journal stays behind as a
**tombstone** holding a full snapshot of the task — frontmatter *and* body text. That
is what `u` undoes a delete from, and what `farora task restore FAR-42` rebuilds it
from.

**So a deleted task's text is still readable in the repo, in
`projects/FAR/journal/FAR-42.jsonl`, until garbage collection removes it.** If a task
held something sensitive, deleting it is not the same as shredding it — anything
syncing or backing up the folder has the snapshot too.

Garbage collection runs **opportunistically**: every ordinary `farora` run sweeps the
repo it opens, so there is no daemon and nothing to schedule. Tombstones older than the
retention window are purged; everything else — every live task, and every tombstone
still inside the window — is left alone.

```sh
farora gc                      # purge now, using the configured window
farora gc --older-than 0s      # purge every tombstone, right now
farora gc --older-than 7d      # ... or everything deleted over a week ago
```

Configure it in `~/.config/farora/config.toml`:

```toml
[gc]
enabled   = true    # false: never sweep on ordinary runs (`farora gc` still works)
retention = "30d"   # how long a deleted task's snapshot is kept: s | m | h | d | w
```

Both keys are optional and the values above are the defaults. Purging is permanent:
once a tombstone is collected, undo and restore have nothing to work from, and the task
number is never reused.

## License

Proprietary. See LICENSE.

**Free to use for any purpose, including commercially** — by individuals and by
companies, at no charge and without asking. Redistribution and modification are not
permitted.

To license Farora on other terms, contact <hi@farora.tools>.
