@ebragas/linear-cli 0.10.0 → 0.11.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 (2) hide show
  1. package/dist/cli.js +13 -13
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -897,7 +897,7 @@ async function resolveProject(client, project) {
897
897
  }
898
898
  async function resolveTeam(client, team) {
899
899
  if (/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(team)) {
900
- return team;
900
+ return { id: team, key: null };
901
901
  }
902
902
  const teams = await client.teams({
903
903
  filter: { name: { eqIgnoreCase: team } }
@@ -905,7 +905,7 @@ async function resolveTeam(client, team) {
905
905
  if (!teams.nodes[0]) {
906
906
  throw new ValidationError(`No team matching "${team}"`);
907
907
  }
908
- return teams.nodes[0].id;
908
+ return { id: teams.nodes[0].id, key: teams.nodes[0].key };
909
909
  }
910
910
  function registerIssueCommands(program2) {
911
911
  const issue = program2.command("issue").description("Create, read, update, and search issues");
@@ -1037,11 +1037,11 @@ function registerIssueCommands(program2) {
1037
1037
  }
1038
1038
  });
1039
1039
  });
1040
- issue.command("create").description("Create a new issue").requiredOption("--title <text>", "Issue title").requiredOption("--team <team>", "Team name or ID").option("--description <text>", "Markdown description").option("--description-file <path>", "Read description from file").option("--assignee <user>", "Assign to user").option("--delegate <agent>", "Delegate to agent").option("--state <state>", "Initial workflow state").option("--label <label>", "Add label (repeatable)", collectArray, []).option("--priority <priority>", "Priority level (0-4)").option("--project <project>", "Add to project").option("--parent <id>", "Set parent issue").option("--blocks <id>", "This issue blocks <id> (repeatable)", collectArray, []).option("--blocked-by <id>", "This issue is blocked by <id> (repeatable)", collectArray, []).option("--related-to <id>", "Related issue (repeatable)", collectArray, []).option("--due-date <date>", "Due date (ISO format)").option("--estimate <n>", "Effort estimate").action(async (opts, cmd) => {
1040
+ issue.command("create").description("Create a new issue").requiredOption("--title <text>", "Issue title").requiredOption("--team <team>", "Team name or ID").option("--description <text>", "Markdown description").option("--description-file <path>", "Read description from file").option("--assignee <user>", "Assign to user").option("--delegate <agent>", "Delegate to agent").option("--state <state>", "Initial workflow state (default: Todo)").option("--label <label>", "Add label (repeatable)", collectArray, []).option("--priority <priority>", "Priority level (0-4)").option("--project <project>", "Add to project").option("--parent <id>", "Set parent issue").option("--blocks <id>", "This issue blocks <id> (repeatable)", collectArray, []).option("--blocked-by <id>", "This issue is blocked by <id> (repeatable)", collectArray, []).option("--related-to <id>", "Related issue (repeatable)", collectArray, []).option("--due-date <date>", "Due date (ISO format)").option("--estimate <n>", "Effort estimate").action(async (opts, cmd) => {
1041
1041
  const globalOpts = cmd.optsWithGlobals();
1042
1042
  await runWithClient(globalOpts, async (client, { credentials, agentId, credentialsDir }) => {
1043
1043
  const format = getFormat(globalOpts.format);
1044
- const teamId = await resolveTeam(client, opts.team);
1044
+ const { id: teamId, key: teamKey } = await resolveTeam(client, opts.team);
1045
1045
  const input = {
1046
1046
  title: opts.title,
1047
1047
  teamId
@@ -1074,11 +1074,11 @@ function registerIssueCommands(program2) {
1074
1074
  client
1075
1075
  );
1076
1076
  }
1077
- if (opts.state) {
1078
- const team = await client.team(teamId);
1077
+ {
1078
+ const key = teamKey ?? (await client.team(teamId)).key;
1079
1079
  input.stateId = await resolveState(
1080
- opts.state,
1081
- team.key,
1080
+ opts.state ?? "Todo",
1081
+ key,
1082
1082
  client,
1083
1083
  agentId,
1084
1084
  credentialsDir
@@ -1280,7 +1280,7 @@ function registerIssueCommands(program2) {
1280
1280
  const format = getFormat(globalOpts.format);
1281
1281
  const searchOpts = {};
1282
1282
  if (opts.team) {
1283
- searchOpts.teamId = await resolveTeam(client, opts.team);
1283
+ searchOpts.teamId = (await resolveTeam(client, opts.team)).id;
1284
1284
  }
1285
1285
  if (opts.includeComments) {
1286
1286
  searchOpts.includeComments = true;
@@ -1344,7 +1344,7 @@ function registerIssueCommands(program2) {
1344
1344
  Object.keys(FREQUENCY_MAP)
1345
1345
  );
1346
1346
  }
1347
- const teamId = await resolveTeam(client, opts.team);
1347
+ const { id: teamId, key: teamKey } = await resolveTeam(client, opts.team);
1348
1348
  const interval = parseInt(opts.interval, 10);
1349
1349
  if (isNaN(interval) || interval < 1) {
1350
1350
  throw new ValidationError(
@@ -1371,10 +1371,10 @@ function registerIssueCommands(program2) {
1371
1371
  templateData.priority = priority;
1372
1372
  }
1373
1373
  if (opts.state) {
1374
- const team = await client.team(teamId);
1374
+ const key = teamKey ?? (await client.team(teamId)).key;
1375
1375
  templateData.stateId = await resolveState(
1376
1376
  opts.state,
1377
- team.key,
1377
+ key,
1378
1378
  client,
1379
1379
  agentId,
1380
1380
  credentialsDir
@@ -1397,7 +1397,7 @@ function registerIssueCommands(program2) {
1397
1397
  const globalOpts = cmd.optsWithGlobals();
1398
1398
  await runWithClient(globalOpts, async (client) => {
1399
1399
  const format = getFormat(globalOpts.format);
1400
- const teamId = opts.team ? await resolveTeam(client, opts.team) : null;
1400
+ const teamId = opts.team ? (await resolveTeam(client, opts.team)).id : null;
1401
1401
  const allTemplates = await client.templates;
1402
1402
  const filtered = await Promise.all(
1403
1403
  allTemplates.filter((t) => t.type === "recurringIssue").map(async (t) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebragas/linear-cli",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "CLI tool for AI agents to interact with Linear using per-agent OAuth identity",
5
5
  "bin": {
6
6
  "linear": "dist/cli.js"