shipbench 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +10 -3
  2. package/dist/index.js +175 -35
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -41,12 +41,13 @@ it byte-for-byte unchanged.
41
41
  | --- | --- |
42
42
  | `shipbench init` | Create `.shipbench/` when absent. `--name <name>` sets the project name (defaults to the directory basename). |
43
43
  | `shipbench task create <title>` | Create a task. `--status`, `--priority`, `--assignee`, `--tags=a,b,c`, `--depends-on=slug`, and `--json` to print the created task — the only way to learn a collision-suffixed slug programmatically. |
44
- | `shipbench task list` | List live tasks in board order. Filters: `--status`, `--priority`, `--assignee` (comma-separated or repeatable, match any; unconfigured status/priority errors), `--tag` (AND), `--available`, `--blocked`, `--archived`. `--json` for machine output. |
45
- | `shipbench task get <slug>` | Retrieve one task as JSON. |
44
+ | `shipbench task list` | List live tasks in board order. Filters: `--status`, `--priority`, `--assignee` (comma-separated or repeatable, match any; unconfigured status/priority errors), `--tag` (AND), `--flagged`, `--available`, `--blocked`, `--archived`. `--json` for machine output. |
45
+ | `shipbench task get <slug>` | Retrieve one task as JSON. Alias: `task show`. |
46
46
  | `shipbench task edit <slug>` | Revise the description (`--body` / `--body-file`) and/or validated metadata: `--title` (keeps the slug), `--priority`, `--assignee` / `--clear-assignee`, `--tags` / `--add-tag` / `--remove-tag` / `--clear-tags`, `--depends-on` / `--add-depends-on` / `--remove-depends-on` / `--clear-depends-on`. One validated write; a rejected value changes nothing. Status stays with `task move`. |
47
47
  | `shipbench task move <slug>` | `--to=<status>` picks the column; `--top`, `--bottom`, `--before=<slug>`, `--after=<slug>`, `--position=<n>` pick the spot within it. |
48
+ | `shipbench task flag <slug> [reason]` | Flag a task for attention without moving it. The reason is optional and one line; flagging again replaces it. `task unflag <slug>` clears it. What a flag means is your project's call. |
48
49
  | `shipbench task comment <slug> <text>` | Append a timestamped entry to the task's `## Task Updates` section. `edit` and `delete` subcommands take a zero-based index. |
49
- | `shipbench task search <query>` | Case-insensitive search over titles, tags, bodies, and Task Updates. Each term is a substring by default; `--whole-word` matches on word boundaries and a literal `"quoted"` run matches contiguously. Narrow with `task list`'s filters — `--status`, `--assignee`, `--priority` (comma-separated or repeatable, match any), `--tag` (AND), `--available`/`--blocked` — plus `--archived`, `--all`, `--limit`. |
50
+ | `shipbench task search <query>` | Case-insensitive search over titles, tags, bodies, and Task Updates. Each term is a substring by default; `--whole-word` matches on word boundaries and a literal `"quoted"` run matches contiguously. Narrow with `task list`'s filters — `--status`, `--assignee`, `--priority` (comma-separated or repeatable, match any), `--tag` (AND), `--flagged`, `--available`/`--blocked` — plus `--archived`, `--all`, `--limit`. |
50
51
  | `shipbench task graph` | Dependency graph as JSON when piped or with `--json`; an ASCII summary in an interactive terminal. |
51
52
  | `shipbench task archive <slug>` | Move a task to `tasks/archive/`, byte-identical and restorable. `--done [--keep=N]` bulk-archives completed tasks. |
52
53
  | `shipbench task unarchive <slug>` | Restore an archived task exactly as it was. |
@@ -65,12 +66,18 @@ without extra prompting. Two commands are built for that workflow:
65
66
  ```bash
66
67
  shipbench task list --available --json # unblocked, ranked candidates
67
68
  shipbench task list --blocked # waiting on dependencies
69
+ shipbench task list --flagged # someone asked for attention
68
70
  ```
69
71
 
70
72
  `--available` returns tasks in the default column whose `depends_on` entries are
71
73
  all complete or archived, ranked by priority then age. Dependencies are data,
72
74
  not locks — they never gate a write or move a task between columns.
73
75
 
76
+ A flag is the opposite signal from `--blocked`: not planned order, but a
77
+ request for someone. An agent that gets stuck can run
78
+ `shipbench task flag <slug> "Waiting on API credentials"` so the task stands
79
+ out on the board while it stays in its column.
80
+
74
81
  ## The `.shipbench/` convention
