Development
Development
This page is for people who change MK. For installing and using it, see Getting started.
Build and run
Run the whole package from the repository root:
go run . -dir /tmp/mk-smokego run . tui -dir /tmp/mk-smokego build -o mk .go run . takes the same flags as the binary. See the command line reference.
Without -dir, MK uses docs/. This repository stores its own documentation
in docs/, so use a scratch task folder while you develop. Otherwise MK will
show these pages as cards.
There is no frontend build step. main.go
embeds the page and its script at compile time. Restart go run . after you
edit either file. Only task files
and .kanban.yml are watched live.
main.go declares the version, commit, and date variables that GoReleaser
sets with -ldflags. The GoReleaser config
builds the package from ., which includes serve.go and tui.go.
Automated checks
go test ./...go vet ./...The test files cover these areas:
internal/board/*_test.go: parsing, config, writes, batches, guarded restores, snapshots, watching, ordering, filters, and dependencies.main_test.go: the HTTP handlers and SSE, including error mapping and the CONFLICT and OTHER write guards.tui_test.go: TUI flag errors, and that-versiondoes not open a store.internal/tui/*_test.go: layout, navigation, reloads, dependencies, preferences, terminal sizes, card actions, undo, the keymap help and command palette, the scrollable filter panel and chip find, and a check that keys which don’t write never modify task files.
Run the search and mouse checks alone with:
go test -count=1 ./internal/tui -run 'Test(Search|Mouse|NoMouse|HelpBinding)'Run the store filter checks alone with:
go test -count=1 ./internal/board -run TestFilterRun the TUI filter-panel checks alone with:
go test -count=1 ./internal/tui -run TestFilterBoard and table snapshots live in internal/tui/testdata/. After an intentional
rendering change, regenerate them and review the diff:
UPDATE_GOLDEN=1 go test ./internal/tui -run TestSampleScreensRun go test -race ./... when you change the store or the TUI’s
concurrency.
The JavaScript tests exercise Markdown, filters, modal saves and reloads, and drag request construction using Node’s built-in test runner.
node --test board.test.cjsCI runs them on Linux. For browser rendering and native drag interactions, use the smoke test below.
Manual smoke testing
test-work-items/
is the committed sample board and QA fixture set. Don’t run MK against it
directly. Dragging, tagging, TUI card actions, undo, and saving all rewrite
files. Copy it to a new scratch folder first:
cp -r test-work-items /tmp/mk-smokego run . -dir /tmp/mk-smokePick a path that does not exist yet. If the folder already exists, the copy nests the fixtures inside it instead of replacing them. To start over, delete the scratch copy and copy the fixtures again.
Follow the smoke-test plan
on the scratch board. The plan is also a card there, in the QA epic.
For the terminal board, follow the checklist in Implementation and smoke testing.
Change test-work-items/ only to add or change a QA scenario on purpose.
Repository layout
main.go: the CLI entry point, the embedded frontend, and the build version variables.serve.go: the web flags, the HTTP handlers, and the SSE clients. Each server owns its store and its clients.tui.goandinternal/tui/: the terminal flags and the terminal board.internal/board/: the shared task store, file writes, config, watching, and view helpers. See Board store.index.htmlandboard.jshold the web board, andboard.test.cjstests its script.docs/: this documentation. It is also the site source for the docs site.docs-site/: the Astro project that builds the docs site. It only rendersdocs/.test-work-items/: the QA fixtures. Copy them before you run MK..github/workflows/:ci.ymlfor the Go checks,release.ymlfor releases, anddocs.ymlfor the docs site.