trackerctl 0.4.0 → 0.4.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.
package/README.md CHANGED
@@ -90,6 +90,7 @@ Read commands serve from a local sqlite cache that auto-syncs when older than
90
90
  | `tracker close <id> [--reason <text>]` | Close (clears assignee + in-progress label) |
91
91
  | `tracker comment <id> <text>` | Post a comment on an item |
92
92
  | `tracker attach <id> <file...> [-m <msg>]` | Upload files, reference them from one comment; prints markdown |
93
+ | `tracker label <id> [--add a,b] [--remove c,d]` | Add/remove labels without clobbering the rest |
93
94
  | `tracker spend <id> <duration>` | Add time spent (`1h30m`, `2d`; `-30m` subtracts) |
94
95
  | `tracker estimate <id> <duration>` | Set the time estimate (`0` clears it) |
95
96
  | `tracker dep <id> --blocked-by <o> \| --blocks <o>` | Add a dependency edge |
package/dist/tracker.js CHANGED
@@ -1354,6 +1354,8 @@ write commands:
1354
1354
  release <id> clear assignee/label, tombstone live claim tokens
1355
1355
  close <id> [--reason <text>]
1356
1356
  comment <id> <text> post a comment on an item
1357
+ label <id> [--add a,b] [--remove c,d]
1358
+ add/remove labels without touching the others
1357
1359
  attach <id> <file...> [-m <message>]
1358
1360
  upload files and attach them via a comment
1359
1361
  spend <id> <duration> add time spent (1h30m, 45m, 2d; -30m subtracts)
@@ -1430,6 +1432,14 @@ Posts a comment on the item. Everything after the id is joined into one
1430
1432
  comment body, so quoting multi-word text is optional.
1431
1433
 
1432
1434
  example: tracker comment 42 "blocked on the design review, see thread"`,
1435
+ label: `usage: tracker label <id> [--add <a,b>] [--remove <c,d>]
1436
+
1437
+ Adds and/or removes labels (comma-separated) without clobbering the rest.
1438
+ At least one of --add/--remove is required.
1439
+
1440
+ examples:
1441
+ tracker label 42 --add status::agent-blocked
1442
+ tracker label 42 --remove status::agent-blocked --add meta::human-only`,
1433
1443
  attach: `usage: tracker attach <id> <file...> [-m <message>] [--json]
1434
1444
 
1435
1445
  Uploads each file to the provider and posts ONE comment on the item containing
@@ -1826,6 +1836,25 @@ async function cmdComment(ctx, args) {
1826
1836
  await ctx.adapter.comment(id, body);
1827
1837
  console.log(`commented on #${id}`);
1828
1838
  }
1839
+ async function cmdLabel(ctx, args) {
1840
+ const id = normalizeId(args.positionals[0]);
1841
+ const csv = (name) => (str(args, name) ?? "").split(",").map((s) => s.trim()).filter(Boolean);
1842
+ const addLabels = csv("--add");
1843
+ const removeLabels = csv("--remove");
1844
+ if (addLabels.length === 0 && removeLabels.length === 0) {
1845
+ throw new UsageError(commandHelp("label"));
1846
+ }
1847
+ await ctx.adapter.update(id, {
1848
+ ...addLabels.length ? { addLabels } : {},
1849
+ ...removeLabels.length ? { removeLabels } : {}
1850
+ });
1851
+ invalidate(ctx);
1852
+ const parts = [
1853
+ ...addLabels.length ? [`+${addLabels.join(" +")}`] : [],
1854
+ ...removeLabels.length ? [`-${removeLabels.join(" -")}`] : []
1855
+ ];
1856
+ console.log(`#${id} labels: ${parts.join(" ")}`);
1857
+ }
1829
1858
  async function cmdAttach(ctx, args) {
1830
1859
  const [idArg, ...paths] = args.positionals;
1831
1860
  const id = normalizeId(idArg);
@@ -2164,6 +2193,7 @@ var VALUE_FLAGS = {
2164
2193
  comment: {},
2165
2194
  comments: { "--json": "bool" },
2166
2195
  attach: { "--message": "value", "--json": "bool" },
2196
+ label: { "--add": "value", "--remove": "value" },
2167
2197
  pr: {
2168
2198
  "--title": "value",
2169
2199
  "--description": "value",
@@ -2240,6 +2270,7 @@ ${HELP}`);
2240
2270
  comment: cmdComment,
2241
2271
  comments: cmdComments,
2242
2272
  attach: cmdAttach,
2273
+ label: cmdLabel,
2243
2274
  pr: cmdPr,
2244
2275
  spend: cmdSpend,
2245
2276
  estimate: cmdEstimate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trackerctl",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Multi-backend issue-tracking CLI for humans and AI agents — claim races, dependencies, hierarchy, local FTS search, project memory. GitLab adapter first.",
5
5
  "license": "MIT",
6
6
  "author": "refo",