@kud/jira-cli 0.8.0 → 0.10.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.
package/README.md CHANGED
@@ -33,6 +33,7 @@ jira attachment list ABC-123
33
33
 
34
34
  jira attachment read ABC-123 error.log | grep -i timeout
35
35
  jira attachment get ABC-123 screen.png --output ~/Desktop/
36
+ jira attachment upload ABC-123 ./build.log ./screenshot.png
36
37
  ```
37
38
 
38
39
  Descriptions and comments render as Markdown, with embedded files named rather than left as opaque ids:
@@ -49,7 +50,7 @@ Run `jira` with no arguments:
49
50
  jira
50
51
  ```
51
52
 
52
- Your issues as a board. By default the tabs are Jira's three status *categories* — **To do**, **In progress**, **Done** — so it works on any instance without knowing what your board calls its columns. Pass `--board <id>` (or set `defaultBoard` in the config file) and the tabs become that board's own columns, matched by status id; statuses no column claims land on an **Off board** tab. Hand-written `tabs` in the config file win over both. Rows hang under their epic, carry a type pill, a priority glyph (`▲` high, `▼` low) and how long since they last moved. Closed work from the last fortnight is on the Done tab; `a` loads everything.
53
+ Your issues as a board. By default the tabs are Jira's three status _categories_ — **To do**, **In progress**, **Done** — so it works on any instance without knowing what your board calls its columns. Pass `--board <id>` (or set `defaultBoard` in the config file) and the tabs become that board's own columns, matched by status id; statuses no column claims land on an **Off board** tab. Hand-written `tabs` in the config file win over both. Rows hang under their epic, carry a type pill, a priority glyph (`▲` high, `▼` low) and how long since they last moved. Closed work from the last fortnight is on the Done tab; `a` loads everything.
53
54
 
54
55
  `↑↓` to move, `←→` (or `⇥`) to switch tab, `enter` to open, `?` for the legend, `r` to refresh. `q` quits from anywhere; `esc` or `⌫` goes back one level — a prompt, then the issue, then nothing.
55
56
 
@@ -91,14 +92,24 @@ jira issue edit ABC-123 --summary 'Better title'
91
92
  jira issue assign ABC-123 me # or a name, or 'none'
92
93
  jira issue comment add ABC-123 - # body from stdin
93
94
  jira issue comment list ABC-123
95
+ jira issue comment edit ABC-123 12345 'Actually fixed in 2.1'
96
+ jira issue delete ABC-123 # asks first; --yes to confirm in scripts
97
+ jira issue rank ABC-1 ABC-2 --before ABC-3
94
98
  jira issue link ABC-1 Blocks ABC-2
95
99
  jira issue watch add ABC-123
96
100
  jira issue worklog add ABC-123 '2h 30m'
101
+ jira issue worklog edit ABC-123 456 --time '3h'
102
+ jira issue worklog delete ABC-123 456
103
+ jira issue remotelink list ABC-123
104
+ jira issue remotelink add ABC-123 https://example.atlassian.net/wiki/spaces/ABC/pages/1234
105
+ jira issue remotelink remove ABC-123 789
97
106
  jira issue history ABC-123
98
107
  ```
99
108
 
100
109
  Bodies accept Markdown — paragraphs, headings, lists, fenced code, links and code spans are converted to ADF.
101
110
 
111
+ Deletes (`issue delete`, `comment delete`, `worklog delete`, `remotelink remove`) ask before they act; piped or scripted runs refuse unless `--yes` is passed, since there is no undo on Jira's side. `remotelink add` is idempotent: re-adding the same url updates the same link rather than creating duplicates.
112
+
102
113
  ## Projects, boards and sprints
103
114
 
104
115
  ```sh
@@ -115,6 +126,8 @@ jira epic ABC-100
115
126
 
116
127
  jira sprint list 42 --state active
117
128
  jira sprint issues 1234
