The ticket id is now stored only in the filename stem (.nbd/tickets/{id}.json).
`id` is annotated with `#[serde(skip)]` so it is never written to disk,
eliminating the consistency hazard of id-in-body vs. filename disagreement.
- ticket.rs: add `#[serde(skip)]` to `Ticket::id`
- store.rs: `read_ticket` and `list_tickets` inject id from filename stem
- display.rs: `ticket_to_json_value` re-inserts id for CLI `--json` output
- tests.rs: new unit tests for omission, injection, and old-format compat
- integration.rs: assert written files lack "id"; assert read --json has id
Backwards-compatible: old files with "id" in JSON body still parse correctly
(serde ignores the unknown field), so existing stores work without migration.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
4 months ago | |
|---|---|---|
| .. | ||
| .claude | 4 months ago | |
| .nbd/tickets | 4 months ago | |
| docs | 4 months ago | |
| src | 4 months ago | |
| tests | 4 months ago | |
| CLAUDE.md | 4 months ago | |
| Cargo.lock | 4 months ago | |
| Cargo.toml | 4 months ago | |
| PLAN.md | 4 months ago | |
| README.md | 4 months ago | |
README.md
nbd
A CLI tool for managing work tickets, primarily targeted at agent workflows.
Tickets are stored as JSON files in .nbd/tickets/ inside the nearest ancestor
directory that contains a .nbd/ folder, discovered by traversing upward from
the current working directory — just like git finds .git/.
How it works
Each ticket is a JSON file named {id}.json, where id is a unique
6-character lowercase hex string (e.g. a3f9c2). Tickets carry:
| Field | Type | Default |
|---|---|---|
id |
6-char hex string | auto-generated |
title |
string | (required) |
body |
string | "" |
priority |
integer 0–10 | 5 |
status |
todo | in_progress | done |
todo |
ticket_type |
project | feature | task | bug |
task |
dependencies |
list of ticket IDs | [] |
All commands accept --json for machine-readable output.
Usage
Initialise
Create the tickets directory manually in your project root:
mkdir -p .nbd/tickets
Create a ticket
nbd create --title "Fix login bug" --priority 8 --type bug
nbd create --title "Add rate limiting" --body "Protect public endpoints" --deps a3f9c2
Read a ticket
nbd read a3f9c2
nbd read a3f9c2 --json
List all tickets
nbd list
nbd list --json
Update a ticket
Only the flags you supply are changed; all other fields retain their current values.
nbd update a3f9c2 --status in_progress
nbd update a3f9c2 --priority 9 --type bug
Running
# From the nbd/ directory
cargo run -- create --title "Test ticket" --priority 7 --type bug
cargo run -- list
cargo run -- read <id>
cargo run -- update <id> --status in_progress
cargo run -- list --json
Testing
cargo test
Unit tests live in src/tests.rs. Integration tests (full command flows against
a temporary directory) live in tests/integration.rs.
Development
Run these commands in order before committing:
cargo fmt
cargo check
cargo clippy
cargo test
License
Dual-licensed under Apache License, Version 2.0 and
MIT License, consistent with the rest of the vibed mono-repo.
This software was written with Claude Code using the claude-sonnet-4-6 model.