@levr-one/cli 0.6.11 → 0.7.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/dist/cli.js CHANGED
@@ -87,6 +87,18 @@ or when generating a script for a shell other than the one you are running.`
87
87
 
88
88
  //#endregion
89
89
  //#region src/commands/mcp/add.ts
90
+ const SCOPES = [
91
+ "user",
92
+ "project",
93
+ "local"
94
+ ];
95
+ /** Validate `--scope` at parse time so a typo fails before anything is read. */
96
+ function parseScope(raw) {
97
+ const value = raw.trim().toLowerCase();
98
+ const match = SCOPES.find((s) => s === value);
99
+ if (!match) throw new Error(`invalid --scope "${raw}" (expected one of: ${SCOPES.join(", ")})`);
100
+ return match;
101
+ }
90
102
  const mcpAddCommand = buildCommand({
91
103
  docs: {
92
104
  brief: "Add the Levr MCP server to installed AI clients",
@@ -95,16 +107,27 @@ Claude Code, Cursor, Windsurf, Zed) and write the Levr MCP server into each
95
107
  one's config. The entry is credential-free — the client opens a browser to
96
108
  authorize with Levr the first time it connects.
97
109
 
110
+ --scope decides where the entry lands:
111
+ user every project you open (the default)
112
+ project this repository, shared with everyone who checks it out
113
+ local this repository, only you (Claude Code only)
114
+
115
+ Not every client supports every scope — Claude Desktop and Windsurf are
116
+ user-only. A client you name with --client fails if it cannot honor the
117
+ scope you asked for; one picked up by --all or interactively falls back to
118
+ the scope it does support, and the report says so.
119
+
98
120
  Interactive by default; non-interactive when --all/--client/--yes is passed
99
121
  or when not running in a terminal (CI). Config edits preserve existing
100
122
  servers and comments, and re-running is a no-op.
101
123
 
102
124
  Examples:
103
- npx @levr-one/cli mcp add # detect clients and pick interactively
104
- levr mcp add --all # set up every detected client
125
+ npx @levr-one/cli mcp add # detect clients and pick interactively
126
+ levr mcp add --all # set up every detected client
105
127
  levr mcp add --client cursor --yes
106
- levr mcp add --dry-run # preview without writing
107
- levr mcp add --url <mcp-url> # target a non-default MCP server`
128
+ levr mcp add --scope project # commit the config to this repo
129
+ levr mcp add --dry-run # preview without writing
130
+ levr mcp add --url <mcp-url> # target a non-default MCP server`
108
131
  },
109
132
  parameters: {
110
133
  flags: {
@@ -131,6 +154,13 @@ Examples:
131
154
  default: false,
132
155
  brief: "Show changes without writing"
133
156
  },
157
+ scope: {
158
+ kind: "parsed",
159
+ parse: parseScope,
160
+ brief: "Where to install: user (default), project, or local",
161
+ placeholder: "user|project|local",
162
+ optional: true
163
+ },
134
164
  url: {
135
165
  kind: "parsed",
136
166
  parse: String,
@@ -142,7 +172,7 @@ Examples:
142
172
  aliases: { y: "yes" }
143
173
  },
144
174
  loader: async () => {
145
- const { mcpAddHandler } = await import("./addHandler-K2a4rVv8.js");
175
+ const { mcpAddHandler } = await import("./addHandler-7QMKiy7o.js");
146
176
  return mcpAddHandler;
147
177
  }
148
178
  });
@@ -180,7 +210,7 @@ Examples:
180
210
  aliases: { d: "device-code" }
181
211
  },
182
212
  loader: async () => {
183
- const { loginHandler } = await import("./loginHandler-D56sEnhy.js");
213
+ const { loginHandler } = await import("./loginHandler-BE8MQq83.js");
184
214
  return loginHandler;
185
215
  }
186
216
  });
@@ -219,7 +249,7 @@ Examples:
219
249
  },
220
250
  parameters: {},
221
251
  loader: async () => {
222
- const { statusHandler } = await import("./statusHandler-CRmMO6Xa.js");
252
+ const { statusHandler } = await import("./statusHandler-C2_XOUal.js");
223
253
  return statusHandler;
224
254
  }