75
82
 
76
83
  Tasks are Markdown files with YAML frontmatter:
package/dist/index.js CHANGED
@@ -3915,6 +3915,17 @@ function validateConfig(config) {
3915
3915
  return errors;
3916
3916
  }
3917
3917
 
3918
+ // ../../packages/core/src/flag.ts
3919
+ function taskFlag(task) {
3920
+ const { flag } = task.frontmatter;
3921
+ if (flag === true) return { reason: null };
3922
+ if (typeof flag === "string" && flag.trim()) return { reason: flag.trim() };
3923
+ return null;
3924
+ }
3925
+ function isTaskFlagged(task) {
3926
+ return taskFlag(task) !== null;
3927
+ }
3928
+
3918
3929
  // ../../packages/core/src/github-url.ts
3919
3930
  var GITHUB_URL_RE = /^https:\/\/github\.com\/([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9][A-Za-z0-9._-]*?)(?:\.git)?\/?$/;
3920
3931
  var GITHUB_SCP_REMOTE_RE = /^git@github\.com:([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9][A-Za-z0-9._-]*?)(?:\.git)?$/;
@@ -4084,6 +4095,7 @@ var KNOWN_FRONTMATTER_FIELDS = /* @__PURE__ */ new Set([
4084
4095
  "assignee",
4085
4096
  "tags",
4086
4097
  "depends_on",
4098
+ "flag",
4087
4099
  "created",
4088
4100
  "updated"
4089
4101
  ]);
@@ -4325,6 +4337,26 @@ function normalizeDependsOn(value) {
4325
4337
  const deduped = [...new Set(value.map((s) => s.trim()).filter(Boolean))];
4326
4338
  return deduped.length > 0 ? deduped : void 0;
4327
4339
  }
4340
+ function normalizeFlag(value) {
4341
+ if (value === void 0 || value === true) return value;
4342
+ if (typeof value !== "string") {
4343
+ throw new Error(
4344
+ "Invalid flag: expected a short reason or `true`. Omit the field to clear the flag."
4345
+ );
4346
+ }
4347
+ const reason = value.trim();
4348
+ if (!reason) {
4349
+ throw new Error(
4350
+ "Invalid flag: the reason is blank. Leave the reason out to flag without one."
4351
+ );
4352
+ }
4353
+ if (/[\r\n]/.test(reason)) {
4354
+ throw new Error(
4355
+ "Invalid flag: keep the reason to one line. Put the detail in a Task Update."
4356
+ );
4357
+ }
4358
+ return reason;
4359
+ }
4328
4360
  async function assertValidDependsOn(adapter, config, slug, dependsOn) {
4329
4361
  if (!dependsOn || dependsOn.length === 0) return;
4330
4362
  if (dependsOn.includes(slug)) {
@@ -4393,6 +4425,14 @@ function validateTask(task, config, knownSlugs) {
4393
4425
  }
4394
4426
  }
4395
4427
  }