129
+ jira sprint add 1234 ABC-1 ABC-2
130
+ jira backlog add ABC-1 ABC-2
118
131
  ```
119
132
 
120
133
  ## Knowing what this instance supports
package/dist/index.js CHANGED
@@ -75,6 +75,31 @@ var registerAttachmentCommands = (program2) => {
75
75
  `
76
76
  );
77
77
  });
78
+ attachment.command("upload <key> <file...>").description("attach files to an issue").option("--json", "emit JSON").action(
79
+ async (key, files, options) => {
80
+ const ctx = context();
81
+ const uploaded = [];
82
+ for (const file of files) {
83
+ try {
84
+ uploaded.push(...await ctx.client.uploadAttachment(key, file));
85
+ } catch (err) {
86
+ const done = uploaded.map((a) => a.filename).join(", ");
87
+ throw new Error(
88
+ `${file}: ${err.message}${done ? ` (already attached: ${done})` : ""}`
89
+ );
90
+ }
91
+ }
92
+ if (options.json) return printJson(uploaded);
93
+ process.stdout.write(
94
+ `${table(uploaded, [
95
+ { header: "ID", value: (a) => a.id },
96
+ { header: "FILENAME", value: (a) => a.filename },
97
+ { header: "SIZE", value: (a) => humanSize(a.size), align: "right" }
98
+ ])}
99
+ `
100
+ );
101
+ }
102
+ );
78
103
  attachment.command("read <key> <selector>").alias("cat").description("print a text attachment to stdout").action(async (key, selector) => {
79
104
  const ctx = context();
80
105
  const attachments = locateAttachments(await ctx.client.getIssue(key));
@@ -203,6 +228,11 @@ var registerSprintCommands = (program2) => {
203
228
  const { issues } = await ctx.client.getSprintIssues(Number(id));
204
229
  writeIssues(issues, options.json);
205
230
  });
231
+ sprint.command("add <sprintId> <keys...>").description("move issues into a sprint").action(async (sprintId, keys) => {
232
+ await context().client.moveIssuesToSprint(Number(sprintId), keys);
233
+ process.stderr.write(`moved ${keys.join(", ")} to sprint ${sprintId}
234
+ `);
235
+ });
206
236
  sprint.command("view <id>").description("show one sprint").option("--json", "emit JSON").action(async (id, options) => {
207
237
  const ctx = context();
208
238
  const found = await ctx.client.getSprint(Number(id));
@@ -226,17 +256,50 @@ var registerEpicCommands = (program2) => {
226
256
  writeIssues(issues, options.json);
227
257
  });
228
258
  };
259
+ var registerBacklogCommand = (program2) => {
260
+ const backlog = program2.command("backlog").description("backlog management");
261
+ backlog.command("add <keys...>").description("move issues to the backlog").action(async (keys) => {
262
+ await context().client.moveIssuesToBacklog(keys);
263
+ process.stderr.write(`moved ${keys.join(", ")} to the backlog
264
+ `);
265
+ });
266
+ };
229
267
 
230
268
  // src/commands/issue.ts
231
269
  import { execFile } from "child_process";
232
- import {
233
- adfToMarkdown as adfToMarkdown2,
234
- locateAttachments as locateAttachments2
235
- } from "@kud/jira";
270
+ import { adfToMarkdown as adfToMarkdown2, locateAttachments as locateAttachments2 } from "@kud/jira";
236
271
 
237
272
  // src/commands/issue-write.ts
238
273
  import { readFileSync } from "fs";
239
274
  import { adfToMarkdown, markdownToAdf } from "@kud/jira";
275
+
276
+ // src/commands/confirm.ts
277
+ import { createInterface } from "readline/promises";
278
+ var confirmDestructive = async (what, options) => {
279
+ if (options.yes) return;
280
+ if (!process.stdin.isTTY)
281
+ throw exitError(
282
+ 1,
283
+ `${what} is destructive \u2014 re-run with --yes to confirm it non-interactively`
284
+ );
285
+ const rl = createInterface({ input: process.stdin, output: process.stderr });
286
+ try {
287
+ const answer = await rl.question(`${what} \u2014 proceed? [y/N] `);
288
+ if (answer.trim().toLowerCase() !== "y") throw exitError(1, "aborted");
289
+ } finally {
290
+ rl.close();
291
+ }
292
+ };
293
+
294
+ // src/commands/issue-write.ts
295
+ var rankPosition = (options) => {
296
+ const { before, after } = options;
297
+ if (before && after) throw exitError(1, "pass --before or --after, not both");
298
+ if (!before && !after)
299
+ throw exitError(1, "pass one of --before <key> or --after <key>");
300
+ if (before) return { before };
301
+ return { after };
302
+ };
240
303
  var readBody = (value) => value === "-" ? readFileSync(0, "utf8") : value;
241
304
  var resolveAccountId = async (who, projectKey) => {
242
305
  if (who === "none" || who === "unassigned") return null;
@@ -293,6 +356,12 @@ var registerIssueWriteCommands = (issue) => {
293
356
  `);
294
357
  }
295
358
  );
359
+ issue.command("delete <key>").description("delete an issue, permanently").option("--yes", "skip the confirmation").action(async (key, options) => {
360
+ await confirmDestructive(`permanently delete ${key}`, options);
361
+ await context().client.deleteIssue(key);
362
+ process.stderr.write(`deleted ${key}
363
+ `);
364
+ });
296
365
  issue.command("assign <key> <who>").description("assign an issue; 'me' or 'none' both work").action(async (key, who) => {
297
366
  const accountId = await resolveAccountId(who);
298
367
  await context().client.assignIssue(key, accountId);
@@ -321,6 +390,26 @@ var registerIssueWriteCommands = (issue) => {
321
390
  process.stderr.write(`commented on ${key}
322
391
  `);
323
392
  });
393
+ comment.command("edit <key> <commentId> <text>").description("edit a comment; '-' reads stdin").action(async (key, commentId, text) => {
394
+ await context().client.updateComment(
395
+ key,
396
+ commentId,
397
+ markdownToAdf(readBody(text))
398
+ );
399
+ process.stderr.write(`comment ${commentId} on ${key} updated
400
+ `);
401
+ });
402
+ comment.command("delete <key> <commentId>").description("delete a comment").option("--yes", "skip the confirmation").action(
403
+ async (key, commentId, options) => {
404
+ await confirmDestructive(
405
+ `delete comment ${commentId} on ${key}`,
406
+ options
407
+ );
408
+ await context().client.deleteComment(key, commentId);
409
+ process.stderr.write(`deleted comment ${commentId} on ${key}
410
+ `);
411
+ }
412
+ );
324
413
  const watch = issue.command("watch").description("watchers");
325
414
  watch.command("list <key>").alias("ls").description("who is watching an issue").action(async (key) => {
326
415
  const { watchers } = await context().client.getWatchers(key);
@@ -369,6 +458,80 @@ var registerIssueWriteCommands = (issue) => {
369
458
  `);
370
459
  }
371
460
  );
