@bdsqqq/lnr-cli 0.1.0 → 1.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bdsqqq/lnr-cli",
3
- "version": "0.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "cli for linear issue tracking",
5
5
  "type": "module",
6
6
  "private": false,
package/src/cli.ts CHANGED
@@ -9,13 +9,14 @@ import { registerCyclesCommand } from "./commands/cycles";
9
9
  import { registerMeCommand } from "./commands/me";
10
10
  import { registerSearchCommand } from "./commands/search";
11
11
  import { registerConfigCommand } from "./commands/config";
12
+ import pkg from "../package.json";
12
13
 
13
14
  const program = new Command();
14
15
 
15
16
  program
16
17
  .name("lnr")
17
18
  .description("command-line interface for Linear")
18
- .version("0.1.0");
19
+ .version(pkg.version);
19
20
 
20
21
  registerAuthCommand(program);
21
22
  registerIssuesCommand(program);
@@ -24,7 +24,7 @@ export function registerAuthCommand(program: Command): void {
24
24
  if (options.whoami) {
25
25
  const storedKey = getApiKey();
26
26
  if (!storedKey) {
27
- exitWithError("not authenticated", "run: li auth <api-key>", EXIT_CODES.AUTH_ERROR);
27
+ exitWithError("not authenticated", "run: lnr auth <api-key>", EXIT_CODES.AUTH_ERROR);
28
28
  }
29
29
 
30
30
  try {
@@ -32,13 +32,13 @@ export function registerAuthCommand(program: Command): void {
32
32
  const viewer = await getViewer(client);
33
33
  console.log(`${viewer.name} <${viewer.email}>`);
34
34
  } catch {
35
- exitWithError("invalid api key", "run: li auth <api-key>", EXIT_CODES.AUTH_ERROR);
35
+ exitWithError("invalid api key", "run: lnr auth <api-key>", EXIT_CODES.AUTH_ERROR);
36
36
  }
37
37
  return;
38
38
  }
39
39
 
40
40
  if (!apiKey) {
41
- exitWithError("api key required", "usage: li auth <api-key>");
41
+ exitWithError("api key required", "usage: lnr auth <api-key>");
42
42
  }
43
43
 
44
44
  try {
@@ -250,11 +250,11 @@ async function handleUpdateIssue(identifier: string, options: UpdateOptions): Pr
250
250
 
251
251
  async function handleCreateIssue(options: CreateOptions): Promise<void> {
252
252
  if (!options.team) {
253
- exitWithError("--team is required", "usage: li issue new --team ENG --title \"...\"");
253
+ exitWithError("--team is required", "usage: lnr issue new --team ENG --title \"...\"");
254
254
  }
255
255
 
256
256
  if (!options.title) {
257
- exitWithError("--title is required", "usage: li issue new --team ENG --title \"...\"");
257
+ exitWithError("--title is required", "usage: lnr issue new --team ENG --title \"...\"");
258
258
  }
259
259
 
260
260
  try {
@@ -28,7 +28,7 @@ interface CreateProjectOptions {
28
28
 
29
29
  async function handleCreateProject(options: CreateProjectOptions): Promise<void> {
30
30
  if (!options.name) {
31
- exitWithError("--name is required", "usage: li project new --name \"...\"");
31
+ exitWithError("--name is required", "usage: lnr project new --name \"...\"");
32
32
  }
33
33
 
34
34
  try {
package/src/lib/error.ts CHANGED
@@ -25,7 +25,7 @@ export function handleApiError(error: unknown): never {
25
25
  const msg = error.message.toLowerCase();
26
26
 
27
27
  if (msg.includes("unauthorized") || msg.includes("authentication")) {
28
- exitWithError("not authenticated", "run: li auth <api-key>", EXIT_CODES.AUTH_ERROR);
28
+ exitWithError("not authenticated", "run: lnr auth <api-key>", EXIT_CODES.AUTH_ERROR);
29
29
  }
30
30
 
31
31
  if (msg.includes("not found")) {