linear-sdk-cli 0.1.0 → 0.1.2

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 (71) hide show
  1. package/CHANGELOG.md +46 -46
  2. package/COVERAGE.md +5 -5
  3. package/MIGRATING.md +69 -71
  4. package/README.md +88 -96
  5. package/package.json +8 -9
  6. package/skills/linear-sdk-cli/SKILL.md +3 -13
  7. package/skills/linear-sdk-cli/references/api.md +9 -9
  8. package/skills/linear-sdk-cli/references/auth.md +0 -18
  9. package/skills/linear-sdk-cli/references/commands.md +2 -2
  10. package/skills/linear-sdk-cli/references/config.md +11 -9
  11. package/skills/linear-sdk-cli/references/issue.md +12 -63
  12. package/skills/linear-sdk-cli/references/team.md +0 -16
  13. package/skills/linear-sdk-cli/scripts/generate-docs.ts +2 -6
  14. package/src/bin/linear.ts +6 -16
  15. package/src/cli.ts +1 -3
  16. package/src/commands/agent-session.ts +5 -13
  17. package/src/commands/api.ts +9 -15
  18. package/src/commands/attach.ts +4 -15
  19. package/src/commands/comment.ts +2 -6
  20. package/src/commands/completion.ts +6 -2
  21. package/src/commands/cycle.ts +1 -6
  22. package/src/commands/discover.ts +2 -6
  23. package/src/commands/document.ts +1 -4
  24. package/src/commands/initiative.ts +1 -5
  25. package/src/commands/issue.ts +88 -376
  26. package/src/commands/meta.ts +31 -139
  27. package/src/commands/milestone.ts +1 -4
  28. package/src/commands/notification.ts +6 -15
  29. package/src/commands/project.ts +4 -17
  30. package/src/commands/team.ts +0 -13
  31. package/src/commands/webhook.ts +2 -12
  32. package/src/config.ts +183 -500
  33. package/src/context.ts +4 -13
  34. package/src/git.ts +3 -28
  35. package/src/lib/body.ts +2 -26
  36. package/src/lib/errors.ts +7 -32
  37. package/src/lib/introspect.ts +7 -76
  38. package/src/lib/keyring.ts +9 -51
  39. package/src/lib/options.ts +12 -108
  40. package/src/lib/output-shapes.ts +9 -81
  41. package/src/lib/pagination.ts +17 -50
  42. package/src/lib/resolve.ts +7 -40
  43. package/src/lib/shape.ts +12 -16
  44. package/src/lib/upload.ts +1 -3
  45. package/src/output/format.ts +18 -96
  46. package/src/output/table.ts +7 -7
  47. package/src/services/agent-session.ts +3 -11
  48. package/src/services/attachment.ts +5 -14
  49. package/src/services/comment.ts +4 -12
  50. package/src/services/cycle.ts +4 -11
  51. package/src/services/document.ts +10 -29
  52. package/src/services/favorite.ts +9 -15
  53. package/src/services/initiative-update.ts +15 -16
  54. package/src/services/initiative.ts +10 -15
  55. package/src/services/issue.ts +18 -262
  56. package/src/services/label.ts +2 -12
  57. package/src/services/milestone.ts +5 -8
  58. package/src/services/notification.ts +2 -16
  59. package/src/services/organization.ts +18 -23
  60. package/src/services/project.ts +34 -55
  61. package/src/services/roadmap.ts +6 -7
  62. package/src/services/state.ts +3 -9
  63. package/src/services/team.ts +24 -67
  64. package/src/services/user.ts +2 -2
  65. package/src/services/webhook.ts +17 -28
  66. package/skills/linear-sdk-cli/references/open.md +0 -29
  67. package/src/commands/open.ts +0 -84
  68. package/src/lib/open.ts +0 -32
  69. package/src/output/color.ts +0 -52
  70. package/src/output/markdown.ts +0 -133
  71. package/src/output/pager.ts +0 -131
@@ -47,8 +47,12 @@ compdef _linear linear lin
47
47
  `;
48
48
  case "fish":
49
49
  return `# linear fish completion: linear completion fish > ~/.config/fish/completions/linear.fish