461
+ worklog.command("edit <key> <worklogId>").description("change logged work").option("--time <timeSpent>", "new time spent, e.g. '1h 30m'").option("-b, --body <text>", "what you did; '-' reads stdin").option(
462
+ "--started <datetime>",
463
+ "start time, e.g. 2026-10-27T09:00:00.000+0000"
464
+ ).action(
465
+ async (key, worklogId, options) => {
466
+ if (!options.time && !options.body && !options.started)
467
+ throw exitError(2, "nothing to change \u2014 pass at least one option");
468
+ await context().client.updateWorklog(key, worklogId, {
469
+ ...options.time ? { timeSpent: options.time } : {},
470
+ ...options.body ? { comment: markdownToAdf(readBody(options.body)) } : {},
471
+ ...options.started ? { started: options.started } : {}
472
+ });
473
+ process.stderr.write(`worklog ${worklogId} on ${key} updated
474
+ `);
475
+ }
476
+ );
477
+ worklog.command("delete <key> <worklogId>").description("delete logged work").option("--yes", "skip the confirmation").action(
478
+ async (key, worklogId, options) => {
479
+ await confirmDestructive(
480
+ `delete worklog ${worklogId} on ${key}`,
481
+ options
482
+ );
483
+ await context().client.deleteWorklog(key, worklogId);
484
+ process.stderr.write(`deleted worklog ${worklogId} on ${key}
485
+ `);
486
+ }
487
+ );
488
+ const remotelink = issue.command("remotelink").description("links to pages outside Jira");
489
+ remotelink.command("list <key>").alias("ls").description("remote links on an issue").option("--json", "emit JSON").action(async (key, options) => {
490
+ const links = await context().client.getRemoteLinks(key);
491
+ if (options.json) return printJson(links);
492
+ if (links.length === 0) {
493
+ process.stderr.write(`${key} has no remote links
494
+ `);
495
+ return;
496
+ }
497
+ process.stdout.write(
498
+ `${table(links, [
499
+ { header: "ID", value: (l) => String(l.id) },
500
+ { header: "TITLE", value: (l) => l.object.title },
501
+ { header: "URL", value: (l) => l.object.url }
502
+ ])}
503
+ `
504
+ );
505
+ });
506
+ remotelink.command("add <key> <url>").description("link a url to an issue; re-adding the same url is a no-op").option("--title <text>", "link title, defaulting to the url").action(async (key, url, options) => {
507
+ await context().client.createRemoteLink(key, {
508
+ url,
509
+ title: options.title ?? url,
510
+ globalId: url
511
+ });
512
+ process.stderr.write(`linked ${url} to ${key}
513
+ `);
514
+ });
515
+ remotelink.command("remove <key> <linkId>").description("remove a remote link").option("--yes", "skip the confirmation").action(async (key, linkId, options) => {
516
+ await confirmDestructive(
517
+ `remove remote link ${linkId} from ${key}`,
518
+ options
519
+ );
520
+ await context().client.deleteRemoteLink(key, linkId);
521
+ process.stderr.write(`removed remote link ${linkId} from ${key}
522
+ `);
523
+ });
524
+ issue.command("rank <keys...>").description("order issues before or after another issue").option("--before <key>", "place the issues before this one").option("--after <key>", "place the issues after this one").action(
525
+ async (keys, options) => {
526
+ const position = rankPosition(options);
527
+ await context().client.rankIssues(keys, position);
528
+ const anchor = "before" in position ? position.before : position.after;
529
+ process.stderr.write(
530
+ `ranked ${keys.join(", ")} ${"before" in position ? "before" : "after"} ${anchor}
531
+ `
532
+ );
533
+ }
534
+ );
372
535
  issue.command("link <inward> <type> <outward>").description("link two issues, e.g. ABC-1 Blocks ABC-2").action(async (inward, type, outward) => {
373
536
  await context().client.linkIssues(type, inward, outward);
374
537
  process.stderr.write(`${inward} ${type} ${outward}
@@ -390,9 +553,7 @@ var registerIssueWriteCommands = (issue) => {
390
553
  };
391
554
 
392
555
  // src/commands/issue.ts
393
- import {
394
- buildJql
395
- } from "@kud/jira";
556
+ import { buildJql } from "@kud/jira";
396
557
  var issueColumns = (ctx) => [
397
558
  { header: "KEY", value: (i) => i.key },
398
559
  { header: "STATUS", value: (i) => i.fields.status?.name ?? "\u2014" },
@@ -807,7 +968,10 @@ var registerInitCommand = (program2) => {
807
968
  const path = configPath();
808
969
  const existing = readFileConfig(path);
809
970
  if (Object.keys(existing).length > 0 && !options.force)
810
- throw exitError(1, `${path} already exists \u2014 pass --force to replace it`);
971
+ throw exitError(
972
+ 1,
973
+ `${path} already exists \u2014 pass --force to replace it`
974
+ );
811
975
  const config = {
812
976
  baseUrl: options.baseUrl ?? process.env["ATLASSIAN_BASE_URL"] ?? "",
813
977
  email: options.email ?? process.env["ATLASSIAN_USER_EMAIL"] ?? "",
@@ -861,6 +1025,7 @@ registerInitCommand(program);
861
1025
  registerProjectCommands(program);
862
1026
  registerBoardCommands(program);
863
1027
  registerSprintCommands(program);
1028
+ registerBacklogCommand(program);
864
1029
  registerEpicCommands(program);
865
1030
  registerUserCommands(program);
866
1031
  registerMetaCommands(program);
@@ -909,7 +1074,7 @@ var interactiveArgs = (argv) => {
909
1074
  var main = async () => {
910
1075
  const { screen, mock, board, isBare } = interactiveArgs(process.argv);
911
1076
  if (screen === "list" && isBare) {
912
- const { SCREENS } = await import("./tui-HYJNQNH4.js");
1077
+ const { SCREENS } = await import("./tui-5ILW4QX4.js");
913
1078
  process.stdout.write(`${SCREENS.join("\n")}
914
1079
  `);
915
1080
  return;
@@ -919,7 +1084,7 @@ var main = async () => {
919
1084
  program.outputHelp();
920
1085
  return;
921
1086
  }
922
- const { runTui } = await import("./tui-HYJNQNH4.js");
1087
+ const { runTui } = await import("./tui-5ILW4QX4.js");
923
1088
  const [, key] = (screen ?? "").split(":");
924
1089
  await runTui({
925
1090
  screen: screen?.startsWith("detail") ? "detail" : "issues",
@@ -16,11 +16,12 @@ import {
16
16
  TextInput,
17
17
  useAppKeys
18
18
  } from "@kud/ink-ui";
19
- import { Box, Text, useApp, useInput, useStdout } from "ink";
19
+ import { Box, Text, useApp, useInput, useWindowSize } from "ink";
20
20
  import { useCallback, useEffect, useState } from "react";
21
21
  import { errorMessagesOf, isJiraApiError } from "@kud/jira";
22
22
  import {
23
23
  IssueBoard,
24
+ IssueBoardSkeleton,
24
25
  IssueDetailView,
25
26
  pendingRow,
26
27
  settleRow,
@@ -31,8 +32,6 @@ import {
31
32
  import { Page } from "@kud/ink-ui";
32
33
  import { jsx } from "react/jsx-runtime";
33
34
  var Frame = ({
34
- width,
35
- height,
36
35
  facts,
37
36
  count,
38
37
  user,
@@ -41,6 +40,7 @@ var Frame = ({
41
40
  hints,
42
41
  page = "root",
43
42
  gap = true,
43
+ help,
44
44
  children
45
45
  }) => /* @__PURE__ */ jsx(
46
46
  Page,
@@ -55,8 +55,8 @@ var Frame = ({
55
55
  hints,
56
56
  page,
57
57
  gap,
58
- width,
59
- height,
58
+ help,
59
+ fill: true,
60
60
  children
61
61
  }
62
62
  );
@@ -69,9 +69,7 @@ var MIN_WIDTH = 60;
69
69
  var MIN_HEIGHT = 12;
70
70
  var App = ({ data, initialScreen, initialKey }) => {
71
71
  const { exit } = useApp();
72
- const { stdout } = useStdout();
73
- const width = stdout?.columns ?? 80;
74
- const height = stdout?.rows ?? 24;
72
+ const { columns: width, rows: height } = useWindowSize();
75
73
  const [screen, setScreen] = useState(initialScreen);
76
74
  const [model, setModel] = useState(null);
77
75
  const [viewer, setViewer] = useState("you");
@@ -85,22 +83,26 @@ var App = ({ data, initialScreen, initialKey }) => {
85
83
  const [error, setError] = useState(null);
86
84
  const [busy, setBusy] = useState(null);
87
85
  const [parents, setParents] = useState([]);
86
+ const [tabs, setTabs] = useState(null);
87
+ const [refreshing, setRefreshing] = useState(false);
88
88
  const [flash, setFlash] = useState(null);
89
89
  const [moving, setMoving] = useState(null);
90
90
  const loadList = useCallback(
91
91
  async (all) => {
92
92
  setError(null);
93
- setModel(null);
94
- setScope({ kind: "mine" });
95
93
  setSearchError(null);
94
+ setRefreshing(true);
96
95
  try {
97
96
  const next = await data.board(all);
98
97
  setModel(next);
98
+ setScope({ kind: "mine" });
99
99
  setLoadedAt(Date.now());
100
100
  void data.parents(next.rows).then(setParents).catch(() => {
101
101
  });
102
102
  } catch (e) {
103
103
  setError(e instanceof Error ? e.message : String(e));
104
+ } finally {
105
+ setRefreshing(false);
104
106
  }
105
107
  },
106
108
  [data]
@@ -121,6 +123,7 @@ var App = ({ data, initialScreen, initialKey }) => {
121
123
  const runSearch = useCallback(
122
124
  async (query, mode) => {
123
125
  setSearchError(null);
126
+ setRefreshing(true);
124
127
  try {
125
128
  const result = await data.search(query, mode);
126
129
  setModel(result.model);
@@ -130,6 +133,8 @@ var App = ({ data, initialScreen, initialKey }) => {
130
133
  setLoadedAt(Date.now());
131
134
  } catch (e) {
132
135
  setSearchError(jiraMessageOf(e));
136
+ } finally {
137
+ setRefreshing(false);
133
138
  }
134
139
  },
135
140
  [data]
@@ -156,6 +161,16 @@ var App = ({ data, initialScreen, initialKey }) => {
156
161
  void data.me().then((me) => setViewer(me.displayName)).catch(() => {
157
162
  });
158
163
  }, [data]);
164
+ useEffect(() => {
165
+ let cancelled = false;
166
+ data.tabs().then((t) => {
167
+ if (!cancelled) setTabs(t);
168
+ }).catch(() => {
169
+ });
170
+ return () => {
171
+ cancelled = true;
172
+ };
173
+ }, [data]);
159
174
  useEffect(() => {
160
175
  if (initialScreen === "detail" && initialKey) void loadIssue(initialKey);
161
176
  else void loadList(false);
@@ -196,7 +211,7 @@ var App = ({ data, initialScreen, initialKey }) => {
196
211
  "."
197
212
  ] });
198
213
  }
199
- const framed = (facts, body, hints, page = screen === "detail" ? "nested" : "root") => /* @__PURE__ */ jsx2(Frame, { width, height, facts, hints, page, children: /* @__PURE__ */ jsx2(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 2, flexGrow: 1, children: body }) });
214
+ const framed = (facts, body, hints, page = screen === "detail" ? "nested" : "root") => /* @__PURE__ */ jsx2(Frame, { facts, hints, page, children: /* @__PURE__ */ jsx2(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 2, flexGrow: 1, children: body }) });
200
215
  if (error)
201
216
  return framed("error", /* @__PURE__ */ jsx2(Alert, { variant: "error", children: error }), [
202
217
  ["r", "retry"]
@@ -302,33 +317,23 @@ var App = ({ data, initialScreen, initialKey }) => {
302
317
  issue,
303
318
  width,
304
319
  height: height - FRAME_CHROME - DETAIL_CHROME,
305
- frame: ({ title, subtitle, hints, body }) => /* @__PURE__ */ jsxs(
306
- Frame,
307
- {
308
- width,
309
- height,
310
- scope: title,
311
- hints: hints.filter(([k]) => k !== "\u232B"),
312
- page: "nested",
313
- children: [
314
- /* @__PURE__ */ jsxs(Box, { paddingLeft: 2, children: [
315
- /* @__PURE__ */ jsx2(Text, { dimColor: true, children: subtitle }),
316
- moving === issue.key ? /* @__PURE__ */ jsx2(Text, { color: colors.accent, children: " \u22EF moving" }) : null
317
- ] }),
318
- flash ? /* @__PURE__ */ jsx2(Box, { paddingLeft: 2, children: /* @__PURE__ */ jsx2(Text, { color: colors.error, children: `\u2717 ${flash}` }) }) : null,
319
- /* @__PURE__ */ jsx2(
320
- Box,
321
- {
322
- flexDirection: "column",
323
- marginTop: 1,
324
- paddingLeft: 2,
325
- flexGrow: 1,
326
- children: body
327
- }
328
- )
329
- ]
330
- }
331
- ),
320
+ frame: ({ title, subtitle, hints, body }) => /* @__PURE__ */ jsxs(Frame, { scope: title, hints: hints.filter(([k]) => k !== "\u232B"), page: "nested", children: [
321
+ /* @__PURE__ */ jsxs(Box, { paddingLeft: 2, children: [
322
+ /* @__PURE__ */ jsx2(Text, { dimColor: true, children: subtitle }),
323
+ moving === issue.key ? /* @__PURE__ */ jsx2(Text, { color: colors.accent, children: " \u22EF moving" }) : null
324
+ ] }),
325
+ flash ? /* @__PURE__ */ jsx2(Box, { paddingLeft: 2, children: /* @__PURE__ */ jsx2(Text, { color: colors.error, children: `\u2717 ${flash}` }) }) : null,
326
+ /* @__PURE__ */ jsx2(
327
+ Box,
328
+ {
329
+ flexDirection: "column",
330
+ marginTop: 1,
331
+ paddingLeft: 2,
332
+ flexGrow: 1,
333
+ children: body
334
+ }
335
+ )
336
+ ] }),
332
337
  onBack: () => setScreen("issues"),
333
338
  onOpenBrowser: () => execFile(opener(), [issue.url]),
334
339
  onAssign: () => setOverlay({ kind: "assign" }),
@@ -350,33 +355,45 @@ var App = ({ data, initialScreen, initialKey }) => {
350
355
  }
351
356
  );
352
357
  }
353
- if (!model) return framed("loading\u2026", /* @__PURE__ */ jsx2(Spinner, { label: "Loading issues\u2026" }));
358
+ const boardHeight = height - (FRAME_CHROME - 1) - 1;
359
+ const boardFrame = (help) => ({ title, hints, body }) => /* @__PURE__ */ jsx2(
360
+ Frame,
361
+ {
362
+ count: title.count ?? void 0,
363
+ user: title.user,
364
+ scope: title.scope,
365
+ status: refreshing && model ? { text: "\u21BB refreshing\u2026", tone: "busy" } : title.status,
366
+ hints,
367
+ gap: false,
368
+ help,
369
+ children: body
370
+ }
371
+ );
372
+ if (!model) {
373
+ if (!tabs) return framed("loading\u2026", /* @__PURE__ */ jsx2(Spinner, { label: "Loading issues\u2026" }));
374
+ return /* @__PURE__ */ jsx2(
375
+ IssueBoardSkeleton,
376
+ {
377
+ tabs,
378
+ width,
379
+ height: boardHeight,
380
+ frame: boardFrame(false)
381
+ }
382
+ );
383
+ }
354
384
  return /* @__PURE__ */ jsx2(
355
385
  IssueBoard,
356
386
  {
357
387
  model,
358
388
  parents,
359
- frame: ({ title, hints, body }) => /* @__PURE__ */ jsx2(
360
- Frame,
361
- {
362
- width,
363
- height,
364
- count: title.count,
365
- user: title.user,
366
- scope: title.scope,
367
- status: title.status,
368
- hints,
369
- gap: false,
370
- children: body
371
- }
372
- ),
389
+ frame: boardFrame(),
373
390
  onInputFocus: setInputFocused,
374
391
  viewer,
375
392
  loadedAt,
376
393
  scope,
377
394
  searchError,
378
395
  width,
379
- height: height - (FRAME_CHROME - 1) - 1,
396
+ height: boardHeight,
380
397
  showingAll,
381
398
  onOpen: (key) => void loadIssue(key),
382
399
  onRefresh: () => void (scope.kind === "search" ? runSearch(scope.query, scope.mode) : loadList(showingAll)),
@@ -399,6 +416,9 @@ import {
399
416
  boardOf,
400
417
  issueDetailOf,
401
418
  parentsOf,
419
+ tabsFromBoard,
420
+ tabsFromConfig,
421
+ tabsFromCategories,
402
422
  transitionsOf,
403
423
  withBehind
404
424
  } from "@kud/jira-ink";
@@ -407,6 +427,13 @@ var boardOptions = (ctx) => ({
407
427
  ...ctx.config.tabs ? { tabs: ctx.config.tabs } : {},
408
428
  ...ctx.board ?? ctx.config.defaultBoard !== void 0 ? { board: ctx.board ?? ctx.config.defaultBoard } : {}
409
429
  });
430
+ var tabsOf = async (ctx) => {
431
+ const { tabs, board } = boardOptions(ctx);
432
+ if (tabs?.length) return tabsFromConfig(tabs);
433
+ if (board === void 0) return tabsFromCategories();
434
+ const configuration = await ctx.client.getBoardConfiguration(board);
435
+ return tabsFromBoard(configuration) ?? tabsFromCategories();
436
+ };
410
437
  var marked = (model) => ({
411
438
  ...model,
412
439
  rows: withBehind(model.rows, model.tabs)
@@ -420,6 +447,7 @@ var liveData = (ctx = context()) => ({
420
447
  boardOptions(ctx)
421
448
  )
422
449
  ),
450
+ tabs: () => tabsOf(ctx),
423
451
  parents: (rows) => parentsOf(ctx.client, rows),
424
452
  me: async () => ({ displayName: (await ctx.client.getMe()).displayName }),
425
453
  search: async (query, mode) => {
@@ -527,6 +555,7 @@ var fallbackDetail = (key) => {
527
555
  var mockData = () => ({
528
556
  baseUrl: "https://example.atlassian.net",
529
557
  board: async () => mockBoard(),
558
+ tabs: async () => mockBoard().tabs,
530
559
  me: async () => ({ displayName: "Ada Okafor" }),
531
560
  search: async (query, mode) => {
532
561
  const used = mode === "jql" || mode === "auto" && looksLikeJql(query) ? "jql" : "text";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/jira-cli",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "description": "Jira on the command line — read issues, comments and attachments as plain text",
6
6
  "keywords": [
@@ -37,9 +37,9 @@
37
37
  "prepublishOnly": "npm run build"
38
38
  },
39
39
  "dependencies": {
40
- "@kud/ink-ui": "0.28.2",
41
- "@kud/jira": "0.4.0",
42
- "@kud/jira-ink": "0.10.0",
40
+ "@kud/ink-ui": "0.32.0",
41
+ "@kud/jira": "0.5.0",
42
+ "@kud/jira-ink": "0.11.0",
43
43
  "commander": "14.0.1",
44
44
  "ink": "7.1.1",
45
45
  "react": "19.2.5"