225
255
  });
@@ -331,7 +361,7 @@ Examples:
331
361
  }
332
362
  },
333
363
  loader: async () => {
334
- const { pushHandler } = await import("./pushHandler-C0p7-lEN.js");
364
+ const { pushHandler } = await import("./pushHandler-Bf1F1Ltk.js");
335
365
  return pushHandler;
336
366
  }
337
367
  });
@@ -443,7 +473,7 @@ Examples:
443
473
  }
444
474
  },
445
475
  loader: async () => {
446
- const { importHandler } = await import("./importHandler-C8egfsZc.js");
476
+ const { importHandler } = await import("./importHandler-D43Q8Jey.js");
447
477
  return importHandler;
448
478
  }
449
479
  });
@@ -464,7 +494,7 @@ Examples:
464
494
  },
465
495
  parameters: {},
466
496
  loader: async () => {
467
- const { listHandler } = await import("./listHandler-BtzZD16V.js");
497
+ const { listHandler } = await import("./listHandler-jEyTQhBk.js");
468
498
  return listHandler;
469
499
  }
470
500
  });
@@ -497,7 +527,7 @@ Examples:
497
527
  flags: {}
498
528
  },
499
529
  loader: async () => {
500
- const { selectHandler } = await import("./selectHandler-C5fOwJXj.js");
530
+ const { selectHandler } = await import("./selectHandler-KNiDUd9H.js");
501
531
  return selectHandler;
502
532
  }
503
533
  });
@@ -521,7 +551,7 @@ Examples:
521
551
 
522
552
  //#endregion
523
553
  //#region package.json
524
- var version = "0.6.11";
554
+ var version = "0.7.0";
525
555
 
526
556
  //#endregion
527
557
  //#region src/app.ts
@@ -1,7 +1,7 @@
1
1
  import { getApiUrl } from "./env-CHeKHu5S.js";
2
- import { configureClient, testCaseImportCommitV1, testCaseImportPreviewV1 } from "./sdk-client-PqFsqPIp.js";
2
+ import { configureClient, testCaseImportCommitV1, testCaseImportPreviewV1 } from "./sdk-client-DKifoBwD.js";
3
3
  import "./workspace-store-DDOxnut1.js";
4
- import { resolveWorkspace } from "./resolve-workspace-DzHM22K6.js";
4
+ import { resolveWorkspace } from "./resolve-workspace-DfEX0LDh.js";
5
5
  import "./token-refresh-Cu5RpkLJ.js";
6
6
  import { resolveToken } from "./resolve-token-DbQsmn03.js";
7
7
  import chalk from "chalk";
@@ -1,5 +1,5 @@
1
1
  import "./env-CHeKHu5S.js";
2
- import { authGetSitesV1, configureClient } from "./sdk-client-PqFsqPIp.js";
2
+ import { authGetSitesV1, configureClient } from "./sdk-client-DKifoBwD.js";
3
3
  import { loadWorkspace } from "./workspace-store-DDOxnut1.js";
4
4
  import "./token-refresh-Cu5RpkLJ.js";
5
5
  import { resolveToken } from "./resolve-token-DbQsmn03.js";
@@ -1,7 +1,7 @@
1
1
  import { CLI_CLIENT_ID, getApiUrl, getAuthUrl, setSessionApiUrl, writeCredentials } from "./env-CHeKHu5S.js";
2
- import { configureClient } from "./sdk-client-PqFsqPIp.js";
2
+ import { configureClient } from "./sdk-client-DKifoBwD.js";
3
3
  import "./workspace-store-DDOxnut1.js";
4
- import { autoSelectWorkspace } from "./resolve-workspace-DzHM22K6.js";
4
+ import { autoSelectWorkspace } from "./resolve-workspace-DfEX0LDh.js";
5
5
  import chalk from "chalk";
6
6
  import { createHash, randomBytes } from "node:crypto";
7
7
  import { createServer } from "node:http";
@@ -1,7 +1,7 @@
1
1
  import { getApiUrl, getAutomationSourceIdOverride, getSourceOverride, getTeamId } from "./env-CHeKHu5S.js";