50
- ${commands.map((c) => `complete -c linear -n '__fish_use_subcommand' -a '${c}'`).join("\n")}
51
- ${commands.map((c) => `complete -c lin -n '__fish_use_subcommand' -a '${c}'`).join("\n")}
50
+ ${commands
51
+ .map((c) => `complete -c linear -n '__fish_use_subcommand' -a '${c}'`)
52
+ .join("\n")}
53
+ ${commands
54
+ .map((c) => `complete -c lin -n '__fish_use_subcommand' -a '${c}'`)
55
+ .join("\n")}
52
56
  `;
53
57
  }
54
58
  }
@@ -41,12 +41,7 @@ export function registerCycle(program: Command): void {
41
41
  .description("Show a cycle (by id, number, or 'current')")
42
42
  .action(
43
43
  action(async (ctx: Context, opts, id: string) => {
44
- const detail = await svc.getCycleDetail(
45
- ctx.client,
46
- id,
47
- opts.team ?? ctx.defaultTeam,
48
- ctx.defaultTeam,
49
- );
44
+ const detail = await svc.getCycleDetail(ctx.client, id, opts.team ?? ctx.defaultTeam, ctx.defaultTeam);
50
45
  emitDetail(ctx, detail);
51
46
  }),
52
47
  );
@@ -26,9 +26,7 @@ import type { Context } from "../context.js";
26
26
  export function registerCommands(program: Command): void {
27
27
  program
28
28
  .command("commands [path...]")
29
- .description(
30
- "List every command in a machine-readable tree, or describe one (for scripts/agents)",
31
- )
29
+ .description("List every command in a machine-readable tree, or describe one (for scripts/agents)")
32
30
  .addHelpText(
33
31
  "after",
34
32
  [
@@ -91,9 +89,7 @@ function renderTree(ctx: Context, nodes: CommandNode[], baseDepth = 0): void {
91
89
 
92
90
  /** One command in full: usage, aliases, options, and the `--json` output shape. */
93
91
  function renderOne(ctx: Context, n: CommandNode): void {
94
- ctx.output.line(
95
- `Usage: linear ${[n.path, n.options.length ? "[options]" : "", usageArgs(n)].filter(Boolean).join(" ")}`,
96
- );
92
+ ctx.output.line(`Usage: linear ${[n.path, n.options.length ? "[options]" : "", usageArgs(n)].filter(Boolean).join(" ")}`);
97
93
  if (n.description) ctx.output.line(` ${n.description}`);
98
94
  if (n.aliases.length) ctx.output.line(`Aliases: ${n.aliases.join(", ")}`);
99
95
  if (n.options.length) {
@@ -34,10 +34,7 @@ function addTargetOptions(cmd: Command, verb: string): Command {
34
34
  .option("-p, --project <name>", `${verb} a project (name or id)`)
35
35
  .option("--issue <id>", `${verb} an issue (identifier or id)`)
36
36
  .option("--initiative <name>", `${verb} an initiative (name or id)`)
37
- .option(
38
- CYCLE_FLAG,
39
- `${verb} a cycle (number, name, id, or 'current'; team from --team or config)`,
40
- )
37
+ .option(CYCLE_FLAG, `${verb} a cycle (number, name, id, or 'current'; team from --team or config)`)
41
38
  .option("--release <name>", `${verb} a release (name, version, or id)`);
42
39
  }
43
40
 
@@ -18,11 +18,7 @@ import type { Column } from "../output/table.js";
18
18
  const ROW_COLUMNS: Column<svc.InitiativeRow>[] = [
19
19
  { key: "name", header: "Name", value: (r) => r.name, max: 40 },
20
20
  { key: "status", header: "Status", value: (r) => r.status ?? "—", max: 12 },
21
- {
22
- key: "priority",
23
- header: "Pri",
24
- value: (r) => (r.priority ? svc.priorityLabel(r.priority) : "—"),
25
- },
21
+ { key: "priority", header: "Pri", value: (r) => (r.priority ? svc.priorityLabel(r.priority) : "—") },
26
22
  { key: "targetDate", header: "Target", value: (r) => r.targetDate ?? "—" },
27
23
  { key: "health", header: "Health", value: (r) => r.health ?? "—", max: 12 },
28
24
  ];