+++ title = "nbd init command" priority = 7 status = "done" ticket_type = "feature" dependencies = [] +++ Add an explicit `nbd init` subcommand that creates `.nbd/tickets/` in the current working directory, analogous to `git init`. ## Motivation Currently users must run `mkdir -p .nbd/tickets` manually before first use. This is a friction point — especially for first-time users and agent workflows bootstrapping a new project. ## Approach 1. Add `Init` variant to the `Commands` enum in `main.rs`. 2. Implement `cmd_init(json: bool) -> store::Result<()>`: - Get cwd via `std::env::current_dir()`. - Call `store::ensure_tickets_dir(&cwd)` (already exists, idempotent). - Print confirmation: `initialised .nbd/tickets/ in ` (or JSON: `{"root": ""}`). 3. No changes to `store.rs` needed — `ensure_tickets_dir` already uses `create_dir_all` (idempotent). 4. The command should NOT require `.nbd/` to already exist (i.e. do NOT call `find_nbd_root` here — use cwd directly). ## Tests - Integration test: run `nbd init` in a fresh tempdir, verify `.nbd/tickets/` is created. - Integration test: run `nbd init` twice in the same dir — succeeds both times (idempotent). - Integration test: `nbd init --json` outputs valid JSON with a `root` field. ## Files touched - `src/main.rs` — new `Init` variant and `cmd_init` handler - `tests/integration.rs` — new integration tests - `README.md` — update Initialise section