shipbench 0.6.0 → 0.7.1

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 -37
  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
 
@@ -5676,7 +5731,12 @@ function requireString(value, field) {
5676
5731
  function optionalTaskFields(value) {
5677
5732
  if (value === void 0) return {};
5678
5733
  if (!isObject(value)) throw new Error('"fields" must be an object.');
5679
- return value;
5734
+ return Object.fromEntries(
5735
+ Object.entries(value).map(([key, field]) => [
5736
+ key,
5737
+ field === null ? void 0 : field
5738
+ ])
5739
+ );
5680
5740
  }
5681
5741
  function optionalBody(value) {
5682
5742
  if (value === void 0) return void 0;
@@ -6104,6 +6164,7 @@ function matchesFilters(task, filters) {
6104
6164
  if (filters.priority && task.frontmatter.priority !== filters.priority) {
6105
6165
  return false;
6106
6166
  }
6167
+ if (filters.flagged && !isTaskFlagged(task)) return false;
6107
6168
  const wanted = filters.tags ?? [];
6108
6169
  if (wanted.length > 0) {
6109
6170
  const tags = (task.frontmatter.tags ?? []).map((tag) => tag.toLowerCase());
@@ -6113,7 +6174,7 @@ function matchesFilters(task, filters) {
6113
6174
  }
6114
6175
  function hasTaskFilters(filters) {
6115
6176
  return Boolean(
6116
- filters.assignee || filters.priority || filters.tags && filters.tags.length > 0
6177
+ filters.assignee || filters.priority || filters.flagged || filters.tags && filters.tags.length > 0
6117
6178
  );
6118
6179
  }
6119
6180
  function buildBoardModel(config, tasks, warnings, filters = {}, archivedTasks = [], archivedSlugs = [], now = /* @__PURE__ */ new Date()) {
@@ -6180,6 +6241,9 @@ function buildBoardModel(config, tasks, warnings, filters = {}, archivedTasks =
6180
6241
  columns,
6181
6242
  warnings,
6182
6243
  blockedTaskSlugs,
6244
+ flaggedCount: tasks.filter(
6245
+ (task) => task.frontmatter.status !== config.done_column && isTaskFlagged(task)
6246
+ ).length,
6183
6247
  uncategorizedCount: uncategorized.length,
6184
6248
  // A `--status` value that names no column selects nothing, silently. Naming
6185
6249
  // the ones that missed is what lets the renderer say so instead of leaving
@@ -6482,18 +6546,22 @@ function titleWeight(task, config) {
6482
6546
  if (rank === top && top > 0) return "bold";
6483
6547
  return void 0;
6484
6548
  }
6485
- 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) {
6486
6554
  const { style, config } = options2;
6487
6555
  const weight = titleWeight(task, config);
6488
- const marker = blocked ? style(BOX.waiting, "dim") : "";
6489
- 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;
6490
6558
  const title = truncate(
6491
6559
  task.frontmatter.title,
6492
6560
  Math.max(0, width - prefixWidth)
6493
6561
  );
6494
6562
  const styledTitle = weight ? style(title, weight) : title;
6495
6563
  const gap = Math.max(0, width - prefixWidth - displayWidth(title));
6496
- 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);
6497
6565
  }
6498
6566
  function countLabel(column, filtered) {
6499
6567
  if (filtered && column.tasks.length !== column.total) {
@@ -6520,13 +6588,7 @@ function columnBody(column, width, rows, model, format, options2) {
6520
6588
  const message2 = model.filtered && column.total > 0 ? "no match" : "empty";
6521
6589
  return [style(fit(message2, width), "dim")];
6522
6590
  }
6523
- const row = (task) => taskRow(
6524
- task,
6525
- model.blockedTaskSlugs.has(task.slug),
6526
- width,
6527
- format,
6528
- options2
6529
- );
6591
+ const row = (task) => taskRow(task, rowMarker(task, column, model), width, format, options2);
6530
6592
  const visible = visibleTasks(column, rows);
6531
6593
  if (column.cappedOut === 0 && column.tasks.length <= rows) {
6532
6594
  return visible.map(row);
@@ -6583,6 +6645,9 @@ function statusLine(model, plan, width, options2) {
6583
6645
  style(`${BOX.warn} ${model.unreadableCount} unreadable`, "yellow")
6584
6646
  );
6585
6647
  }
6648
+ if (model.flaggedCount > 0) {
6649
+ alerts.push(style(`${BOX.warn} ${model.flaggedCount} flagged`, "yellow"));
6650
+ }
6586
6651
  if (model.warnings.length > 0) {
6587
6652
  alerts.push(
6588
6653
  style(`${BOX.warn} ${model.warnings.length} warnings`, "yellow")
@@ -6816,7 +6881,7 @@ async function runTui(options2) {
6816
6881
  }
6817
6882
 
6818
6883
  // src/cli.ts
6819
- var VERSION = true ? "0.6.0" : "0.0.0-dev";
6884
+ var VERSION = true ? "0.7.1" : "0.0.0-dev";
6820
6885
  function commaList(value) {
6821
6886
  return value.split(",").map((s) => s.trim()).filter(Boolean);
6822
6887
  }
@@ -6863,7 +6928,8 @@ function resolveTaskFilters(command, raw, config) {
6863
6928
  statuses,
6864
6929
  priorities,
6865
6930
  assignees: raw.assignee ?? [],
6866
- tags: raw.tag ?? []
6931
+ tags: raw.tag ?? [],
6932
+ flagged: Boolean(raw.flagged)
6867
6933
  };
6868
6934
  }
6869
6935
  function taskMatchesFilters(task, filters, options2 = {}) {
@@ -6877,9 +6943,15 @@ function taskMatchesFilters(task, filters, options2 = {}) {
6877
6943
  if (filters.assignees.length > 0 && (frontmatter.assignee === void 0 || !filters.assignees.includes(frontmatter.assignee))) {
6878
6944
  return false;
6879
6945
  }
6946
+ if (filters.flagged && !isTaskFlagged(task)) return false;
6880
6947
  const taskTags = (frontmatter.tags ?? []).map((tag) => tag.toLowerCase());
6881
6948
  return filters.tags.every((wanted) => taskTags.includes(wanted.toLowerCase()));
6882
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
+ }
6883
6955
  function parsePort(value) {
6884
6956
  const port = Number(value);
6885
6957
  if (!Number.isInteger(port) || port < 1 || port > 65535) {
@@ -7051,6 +7123,15 @@ function createCli(opts) {
7051
7123
  }
7052
7124
  return positional ?? fromOption;
7053
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
+ };
7054
7135
  const program = new Command().name("shipbench").description("Git-native project management for solo developers.").enablePositionalOptions().version(VERSION, "-v, --version", "output the version").option(
7055
7136
  "-C <path>",
7056
7137
  "Run as if ShipBench was started in the specified directory"
@@ -7164,7 +7245,11 @@ function createCli(opts) {
7164
7245
  chrome(message2);
7165
7246
  });
7166
7247
  const task = program.command("task").description("Manage tasks");
7167
- task.command("create <title>").description("Create a new task").option("-s, --status <status>", "Column to place the task in").option("-a, --assignee <assignee>", "Assignee label").option("-p, --priority <priority>", "Priority value").option("-t, --tags <tags>", "Comma-separated tags", commaList).option(
7248
+ task.command("create <title>").description("Create a new task").option("-s, --status <status>", "Column to place the task in").option("-a, --assignee <assignee>", "Assignee label").option("-p, --priority <priority>", "Priority value").option(
7249
+ "-t, --tags <tags>",
7250
+ "Tags (comma-separated, repeatable)",
7251
+ accumulateCommaList
7252
+ ).option(
7168
7253
  "-d, --depends-on <slugs>",
7169
7254
  "Slugs this task depends on (comma-separated, repeatable)",
7170
7255
  accumulateCommaList,
@@ -7183,7 +7268,7 @@ function createCli(opts) {
7183
7268
  status: raw.status,
7184
7269
  assignee: raw.assignee,
7185
7270
  priority: raw.priority,
7186
- tags: raw.tags,
7271
+ tags: raw.tags && dedupePreservingCase(raw.tags),
7187
7272
  depends_on: raw.dependsOn
7188
7273
  },
7189
7274
  body
@@ -7283,14 +7368,13 @@ function createCli(opts) {
7283
7368
  return;
7284
7369
  }
7285
7370
  const config = await loadCliConfig();
7286
- const existing = await getTask(adapter, config, slug);
7287
- if (!existing) {
7288
- const archived = await getTask(adapter, config, slug, { archived: true });
7289
- editCommand.error(
7290
- archived ? `Task '${slug}' is archived. Unarchive it before editing.` : `Task '${slug}' not found.`
7291
- );
7292
- return;
7293
- }
7371
+ const existing = await requireLiveTask(
7372
+ editCommand,
7373
+ config,
7374
+ slug,
7375
+ "editing"
7376
+ );
7377
+ if (!existing) return;
7294
7378
  const before = existing.frontmatter;
7295
7379
  const fields = {};
7296
7380
  const changes = [];
@@ -7442,7 +7526,7 @@ function createCli(opts) {
7442
7526
  const updated = await deleteComment(adapter, config, slug, parsedIndex);
7443
7527
  chrome(`Deleted update ${parsedIndex} from ${updated.slug}`);
7444
7528
  });
7445
- const getTaskCommand = task.command("get <slug>").description("Retrieve one task as JSON").option("--archived", "Retrieve the task from the archive instead");
7529
+ const getTaskCommand = task.command("get <slug>").alias("show").description("Retrieve one task as JSON").option("--archived", "Retrieve the task from the archive instead");
7446
7530
  getTaskCommand.action(async (slug, raw) => {
7447
7531
  const config = await loadCliConfig();
7448
7532
  const found = await getTask(adapter, config, slug, {
@@ -7482,6 +7566,52 @@ function createCli(opts) {
7482
7566
  )
7483
7567
  );
7484
7568
  });
7569
+ const flagCommand = task.command("flag <slug> [reason]").description("Flag a task for attention, with an optional one-line reason").addHelpText(
7570
+ "after",
7571
+ "\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"
7572
+ );
7573
+ flagCommand.action(
7574
+ async (slug, reason) => {
7575
+ const config = await loadCliConfig();
7576
+ const existing = await requireLiveTask(
7577
+ flagCommand,
7578
+ config,
7579
+ slug,
7580
+ "flagging"
7581
+ );
7582
+ if (!existing) return;
7583
+ const flag = reason == null ? true : reason;
7584
+ const before = taskFlag(existing);
7585
+ if (before && before.reason === (flag === true ? null : flag.trim())) {
7586
+ chrome(`No changes for ${slug}: it already carries that flag.`);
7587
+ return;
7588
+ }
7589
+ const { task: flagged } = await updateTask(adapter, config, slug, {
7590
+ flag
7591
+ });
7592
+ const after = taskFlag(flagged);
7593
+ chrome(
7594
+ after?.reason ? `Flagged ${flagged.slug}: ${after.reason}` : `Flagged ${flagged.slug}`
7595
+ );
7596
+ }
7597
+ );
7598
+ const unflagCommand = task.command("unflag <slug>").description("Clear a task's flag");
7599
+ unflagCommand.action(async (slug) => {
7600
+ const config = await loadCliConfig();
7601
+ const existing = await requireLiveTask(
7602
+ unflagCommand,
7603
+ config,
7604
+ slug,
7605
+ "unflagging"
7606
+ );
7607
+ if (!existing) return;
7608
+ if (existing.frontmatter.flag === void 0) {
7609
+ chrome(`No changes for ${slug}: it is not flagged.`);
7610
+ return;
7611
+ }
7612
+ await updateTask(adapter, config, slug, { flag: void 0 });
7613
+ chrome(`Unflagged ${slug}`);
7614
+ });
7485
7615
  const moveCommand = task.command("move <slug>").description("Move a task to another column and/or another position").option(
7486
7616
  "-t, --to <status>",
7487
7617
  "Target column (defaults to the task's current column)"
@@ -7622,7 +7752,7 @@ function createCli(opts) {
7622
7752
  "--tag <tag>",
7623
7753
  "Filter by tag (comma-separated or repeatable with AND semantics)",
7624
7754
  accumulateCommaList
7625
- ).addOption(
7755
+ ).option("--flagged", "Only tasks with a flag set").addOption(
7626
7756
  new Option(
7627
7757
  "--available",
7628
7758
  "List tasks whose dependencies are satisfied (ranked by priority then age, not board order)"
@@ -7693,7 +7823,9 @@ function createCli(opts) {
7693
7823
  }
7694
7824
  if (raw.archived) data("Archived tasks:");
7695
7825
  for (const t of filtered) {
7696
- data(`[${t.frontmatter.status}] ${t.frontmatter.title} (${t.slug})`);
7826
+ data(
7827
+ `[${t.frontmatter.status}] ${t.frontmatter.title} (${t.slug})${flagSuffix(t)}`
7828
+ );
7697
7829
  }
7698
7830
  for (const file of result.unreadable) data(formatUnreadableFile(file));
7699
7831
  if (result.warnings.length > 0) {
@@ -7726,7 +7858,7 @@ function createCli(opts) {
7726
7858
  "--tag <tag>",
7727
7859
  "Filter by tag (comma-separated or repeatable with AND semantics)",
7728
7860
  accumulateCommaList
7729
- ).addOption(
7861
+ ).option("--flagged", "Only tasks with a flag set").addOption(
7730
7862
  new Option(
7731
7863
  "--available",
7732
7864
  "Restrict to tasks whose dependencies are satisfied (ranked like `task list`, live tasks only)"
@@ -7797,6 +7929,9 @@ function createCli(opts) {
7797
7929
  wholeWord: Boolean(raw.wholeWord)
7798
7930
  });
7799
7931
  const matches = allMatches.slice(0, raw.limit);
7932
+ const candidatesBySlug = new Map(
7933
+ candidates.map((candidate) => [candidate.slug, candidate])
7934
+ );
7800
7935
  const warnings = [
7801
7936
  ...liveResult?.warnings ?? [],
7802
7937
  ...searchArchive ? archivedResult?.warnings ?? [] : []
@@ -7806,17 +7941,15 @@ function createCli(opts) {
7806
7941
  ...searchArchive ? archivedResult?.unreadable ?? [] : []
7807
7942
  ];
7808
7943
  if (raw.json) {
7809
- const tasksBySlug = new Map(
7810
- candidates.map((candidate) => [candidate.slug, candidate])
7811
- );
7812
7944
  const payloadMatches = matches.map((match) => {
7813
- const source = tasksBySlug.get(match.slug);
7945
+ const source = candidatesBySlug.get(match.slug);
7814
7946
  return {
7815
7947
  slug: match.slug,
7816
7948
  title: match.title,
7817
7949
  status: match.status,
7818
7950
  location: locationOf(match.slug),
7819
7951
  matched_fields: match.matched_fields,
7952
+ ...source && isTaskFlagged(source) ? { flag: source.frontmatter.flag } : {},
7820
7953
  ...match.snippet !== void 0 ? { snippet: match.snippet } : {},
7821
7954
  ...match.update_matches ? { update_matches: match.update_matches } : {},
7822
7955
  ...raw.includeBody ? {
@@ -7841,6 +7974,10 @@ function createCli(opts) {
7841
7974
  );
7842
7975
  return;
7843
7976
  }
7977
+ const flagSuffixFor = (slug) => {
7978
+ const source = candidatesBySlug.get(slug);
7979
+ return source ? flagSuffix(source) : "";
7980
+ };
7844
7981
  if (allMatches.length === 0) {
7845
7982
  data(`No matches for "${query.trim()}".`);
7846
7983
  } else {
@@ -7849,7 +7986,7 @@ function createCli(opts) {
7849
7986
  }
7850
7987
  for (const match of matches) {
7851
7988
  data(
7852
- `${match.title} (${match.slug}) [${locationOf(match.slug)} \xB7 ${match.status}] [${match.matched_fields.join(", ")}]`
7989
+ `${match.title} (${match.slug}) [${locationOf(match.slug)} \xB7 ${match.status}] [${match.matched_fields.join(", ")}]${flagSuffixFor(match.slug)}`
7853
7990
  );
7854
7991
  if (match.snippet) data(` ${match.snippet}`);
7855
7992
  for (const updateMatch of match.update_matches ?? []) {
@@ -7980,7 +8117,7 @@ function createCli(opts) {
7980
8117
  "--tag <tag>",
7981
8118
  "Filter by tag (comma-separated or repeatable with AND semantics)",
7982
8119
  accumulateCommaList
7983
- ).addHelpText(
8120
+ ).option("--flagged", "Only tasks with a flag set").addHelpText(
7984
8121
  "after",
7985
8122
  "\nTakes no keyboard input: Ctrl-C exits. Never writes to the board.\nWith stdout redirected it prints one 80x24 frame and exits.\n"
7986
8123
  ).action(async (raw) => {
@@ -7991,7 +8128,8 @@ function createCli(opts) {
7991
8128
  statuses: raw.status,
7992
8129
  tags: raw.tag,
7993
8130
  assignee: raw.assignee,
7994
- priority: raw.priority
8131
+ priority: raw.priority,
8132
+ flagged: raw.flagged
7995
8133
  }
7996
8134
  });
7997
8135
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipbench",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
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.6.0"
36
+ "@shipbench/board": "0.7.1"
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.6.0"
43
+ "@shipbench/core": "0.7.1"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "tsup",