@sylphx/cli 0.14.10 → 0.14.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @sylphx/cli
2
2
 
3
+ ## 0.14.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1676](https://github.com/SylphxAI/platform/pull/1676) [`5b5c27d`](https://github.com/SylphxAI/platform/commit/5b5c27d1508b4dcca01f064257555f33db162728) Thanks [@shtse8](https://github.com/shtse8)! - Use the linked project organization when listing deployments and logs without an explicit `--org`, so multi-organization accounts do not fall back to the configured default organization and receive `Project not found`.
8
+
9
+ Keep `org` and `orgs` command help isolated so the alias does not render duplicated nested paths such as `org org members list`.
10
+
3
11
  ## 0.14.10
4
12
 
5
13
  ### Patch Changes
package/dist/main.js CHANGED
@@ -15,7 +15,7 @@ var init_package = __esm({
15
15
  "package.json"() {
16
16
  package_default = {
17
17
  name: "@sylphx/cli",
18
- version: "0.14.10",
18
+ version: "0.14.11",
19
19
  description: "Sylphx Platform CLI \u2014 deploy and manage your applications from the terminal. 63 commands across deployment, logs, env vars, domains, databases, storage, monitoring, self-service (user), admin (users/quotas/audit/invitations/jwt-keys/project-migrate), and more.",
20
20
  type: "module",
21
21
  homepage: "https://sylphx.com",
@@ -21875,9 +21875,10 @@ var requireLinkedProjectEffect = Effect9.gen(function* () {
21875
21875
  }
21876
21876
  return linked;
21877
21877
  });
21878
- function resolveOrgScopeEffect(command, org) {
21878
+ function resolveOrgScopeEffect(command, org, options = {}) {
21879
21879
  const explicit = org?.trim();
21880
21880
  if (explicit) return resolveOrgRefEffect(command, explicit);
21881
+ if (options.linkedOrgId) return Effect9.succeed(options.linkedOrgId);
21881
21882
  return Effect9.gen(function* () {
21882
21883
  const cfg = yield* ConfigService;
21883
21884
  const configured = yield* cfg.getDefaultOrg;
@@ -21912,7 +21913,8 @@ function resolveProjectTargetEffect(project) {
21912
21913
  return requireLinkedProjectEffect.pipe(
21913
21914
  Effect9.map((linked) => ({
21914
21915
  projectId: linked.projectId,
21915
- defaultEnv: linked.defaultEnv ?? "production"
21916
+ defaultEnv: linked.defaultEnv ?? "production",
21917
+ orgId: linked.orgId
21916
21918
  }))
21917
21919
  );
21918
21920
  }
@@ -27294,13 +27296,18 @@ function printBuildDetail(build) {
27294
27296
  function deploymentsListEffect(opts) {
27295
27297
  return Effect29.gen(function* () {
27296
27298
  yield* requireAuthEffect;
27297
- const orgId = yield* resolveOrgScopeEffect("deployments", opts.org);
27298
- const target = opts.project ? yield* resolveProjectTargetWithApiEffect("deployments", opts.project, orgId) : yield* requireLinkedProjectEffect.pipe(
27299
+ const explicitOrgId = opts.project ? yield* resolveOrgScopeEffect("deployments", opts.org) : void 0;
27300
+ const target = opts.project ? yield* resolveProjectTargetWithApiEffect("deployments", opts.project, explicitOrgId) : yield* requireLinkedProjectEffect.pipe(
27299
27301
  Effect29.map((linked) => ({
27300
27302
  projectId: linked.projectId,
27301
- defaultEnv: linked.defaultEnv ?? "production"
27303
+ defaultEnv: linked.defaultEnv ?? "production",
27304
+ orgId: linked.orgId
27302
27305
  }))
27303
27306
  );
27307
+ let orgId = explicitOrgId;
27308
+ if (!orgId) {
27309
+ orgId = yield* resolveOrgScopeEffect("deployments", opts.org, { linkedOrgId: target.orgId });
27310
+ }
27304
27311
  const api2 = yield* ApiService;
27305
27312
  const envType = opts.env ?? target.defaultEnv;
27306
27313
  const history3 = yield* withSpinner(
@@ -31252,13 +31259,18 @@ function logsEffect(input) {
31252
31259
  }
31253
31260
  yield* requireAuthEffect;
31254
31261
  const api2 = yield* ApiService;
31255
- const orgId = yield* resolveOrgScopeEffect("logs", input.org);
31256
- const targetProject = input.project ? yield* resolveProjectTargetWithApiEffect("logs", input.project, orgId) : yield* requireLinkedProjectEffect.pipe(
31262
+ const explicitOrgId = input.project ? yield* resolveOrgScopeEffect("logs", input.org) : void 0;
31263
+ const targetProject = input.project ? yield* resolveProjectTargetWithApiEffect("logs", input.project, explicitOrgId) : yield* requireLinkedProjectEffect.pipe(
31257
31264
  Effect44.map((linked) => ({
31258
31265
  projectId: linked.projectId,
31259
- defaultEnv: linked.defaultEnv ?? "production"
31266
+ defaultEnv: linked.defaultEnv ?? "production",
31267
+ orgId: linked.orgId
31260
31268
  }))
31261
31269
  );
31270
+ let orgId = explicitOrgId;
31271
+ if (!orgId) {
31272
+ orgId = yield* resolveOrgScopeEffect("logs", input.org, { linkedOrgId: targetProject.orgId });
31273
+ }
31262
31274
  const target = input.env ?? targetProject.defaultEnv;
31263
31275
  const scope = orgId ? { orgId } : void 0;
31264
31276
  const resolvedEnvId = yield* api2.resolveEnvId(targetProject.projectId, target, scope);
@@ -33109,45 +33121,52 @@ function membersSetRoleEffect(input) {
33109
33121
  );
33110
33122
  });
33111
33123
  }
33112
- var membersListCmd = Command39.make("list", {}, () => membersListEffect).pipe(
33113
- Command39.withDescription("List organization members")
33114
- );
33115
- var membersInviteCmd = Command39.make(
33116
- "invite",
33117
- {
33118
- email: Args25.text({ name: "email" }),
33119
- role: Options40.text("role").pipe(
33120
- Options40.withDescription("Role to assign (admin | member)"),
33121
- Options40.withDefault("member")
33122
- )
33123
- },
33124
- ({ email, role }) => membersInviteEffect({ email, role })
33125
- ).pipe(Command39.withDescription("Invite a member to the organization by email"));
33126
- var membersRemoveCmd = Command39.make(
33127
- "remove",
33128
- { userId: Args25.text({ name: "userId" }) },
33129
- ({ userId }) => membersRemoveEffect(userId)
33130
- ).pipe(Command39.withDescription("Remove a member from the organization"));
33131
- var membersSetRoleCmd = Command39.make(
33132
- "set-role",
33133
- {
33134
- userId: Args25.text({ name: "user-id" }),
33135
- role: Args25.text({ name: "role" }),
33136
- yes: Options40.boolean("yes").pipe(
33137
- Options40.withAlias("y"),
33138
- Options40.withDescription("skip the confirmation prompt for privileged promotions")
33124
+ function makeMembersCommand() {
33125
+ const membersListCmd = Command39.make("list", {}, () => membersListEffect).pipe(
33126
+ Command39.withDescription("List organization members")
33127
+ );
33128
+ const membersInviteCmd = Command39.make(
33129
+ "invite",
33130
+ {
33131
+ email: Args25.text({ name: "email" }),
33132
+ role: Options40.text("role").pipe(
33133
+ Options40.withDescription("Role to assign (admin | member)"),
33134
+ Options40.withDefault("member")
33135
+ )
33136
+ },
33137
+ ({ email, role }) => membersInviteEffect({ email, role })
33138
+ ).pipe(Command39.withDescription("Invite a member to the organization by email"));
33139
+ const membersRemoveCmd = Command39.make(
33140
+ "remove",
33141
+ { userId: Args25.text({ name: "userId" }) },
33142
+ ({ userId }) => membersRemoveEffect(userId)
33143
+ ).pipe(Command39.withDescription("Remove a member from the organization"));
33144
+ const membersSetRoleCmd = Command39.make(
33145
+ "set-role",
33146
+ {
33147
+ userId: Args25.text({ name: "user-id" }),
33148
+ role: Args25.text({ name: "role" }),
33149
+ yes: Options40.boolean("yes").pipe(
33150
+ Options40.withAlias("y"),
33151
+ Options40.withDescription("skip the confirmation prompt for privileged promotions")
33152
+ )
33153
+ },
33154
+ ({ userId, role, yes }) => membersSetRoleEffect({ userId, role, yes })
33155
+ ).pipe(
33156
+ Command39.withDescription(
33157
+ "Change a member role (super_admin, admin, billing, analytics, developer, viewer, member)"
33139
33158
  )
33140
- },
33141
- ({ userId, role, yes }) => membersSetRoleEffect({ userId, role, yes })
33142
- ).pipe(
33143
- Command39.withDescription(
33144
- "Change a member role (super_admin, admin, billing, analytics, developer, viewer, member)"
33145
- )
33146
- );
33147
- var membersCmd = Command39.make("members", {}, () => membersListEffect).pipe(
33148
- Command39.withDescription("Manage organization members"),
33149
- Command39.withSubcommands([membersListCmd, membersInviteCmd, membersRemoveCmd, membersSetRoleCmd])
33150
- );
33159
+ );
33160
+ return Command39.make("members", {}, () => membersListEffect).pipe(
33161
+ Command39.withDescription("Manage organization members"),
33162
+ Command39.withSubcommands([
33163
+ membersListCmd,
33164
+ membersInviteCmd,
33165
+ membersRemoveCmd,
33166
+ membersSetRoleCmd
33167
+ ])
33168
+ );
33169
+ }
33151
33170
  var orgsBillingEffect = Effect50.gen(function* () {
33152
33171
  yield* requireAuthEffect;
33153
33172
  const api2 = yield* ApiService;
@@ -33294,69 +33313,83 @@ function auditEffect(input) {
33294
33313
  yield* Console39.log("");
33295
33314
  });
33296
33315
  }
33297
- var billingCmd = Command39.make("billing", {}, () => orgsBillingEffect).pipe(
33298
- Command39.withDescription("Show the current org's plan, balance, and usage snapshot")
33299
- );
33300
- var sessionsListCmd = Command39.make("list", {}, () => sessionsListEffect).pipe(
33301
- Command39.withDescription("List active sessions for all members in the org")
33302
- );
33303
- var sessionsRevokeCmd = Command39.make(
33304
- "revoke",
33305
- { sessionId: Args25.text({ name: "session-id" }) },
33306
- ({ sessionId }) => sessionsRevokeEffect(sessionId)
33307
- ).pipe(Command39.withDescription("Revoke a single session by id"));
33308
- var sessionsCmd = Command39.make("sessions", {}, () => sessionsListEffect).pipe(
33309
- Command39.withDescription("Manage active sessions across the org"),
33310
- Command39.withSubcommands([sessionsListCmd, sessionsRevokeCmd])
33311
- );
33312
- var teamCmd = Command39.make(
33313
- "team",
33314
- {
33315
- role: Options40.text("role").pipe(
33316
- Options40.withDescription("Filter by role: admin | member | viewer | owner"),
33317
- Options40.optional
33318
- )
33319
- },
33320
- ({ role }) => teamEffect({ role: role._tag === "Some" ? role.value : void 0 })
33321
- ).pipe(Command39.withDescription("Show the team roster (members list + --role filter)"));
33322
- var auditCmd2 = Command39.make(
33323
- "audit",
33324
- {
33325
- since: Options40.text("since").pipe(
33326
- Options40.withDescription("ISO-8601 or relative offset (24h, 7d, 30m). Default: 24h"),
33327
- Options40.withDefault("24h")
33328
- ),
33329
- limit: Options40.integer("limit").pipe(
33330
- Options40.withDescription("Max entries to return (default: 100)"),
33331
- Options40.withDefault(100)
33332
- ),
33333
- actor: Options40.text("actor").pipe(
33334
- Options40.withDescription("Filter by actor user-id or email"),
33335
- Options40.optional
33336
- )
33337
- },
33338
- ({ since, limit, actor }) => auditEffect({
33339
- since,
33340
- limit,
33341
- actor: actor._tag === "Some" ? actor.value : void 0
33342
- })
33343
- ).pipe(Command39.withDescription("Show recent audit log entries for this org"));
33316
+ function makeBillingCommand() {
33317
+ return Command39.make("billing", {}, () => orgsBillingEffect).pipe(
33318
+ Command39.withDescription("Show the current org's plan, balance, and usage snapshot")
33319
+ );
33320
+ }
33321
+ function makeSessionsCommand() {
33322
+ const sessionsListCmd2 = Command39.make("list", {}, () => sessionsListEffect).pipe(
33323
+ Command39.withDescription("List active sessions for all members in the org")
33324
+ );
33325
+ const sessionsRevokeCmd2 = Command39.make(
33326
+ "revoke",
33327
+ { sessionId: Args25.text({ name: "session-id" }) },
33328
+ ({ sessionId }) => sessionsRevokeEffect(sessionId)
33329
+ ).pipe(Command39.withDescription("Revoke a single session by id"));
33330
+ return Command39.make("sessions", {}, () => sessionsListEffect).pipe(
33331
+ Command39.withDescription("Manage active sessions across the org"),
33332
+ Command39.withSubcommands([sessionsListCmd2, sessionsRevokeCmd2])
33333
+ );
33334
+ }
33335
+ function makeTeamCommand() {
33336
+ return Command39.make(
33337
+ "team",
33338
+ {
33339
+ role: Options40.text("role").pipe(
33340
+ Options40.withDescription("Filter by role: admin | member | viewer | owner"),
33341
+ Options40.optional
33342
+ )
33343
+ },
33344
+ ({ role }) => teamEffect({ role: role._tag === "Some" ? role.value : void 0 })
33345
+ ).pipe(Command39.withDescription("Show the team roster (members list + --role filter)"));
33346
+ }
33347
+ function makeAuditCommand() {
33348
+ return Command39.make(
33349
+ "audit",
33350
+ {
33351
+ since: Options40.text("since").pipe(
33352
+ Options40.withDescription("ISO-8601 or relative offset (24h, 7d, 30m). Default: 24h"),
33353
+ Options40.withDefault("24h")
33354
+ ),
33355
+ limit: Options40.integer("limit").pipe(
33356
+ Options40.withDescription("Max entries to return (default: 100)"),
33357
+ Options40.withDefault(100)
33358
+ ),
33359
+ actor: Options40.text("actor").pipe(
33360
+ Options40.withDescription("Filter by actor user-id or email"),
33361
+ Options40.optional
33362
+ )
33363
+ },
33364
+ ({ since, limit, actor }) => auditEffect({
33365
+ since,
33366
+ limit,
33367
+ actor: actor._tag === "Some" ? actor.value : void 0
33368
+ })
33369
+ ).pipe(Command39.withDescription("Show recent audit log entries for this org"));
33370
+ }
33371
+ function makeOrgSubcommands() {
33372
+ return [
33373
+ makeMembersCommand(),
33374
+ makeBillingCommand(),
33375
+ makeSessionsCommand(),
33376
+ makeTeamCommand(),
33377
+ makeAuditCommand()
33378
+ ];
33379
+ }
33344
33380
  var orgsCommand = Command39.make(
33345
33381
  "orgs",
33346
33382
  { output: outputOption },
33347
33383
  ({ output }) => orgsShowEffectWith(output)
33348
33384
  ).pipe(
33349
33385
  Command39.withDescription("Manage organizations"),
33350
- Command39.withSubcommands([membersCmd, billingCmd, sessionsCmd, teamCmd, auditCmd2])
33386
+ Command39.withSubcommands(makeOrgSubcommands())
33351
33387
  );
33352
33388
  var orgCommand = Command39.make(
33353
33389
  "org",
33354
33390
  { output: outputOption },
33355
33391
  ({ output }) => orgsShowEffectWith(output)
33356
- ).pipe(
33357
- Command39.withDescription("Alias for `orgs`"),
33358
- Command39.withSubcommands([membersCmd, billingCmd, sessionsCmd, teamCmd, auditCmd2])
33359
- );
33392
+ ).pipe(Command39.withDescription("Alias for `orgs`"), Command39.withSubcommands(makeOrgSubcommands()));
33360
33393
 
33361
33394
  // src/programs/plan.ts
33362
33395
  import { Args as Args26, Command as Command40, Options as Options41 } from "@effect/cli";
@@ -39345,12 +39378,12 @@ var securityCmd = Command66.make(
39345
39378
  { output: outputOption },
39346
39379
  ({ output }) => userSecurityEffect({ output })
39347
39380
  ).pipe(Command66.withDescription("Show your security posture (password/MFA/passkeys)"));
39348
- var sessionsListCmd2 = Command66.make(
39381
+ var sessionsListCmd = Command66.make(
39349
39382
  "list",
39350
39383
  { output: outputOption },
39351
39384
  ({ output }) => userSessionsListEffect({ output })
39352
39385
  ).pipe(Command66.withDescription("List active sessions"));
39353
- var sessionsRevokeCmd2 = Command66.make(
39386
+ var sessionsRevokeCmd = Command66.make(
39354
39387
  "revoke",
39355
39388
  { sessionId: Args45.text({ name: "sessionId" }) },
39356
39389
  ({ sessionId }) => userSessionsRevokeEffect({ sessionId })
@@ -39361,13 +39394,13 @@ var sessionsPurgeCmd = Command66.make(
39361
39394
  { yes: yesOpt5 },
39362
39395
  ({ yes }) => userSessionsPurgeEffect({ yes })
39363
39396
  ).pipe(Command66.withDescription("Revoke all sessions except the current one"));
39364
- var sessionsCmd2 = Command66.make(
39397
+ var sessionsCmd = Command66.make(
39365
39398
  "sessions",
39366
39399
  {},
39367
39400
  () => Console66.log("Run `sylphx user sessions --help` for usage")
39368
39401
  ).pipe(
39369
39402
  Command66.withDescription("Manage active sessions"),
39370
- Command66.withSubcommands([sessionsListCmd2, sessionsRevokeCmd2, sessionsPurgeCmd])
39403
+ Command66.withSubcommands([sessionsListCmd, sessionsRevokeCmd, sessionsPurgeCmd])
39371
39404
  );
39372
39405
  var exportRequestCmd = Command66.make(
39373
39406
  "request",
@@ -39418,7 +39451,7 @@ var userCommand = Command66.make(
39418
39451
  () => Console66.log("Run `sylphx user --help` for usage")
39419
39452
  ).pipe(
39420
39453
  Command66.withDescription("Current user self-service: profile, sessions, security, data export"),
39421
- Command66.withSubcommands([profileCmd, securityCmd, sessionsCmd2, exportsCmd, deleteCmd9])
39454
+ Command66.withSubcommands([profileCmd, securityCmd, sessionsCmd, exportsCmd, deleteCmd9])
39422
39455
  );
39423
39456
 
39424
39457
  // src/programs/users.ts