A small ticket tracker that lives in your repository. Every ticket is a
markdown file in .tickets/, so you can read it, grep it, diff it and commit
it like any other file. There is no database to keep in sync and no service
running in the background.
tk is one Python file with no dependencies beyond the standard library. It
works well for a single developer, for a small team, and for coding agents
that need to pick up where the last session stopped.
You need Python 3.10 or newer.
git clone https://github.com/sjaandi-project/python-ticket.git cd python-ticket make install # links ticket.py as ~/.local/bin/tk
make install PREFIX=/usr/local installs somewhere else, make uninstall
removes the link again.
tk create "Fix the login timeout" -t bug -p 1 \ -d "Sessions expire after five minutes instead of thirty." tk ready # what can be worked on now tk start web-3k9f # partial IDs work: tk start 3k9f tk add-note 3k9f "Cause found: the cookie max-age is set in seconds." tk close 3k9f
Ticket IDs start with a short prefix taken from the directory name. If you
want a different one, write it into .tickets/prefix.
Tickets can wait on other tickets, and tk keeps track of what is unblocked.
tk dep web-a1 web-b2 # a1 waits for b2 tk blocked # open tickets that still wait on something tk dep tree web-a1 # the dependency tree below a1 tk dep cycle # find circular dependencies
Epics group work with --parent, and tk tree shows the hierarchy with a
marker for every ticket type except plain tasks. tk link connects two tickets that are related
without one waiting for the other.
| Command | What it does |
|---|---|
create "title" |
New ticket: type, priority (0 is highest, 0-4 by convention), assignee, tags, parent, description, optional --repo owner/name |
start, close, reopen, status |
Change a ticket's state |
ready / list, blocked, closed |
Lists, filterable by assignee (-a) and tag (-T) |
recent |
The last tickets that changed, --limit N |
show, tree |
One ticket in full, or the parent-child hierarchy |
dep, undep, link, unlink |
Dependencies and links |
add-note |
Append a timestamped note |
edit |
Change fields of an existing ticket |
super <cmd> |
Run the built-in command even when a plugin has the same name |
tk <command> --help lists the options of a built-in command.
Any executable named tk-<cmd> or ticket-<cmd> on your PATH becomes a
tk command. The plugins/ folder has a few to start from, such as
tk open to edit a ticket in your $EDITOR and tk ls for a filtered list.
Its README explains how to write your own. A plugin with the name of a
built-in command takes its place, and tk super <cmd> reaches the built-in.
tk started as a fork of ticket by Greg
Wedow, a single bash script. This version is a full rewrite in Python.
Compared with the upstream script it adds the tree and recent commands,
a configurable ID prefix, and clearer messages when a partial ID matches more
than one ticket. tk edit now changes fields of a ticket; upstream's command
of that name, which opens the file in your editor, lives on as the open
plugin. The earlier bash version this rewrite replaced
is still in the repository as ticket, for reference.
MIT, as the original. See LICENSE and THIRD_PARTY_LICENSES.txt.
ticket has been written with the help of tooled assistance, but has been designed, reviewed and thoroughly tested and signed off by its developer.