2
- import { client, configureClient, uploadAutomationIngest, uploadImport } from "./sdk-client-PqFsqPIp.js";
2
+ import { client, configureClient, uploadAutomationIngest, uploadImport } from "./sdk-client-DKifoBwD.js";
3
3
  import "./workspace-store-DDOxnut1.js";
4
- import { resolveWorkspace } from "./resolve-workspace-DzHM22K6.js";
4
+ import { resolveWorkspace } from "./resolve-workspace-DfEX0LDh.js";
5
5
  import "./token-refresh-Cu5RpkLJ.js";
6
6
  import { resolveToken } from "./resolve-token-DbQsmn03.js";
7
7
  import { readFileSync, statSync } from "node:fs";
@@ -1,4 +1,4 @@
1
- import { authGetSitesV1 } from "./sdk-client-PqFsqPIp.js";
1
+ import { authGetSitesV1 } from "./sdk-client-DKifoBwD.js";
2
2
  import { clearWorkspace, loadWorkspace, saveWorkspace } from "./workspace-store-DDOxnut1.js";
3
3
 
4
4
  //#region src/workspace/resolve-workspace.ts
@@ -12981,6 +12981,35 @@ const zFindingObservationBulkOperationV1Data = z.object({
12981
12981
  url: z.literal("/v1/finding-observation/bulk")
12982
12982
  });
12983
12983
 
12984
+ //#endregion
12985
+ //#region ../sdk/dist/gen/first-run/zod.js
12986
+ const zFirstRunStatusDto = z.object({
12987
+ state: z.enum([
12988
+ "welcome",
12989
+ "reminder",
12990
+ "hidden"
12991
+ ]),
12992
+ mcpUrl: z.string(),
12993
+ cliCommand: z.string(),
12994
+ connected: z.array(z.object({
12995
+ id: z.string(),
12996
+ label: z.string(),
12997
+ grantedAt: z.string().nullable()
12998
+ })),
12999
+ harnesses: z.array(z.object({
13000
+ id: z.string(),
13001
+ label: z.string(),
13002
+ installKind: z.enum(["config-file", "cli-command"]),
13003
+ snippet: z.string(),
13004
+ docsUrl: z.string(),
13005
+ comingSoon: z.boolean()
13006
+ }))
13007
+ });
13008
+ const zFirstRunGetStatusV1Data = z.object({ url: z.literal("/v1/first-run/mcp") });
13009
+ const zFirstRunMarkSeenV1Data = z.object({ url: z.literal("/v1/first-run/mcp/seen") });
13010
+ const zFirstRunDeclineV1Data = z.object({ url: z.literal("/v1/first-run/mcp/decline") });
13011
+ const zFirstRunHideReminderV1Data = z.object({ url: z.literal("/v1/first-run/mcp/hide-reminder") });
13012
+
12984
13013
  //#endregion
12985
13014
  //#region ../sdk/dist/gen/folder/zod.js
12986
13015
  const zFolderWithChildrenDto = z.object({
@@ -1,5 +1,5 @@
1
1
  import "./env-CHeKHu5S.js";
2
- import { authGetSitesV1, configureClient } from "./sdk-client-PqFsqPIp.js";
2
+ import { authGetSitesV1, configureClient } from "./sdk-client-DKifoBwD.js";
3
3
  import { saveWorkspace } from "./workspace-store-DDOxnut1.js";
4
4
  import "./token-refresh-Cu5RpkLJ.js";
5
5
  import { resolveToken } from "./resolve-token-DbQsmn03.js";
@@ -1,5 +1,5 @@
1
1
  import { getApiUrl, getPatToken, readCredentials } from "./env-CHeKHu5S.js";
2
- import { authGetProfileV1, configureClient } from "./sdk-client-PqFsqPIp.js";
2
+ import { authGetProfileV1, configureClient } from "./sdk-client-DKifoBwD.js";
3
3
  import { isTokenExpired } from "./token-refresh-Cu5RpkLJ.js";
4
4
  import chalk from "chalk";
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levr-one/cli",
3
- "version": "0.6.11",
3
+ "version": "0.7.0",
4
4
  "description": "The command-line interface for Levr",
5
5
  "type": "module",
6
6
  "license": "MIT",