4428
+ const flag = task.frontmatter.flag;
4429
+ if (flag !== void 0 && flag !== null && !taskFlag(task)) {
4430
+ warnings.push({
4431
+ slug: task.slug,
4432
+ field: "flag",
4433
+ message: "Expected flag to be `true` or a short reason. The task reads as unflagged."
4434
+ });
4435
+ }
4396
4436
  for (const field of Object.keys(task.frontmatter)) {
4397
4437
  if (!KNOWN_FRONTMATTER_FIELDS.has(field)) {
4398
4438
  warnings.push({
@@ -4491,6 +4531,7 @@ async function createTask(adapter, config, title, fields, body) {
4491
4531
  assertValidPriority(priority, config);
4492
4532
  const dependsOn = normalizeDependsOn(fields?.depends_on);
4493
4533
  await assertValidDependsOn(adapter, config, slug, dependsOn);
4534
+ const flag = normalizeFlag(fields?.flag);
4494
4535
  const task = {
4495
4536
  slug,
4496
4537
  frontmatter: {
@@ -4500,6 +4541,7 @@ async function createTask(adapter, config, title, fields, body) {
4500
4541
  assignee: fields?.assignee,
4501
4542
  tags: fields?.tags,
4502
4543
  depends_on: dependsOn,
4544
+ flag,
4503
4545
  created: now,
4504
4546
  updated: now
4505
4547
  },
@@ -4533,11 +4575,14 @@ async function updateTask(adapter, config, slug, fields, body) {
4533
4575
  if (dependsOnProvided) {
4534
4576
  await assertValidDependsOn(adapter, config, slug, dependsOn);
4535
4577
  }
4578
+ const flagProvided = "flag" in fields;
4579
+ const flag = flagProvided ? normalizeFlag(fields.flag) : void 0;
4536
4580
  const statusChanged = fields.status !== void 0 && fields.status !== task.frontmatter.status;
4537
4581
  task.frontmatter = {
4538
4582
  ...task.frontmatter,
4539
4583
  ...fields,
4540
4584
  ...dependsOnProvided ? { depends_on: dependsOn } : {},
4585
+ ...flagProvided ? { flag } : {},
4541
4586
  // `created` is set once at creation and is not user-modifiable.
4542
4587
  created: task.frontmatter.created,
4543
4588
  updated: (/* @__PURE__ */ new Date()).toISOString()
@@ -4991,6 +5036,7 @@ Task description in Markdown.
4991
5036
  - **assignee** (optional): Freeform string label (e.g. \`claude\`, \`antigravity\`, or \`human\`). Informational only \u2014 task eligibility is governed strictly by \`status\` and \`depends_on\`. Moving a task to \`in-progress\` signals that work has started.
4992
5037
  - **tags** (optional): Array of freeform strings.
4993
5038
  - **depends_on** (optional): Array of task slugs that must be finished before this task can start. An omitted field and an empty array mean the same thing. A slug must name a task file that exists; a task may not depend on itself, and two tasks may not depend on each other.
5039
+ - **flag** (optional): Marks the task for attention without changing its column \u2014 a one-line reason, or \`true\` when there is none to give. What a flag means is this project's call. Informational only: it gates nothing, and nothing clears it automatically. Omit the field when the task is not flagged.
4994
5040
  - **created** (required): ISO 8601 timestamp. Set once on creation, never modify.
4995
5041
  - **updated** (required): ISO 8601 timestamp. Update on every modification.
4996
5042
 
@@ -5072,6 +5118,12 @@ Prose sections in a task body (\`## Depends on\`, \`## Blocked by\`, and similar
5072
5118
 
5073
5119
  Note that \`depends_on\` and the task's column are orthogonal. A column says where a task is; \`depends_on\` says what has to land first.
5074
5120
 
5121
+ ## Flagging a Task
5122
+
5123
+ A flag says a task needs someone's attention, whatever column it is in. It is not the same as \`--blocked\`, which means unmet \`depends_on\`. Set one with \`shipbench task flag <slug> "Short reason"\` (the reason is optional) and clear it with \`shipbench task unflag <slug>\`. Nothing clears a flag for you, not a move and not finishing the task, so whoever set it clears it once it no longer applies. \`shipbench task list --flagged --json\` lists flagged tasks.
5124
+
5125
+ For example: if you are stuck, flag your task with a short reason and add a Task Update with the detail. Clear the flag when you resume.
5126
+
5075
5127
  ## Reading Board Order
5076
5128
 
5077
5129
  \`layout.json\` is a partial, machine-managed index, not the visible order. It can omit \`done_column\`, unlisted tasks, and whole columns; retain stale slugs until another layout write; or be absent or gitignored. Reading it alone can therefore give the wrong answer.
@@ -5099,6 +5151,7 @@ Prefer the ShipBench CLI for task mutations when it is available. The CLI routes
5099
5151
 
5100
5152
  - **List available tasks**: \`shipbench task list --available --json\`
5101
5153
  - **List blocked tasks**: \`shipbench task list --blocked --json\`
5154
+ - **List flagged tasks**: \`shipbench task list --flagged --json\`
5102
5155
  - **Filter by tags**: \`shipbench task list --available --tag backend,auth --json\`
5103
5156
  - **Read one task**: \`shipbench task get <slug>\`
5104
5157
  - **Search tasks**: \`shipbench task search "<query>" --json\`
@@ -5113,6 +5166,7 @@ Prefer the ShipBench CLI for task mutations when it is available. The CLI routes
5113
5166
  - **Add a multi-line update**: \`shipbench task comment <slug> --body-file update.md\`
5114
5167
  - **Edit an update's text**: \`shipbench task comment edit <slug> <index> "Corrected text."\` (also takes \`--body-file\`)
5115
5168
  - **Delete an update**: \`shipbench task comment delete <slug> <index>\`
5169
+ - **Flag a task for attention**: \`shipbench task flag <slug> "Short reason"\` (\`shipbench task unflag <slug>\` clears it)
5116
5170
  - **Move a task**: \`shipbench task move <slug> --to=in-progress\`
5117
5171
  - **Complete a task**: \`shipbench task move <slug> --to=done\`
5118
5172
  - **Reorder a task when explicitly asked**: \`shipbench task move <slug> --before=other-slug\` (also \`--top\`, \`--bottom\`, \`--after\`, \`--position <n>\`)
@@ -5122,7 +5176,7 @@ Prefer the ShipBench CLI for task mutations when it is available. The CLI routes
5122
5176
  - **Unarchive a task**: \`shipbench task unarchive <slug>\`
5123
5177
  - **Delete a task**: \`shipbench task delete <slug>\`
5124
5178
  - **Open the board**: \`shipbench board\`
5125
- - **Watch the board in the terminal**: \`shipbench board terminal\` (read-only; \`--status\`, \`--tag\`, \`--assignee\`, \`--priority\` narrow it)
5179
+ - **Watch the board in the terminal**: \`shipbench board terminal\` (read-only; \`--status\`, \`--tag\`, \`--assignee\`, \`--priority\`, \`--flagged\` narrow it)
5126
5180
 
5127
5181
  ### Direct File Operations
5128
5182
 
@@ -5133,6 +5187,7 @@ Use direct edits only when the CLI is unavailable.
5133
5187
  - **Edit a task**: Modify frontmatter fields and/or the description above \`## Task Updates\`. Always update \`updated\`. \`shipbench task edit\` reaches the description and the validated metadata fields (title, priority, assignee, tags, depends_on) \u2014 use it rather than rewriting a file by hand.
5134
5188
  - **Add an Update without the CLI**: Append a \`### <ISO 8601 timestamp>\` heading and text below the trailing \`## Task Updates\` marker.
5135
5189
  - **Edit an Update without the CLI**: Change only its text; preserve the \`###\` timestamp heading and update the frontmatter \`updated\` value.
5190
+ - **Flag a task without the CLI**: Set \`flag\` to a one-line reason or \`true\`, remove the field to clear it, and update \`updated\`.
5136
5191
  - **Delete an Update without the CLI**: Remove its heading and text, remove an empty \`## Task Updates\` section, and update the frontmatter \`updated\` value.
5137
5192
  - **Delete a task**: Remove the \`.md\` file.
5138
5193
 
@@ -5166,7 +5221,13 @@ Your ShipBench project board for **${name}** is set up and ready to go.
5166
5221
 
5167
5222
  - Create new tasks with \`shipbench task create "My first task"\`
5168
5223
  - Open the board with \`shipbench board\`, or watch it in a terminal pane with \`shipbench board terminal\`
5224
+ - Record a decision with \`shipbench task comment welcome-to-shipbench "What changed and why."\` It lands under Task Updates with a timestamp, like the entry below.
5169
5225
  - Edit this file or delete it when you're ready
5226
+
5227
+ ## Task Updates
5228
+
5229
+ ### ${now}
5230
+ Set up this board with \`shipbench init\`.
5170
5231
  `;
5171
5232
  }
5172
5233
  async function initProject(adapter, options2) {
@@ -5670,7 +5731,12 @@ function requireString(value, field) {
5670
5731
  function optionalTaskFields(value) {
5671
5732
  if (value === void 0) return {};
5672
5733
  if (!isObject(value)) throw new Error('"fields" must be an object.');
5673
- return value;
5734
+ return Object.fromEntries(
5735
+ Object.entries(value).map(([key, field]) => [
5736
+ key,
5737
+ field === null ? void 0 : field
5738
+ ])
5739
+ );
5674
5740
  }
5675
5741
  function optionalBody(value) {
5676
5742
  if (value === void 0) return void 0;
@@ -6098,6 +6164,7 @@ function matchesFilters(task, filters) {
6098
6164
  if (filters.priority && task.frontmatter.priority !== filters.priority) {
6099
6165
  return false;
6100
6166
  }
6167
+ if (filters.flagged && !isTaskFlagged(task)) return false;
6101
6168
  const wanted = filters.tags ?? [];
6102
6169
  if (wanted.length > 0) {
6103
6170
  const tags = (task.frontmatter.tags ?? []).map((tag) => tag.toLowerCase());
@@ -6107,7 +6174,7 @@ function matchesFilters(task, filters) {
6107
6174
  }
6108
6175
  function hasTaskFilters(filters) {
6109
6176
  return Boolean(
6110
- filters.assignee || filters.priority || filters.tags && filters.tags.length > 0
6177
+ filters.assignee || filters.priority || filters.flagged || filters.tags && filters.tags.length > 0
6111
6178
  );
6112
6179
  }
6113
6180
  function buildBoardModel(config, tasks, warnings, filters = {}, archivedTasks = [], archivedSlugs = [], now = /* @__PURE__ */ new Date()) {
@@ -6174,6 +6241,9 @@ function buildBoardModel(config, tasks, warnings, filters = {}, archivedTasks =
6174
6241
  columns,
6175
6242
  warnings,
6176
6243
  blockedTaskSlugs,
6244
+ flaggedCount: tasks.filter(
6245
+ (task) => task.frontmatter.status !== config.done_column && isTaskFlagged(task)
6246
+ ).length,
6177
6247
  uncategorizedCount: uncategorized.length,
6178
6248
  // A `--status` value that names no column selects nothing, silently. Naming
6179
6249
  // the ones that missed is what lets the renderer say so instead of leaving
@@ -6476,18 +6546,22 @@ function titleWeight(task, config) {
6476
6546
  if (rank === top && top > 0) return "bold";
6477
6547
  return void 0;
6478
6548
  }
6479
- function taskRow(task, blocked, width, format, options2) {
6549
+ function rowMarker(task, column, model) {
6550
+ if (isTaskFlagged(task)) return column.isDone ? "flagged-done" : "flagged";
6551
+ return model.blockedTaskSlugs.has(task.slug) ? "waiting" : null;
6552
+ }
6553
+ function taskRow(task, kind, width, format, options2) {
6480
6554
  const { style, config } = options2;
6481
6555
  const weight = titleWeight(task, config);
6482
- const marker = blocked ? style(BOX.waiting, "dim") : "";
6483
- const prefixWidth = format.meter ? config.priority.values.length + 1 : blocked ? 1 : 0;
6556
+ const marker = kind === "flagged" ? style(BOX.warn, "yellow") : kind === "flagged-done" ? style(BOX.warn, "dim") : kind === "waiting" ? style(BOX.waiting, "dim") : "";
6557
+ const prefixWidth = format.meter ? config.priority.values.length + 1 : kind ? 1 : 0;
6484
6558
  const title = truncate(
6485
6559
  task.frontmatter.title,
6486
6560
  Math.max(0, width - prefixWidth)
6487
6561
  );
6488
6562
  const styledTitle = weight ? style(title, weight) : title;
6489
6563
  const gap = Math.max(0, width - prefixWidth - displayWidth(title));
6490
- return (format.meter ? `${meter(task, config, style)}${blocked ? marker : " "}` : marker) + styledTitle + " ".repeat(gap);
6564
+ return (format.meter ? `${meter(task, config, style)}${kind ? marker : " "}` : marker) + styledTitle + " ".repeat(gap);
6491
6565
  }
6492
6566
  function countLabel(column, filtered) {
6493
6567
  if (filtered && column.tasks.length !== column.total) {
@@ -6514,13 +6588,7 @@ function columnBody(column, width, rows, model, format, options2) {
6514
6588
  const message2 = model.filtered && column.total > 0 ? "no match" : "empty";
6515
6589
  return [style(fit(message2, width), "dim")];
6516
6590
  }
6517
- const row = (task) => taskRow(
6518
- task,
6519
- model.blockedTaskSlugs.has(task.slug),
6520
- width,
6521
- format,
6522
- options2
6523
- );
6591
+ const row = (task) => taskRow(task, rowMarker(task, column, model), width, format, options2);
6524
6592
  const visible = visibleTasks(column, rows);
6525
6593
  if (column.cappedOut === 0 && column.tasks.length <= rows) {
6526
6594
  return visible.map(row);
@@ -6577,6 +6645,9 @@ function statusLine(model, plan, width, options2) {
6577
6645
  style(`${BOX.warn} ${model.unreadableCount} unreadable`, "yellow")
6578
6646
  );
6579
6647
  }
6648
+ if (model.flaggedCount > 0) {
6649
+ alerts.push(style(`${BOX.warn} ${model.flaggedCount} flagged`, "yellow"));
6650
+ }
6580
6651
  if (model.warnings.length > 0) {
6581
6652
  alerts.push(
6582
6653
  style(`${BOX.warn} ${model.warnings.length} warnings`, "yellow")
@@ -6810,7 +6881,7 @@ async function runTui(options2) {
6810
6881
  }
6811
6882
 
6812
6883
  // src/cli.ts
6813
- var VERSION = true ? "0.5.0" : "0.0.0-dev";
6884
+ var VERSION = true ? "0.7.0" : "0.0.0-dev";
6814
6885
  function commaList(value) {
6815
6886
  return value.split(",").map((s) => s.trim()).filter(Boolean);
6816
6887
  }
@@ -6857,7 +6928,8 @@ function resolveTaskFilters(command, raw, config) {
6857
6928
  statuses,
6858
6929
  priorities,
6859
6930
  assignees: raw.assignee ?? [],
6860
- tags: raw.tag ?? []
6931
+ tags: raw.tag ?? [],
6932
+ flagged: Boolean(raw.flagged)
6861
6933
  };
6862
6934
  }
6863
6935
  function taskMatchesFilters(task, filters, options2 = {}) {
@@ -6871,9 +6943,15 @@ function taskMatchesFilters(task, filters, options2 = {}) {
6871
6943
  if (filters.assignees.length > 0 && (frontmatter.assignee === void 0 || !filters.assignees.includes(frontmatter.assignee))) {
6872
6944
  return false;
6873
6945
  }
6946
+ if (filters.flagged && !isTaskFlagged(task)) return false;
6874
6947
  const taskTags = (frontmatter.tags ?? []).map((tag) => tag.toLowerCase());
6875
6948
  return filters.tags.every((wanted) => taskTags.includes(wanted.toLowerCase()));
6876
6949
  }
6950
+ function flagSuffix(task) {
6951
+ const flag = taskFlag(task);
6952
+ if (!flag) return "";
6953
+ return flag.reason ? ` \u2014 flagged: ${flag.reason}` : " \u2014 flagged";
6954
+ }
6877
6955
  function parsePort(value) {
6878
6956
  const port = Number(value);
6879
6957
  if (!Number.isInteger(port) || port < 1 || port > 65535) {
@@ -7045,6 +7123,15 @@ function createCli(opts) {
7045
7123
  }
7046
7124
  return positional ?? fromOption;
7047
7125
  };
7126
+ const requireLiveTask = async (command, config, slug, action) => {
7127
+ const existing = await getTask(adapter, config, slug);
7128
+ if (existing) return existing;
7129
+ const archived = await getTask(adapter, config, slug, { archived: true });
7130
+ command.error(
7131
+ archived ? `Task '${slug}' is archived. Unarchive it before ${action}.` : `Task '${slug}' not found.`
7132
+ );
7133
+ return null;
7134
+ };
7048
7135
  const program = new Command().name("shipbench").description("Git-native project management for solo developers.").enablePositionalOptions().version(VERSION, "-v, --version", "output the version").option(
7049
7136
  "-C <path>",
7050
7137
  "Run as if ShipBench was started in the specified directory"
@@ -7277,14 +7364,13 @@ function createCli(opts) {
7277
7364
  return;
7278
7365
  }
7279
7366
  const config = await loadCliConfig();
7280
- const existing = await getTask(adapter, config, slug);
7281
- if (!existing) {
7282
- const archived = await getTask(adapter, config, slug, { archived: true });
7283
- editCommand.error(
7284
- archived ? `Task '${slug}' is archived. Unarchive it before editing.` : `Task '${slug}' not found.`
7285
- );
7286
- return;
7287
- }
7367
+ const existing = await requireLiveTask(
7368
+ editCommand,
7369
+ config,
7370
+ slug,
7371
+ "editing"
7372
+ );
7373
+ if (!existing) return;
7288
7374
  const before = existing.frontmatter;
7289
7375
  const fields = {};
7290
7376
  const changes = [];
@@ -7436,7 +7522,7 @@ function createCli(opts) {
7436
7522
  const updated = await deleteComment(adapter, config, slug, parsedIndex);
7437
7523
  chrome(`Deleted update ${parsedIndex} from ${updated.slug}`);
7438
7524
  });
7439
- const getTaskCommand = task.command("get <slug>").description("Retrieve one task as JSON").option("--archived", "Retrieve the task from the archive instead");
7525
+ const getTaskCommand = task.command("get <slug>").alias("show").description("Retrieve one task as JSON").option("--archived", "Retrieve the task from the archive instead");
7440
7526
  getTaskCommand.action(async (slug, raw) => {
7441
7527
  const config = await loadCliConfig();
7442
7528
  const found = await getTask(adapter, config, slug, {
@@ -7476,6 +7562,52 @@ function createCli(opts) {
7476
7562
  )
7477
7563
  );
7478
7564
  });
7565
+ const flagCommand = task.command("flag <slug> [reason]").description("Flag a task for attention, with an optional one-line reason").addHelpText(
7566
+ "after",
7567
+ "\nWhat a flag means is the project's call. A flag never moves the task, and\nnothing clears it for you: run `shipbench task unflag <slug>` once it no\nlonger applies. Flagging a flagged task replaces its reason.\n"
7568
+ );
7569
+ flagCommand.action(
7570
+ async (slug, reason) => {
7571
+ const config = await loadCliConfig();
7572
+ const existing = await requireLiveTask(
7573
+ flagCommand,
7574
+ config,
7575
+ slug,
7576
+ "flagging"
7577
+ );
7578
+ if (!existing) return;
7579
+ const flag = reason == null ? true : reason;
7580
+ const before = taskFlag(existing);
7581
+ if (before && before.reason === (flag === true ? null : flag.trim())) {
7582
+ chrome(`No changes for ${slug}: it already carries that flag.`);
7583
+ return;
7584
+ }
7585
+ const { task: flagged } = await updateTask(adapter, config, slug, {
7586
+ flag
7587
+ });
7588
+ const after = taskFlag(flagged);
7589
+ chrome(
7590
+ after?.reason ? `Flagged ${flagged.slug}: ${after.reason}` : `Flagged ${flagged.slug}`
7591
+ );
7592
+ }
7593
+ );
7594
+ const unflagCommand = task.command("unflag <slug>").description("Clear a task's flag");
7595
+ unflagCommand.action(async (slug) => {
7596
+ const config = await loadCliConfig();
7597
+ const existing = await requireLiveTask(
7598
+ unflagCommand,
7599
+ config,
7600
+ slug,
7601
+ "unflagging"
7602
+ );
7603
+ if (!existing) return;
7604
+ if (existing.frontmatter.flag === void 0) {
7605
+ chrome(`No changes for ${slug}: it is not flagged.`);
7606
+ return;
7607
+ }
7608
+ await updateTask(adapter, config, slug, { flag: void 0 });
7609
+ chrome(`Unflagged ${slug}`);
7610
+ });
7479
7611
  const moveCommand = task.command("move <slug>").description("Move a task to another column and/or another position").option(
7480
7612
  "-t, --to <status>",
7481
7613
  "Target column (defaults to the task's current column)"
@@ -7616,7 +7748,7 @@ function createCli(opts) {
7616
7748
  "--tag <tag>",
7617
7749
  "Filter by tag (comma-separated or repeatable with AND semantics)",
7618
7750
  accumulateCommaList
7619
- ).addOption(
7751
+ ).option("--flagged", "Only tasks with a flag set").addOption(
7620
7752
  new Option(
7621
7753
  "--available",
7622
7754
  "List tasks whose dependencies are satisfied (ranked by priority then age, not board order)"
@@ -7687,7 +7819,9 @@ function createCli(opts) {
7687
7819
  }
7688
7820
  if (raw.archived) data("Archived tasks:");
7689
7821
  for (const t of filtered) {
7690
- data(`[${t.frontmatter.status}] ${t.frontmatter.title} (${t.slug})`);
7822
+ data(
7823
+ `[${t.frontmatter.status}] ${t.frontmatter.title} (${t.slug})${flagSuffix(t)}`
7824
+ );
7691
7825
  }
7692
7826
  for (const file of result.unreadable) data(formatUnreadableFile(file));
7693
7827
  if (result.warnings.length > 0) {
@@ -7720,7 +7854,7 @@ function createCli(opts) {
7720
7854
  "--tag <tag>",
7721
7855
  "Filter by tag (comma-separated or repeatable with AND semantics)",
7722
7856
  accumulateCommaList
7723
- ).addOption(
7857
+ ).option("--flagged", "Only tasks with a flag set").addOption(
7724
7858
  new Option(
7725
7859
  "--available",
7726
7860
  "Restrict to tasks whose dependencies are satisfied (ranked like `task list`, live tasks only)"
@@ -7791,6 +7925,9 @@ function createCli(opts) {
7791
7925
  wholeWord: Boolean(raw.wholeWord)
7792
7926
  });
7793
7927
  const matches = allMatches.slice(0, raw.limit);
7928
+ const candidatesBySlug = new Map(
7929
+ candidates.map((candidate) => [candidate.slug, candidate])
7930
+ );
7794
7931
  const warnings = [
7795
7932
  ...liveResult?.warnings ?? [],
7796
7933
  ...searchArchive ? archivedResult?.warnings ?? [] : []
@@ -7800,17 +7937,15 @@ function createCli(opts) {
7800
7937
  ...searchArchive ? archivedResult?.unreadable ?? [] : []
7801
7938
  ];
7802
7939
  if (raw.json) {
7803
- const tasksBySlug = new Map(
7804
- candidates.map((candidate) => [candidate.slug, candidate])
7805
- );
7806
7940
  const payloadMatches = matches.map((match) => {
7807
- const source = tasksBySlug.get(match.slug);
7941
+ const source = candidatesBySlug.get(match.slug);
7808
7942
  return {
7809
7943
  slug: match.slug,
7810
7944
  title: match.title,
7811
7945
  status: match.status,
7812
7946
  location: locationOf(match.slug),
7813
7947
  matched_fields: match.matched_fields,
7948
+ ...source && isTaskFlagged(source) ? { flag: source.frontmatter.flag } : {},
7814
7949
  ...match.snippet !== void 0 ? { snippet: match.snippet } : {},
7815
7950
  ...match.update_matches ? { update_matches: match.update_matches } : {},
7816
7951
  ...raw.includeBody ? {
@@ -7835,6 +7970,10 @@ function createCli(opts) {
7835
7970
  );
7836
7971
  return;
7837
7972
  }
7973
+ const flagSuffixFor = (slug) => {
7974
+ const source = candidatesBySlug.get(slug);
7975
+ return source ? flagSuffix(source) : "";
7976
+ };
7838
7977
  if (allMatches.length === 0) {
7839
7978
  data(`No matches for "${query.trim()}".`);
7840
7979
  } else {
@@ -7843,7 +7982,7 @@ function createCli(opts) {
7843
7982
  }
7844
7983
  for (const match of matches) {
7845
7984
  data(
7846
- `${match.title} (${match.slug}) [${locationOf(match.slug)} \xB7 ${match.status}] [${match.matched_fields.join(", ")}]`
7985
+ `${match.title} (${match.slug}) [${locationOf(match.slug)} \xB7 ${match.status}] [${match.matched_fields.join(", ")}]${flagSuffixFor(match.slug)}`
7847
7986
  );
7848
7987
  if (match.snippet) data(` ${match.snippet}`);
7849
7988
  for (const updateMatch of match.update_matches ?? []) {
@@ -7974,7 +8113,7 @@ function createCli(opts) {
7974
8113
  "--tag <tag>",
7975
8114
  "Filter by tag (comma-separated or repeatable with AND semantics)",
7976
8115
  accumulateCommaList
7977
- ).addHelpText(
8116
+ ).option("--flagged", "Only tasks with a flag set").addHelpText(
7978
8117
  "after",
7979
8118
  "\nTakes no keyboard input: Ctrl-C exits. Never writes to the board.\nWith stdout redirected it prints one 80x24 frame and exits.\n"
7980
8119
  ).action(async (raw) => {
@@ -7985,7 +8124,8 @@ function createCli(opts) {
7985
8124
  statuses: raw.status,
7986
8125
  tags: raw.tag,
7987
8126
  assignee: raw.assignee,
7988
- priority: raw.priority
8127
+ priority: raw.priority,
8128
+ flagged: raw.flagged
7989
8129
  }
7990
8130
  });
7991
8131
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipbench",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Git-native project management for solo developers. Each task is a Markdown file in your repository, with a CLI and a local board on top.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,14 +33,14 @@
33
33
  "dependencies": {
34
34
  "chokidar": "^5.0.0",
35
35
  "commander": "^15.0.0",
36
- "@shipbench/board": "0.5.0"
36
+ "@shipbench/board": "0.7.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^26.0.1",
40
40
  "gray-matter": "^4.0.3",
41
41
  "tsup": "^8.0.0",
42
42
  "typescript": "^5.5.0",
43
- "@shipbench/core": "0.5.0"
43
+ "@shipbench/core": "0.7.0"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "tsup",