@sylphx/cli 0.14.9 → 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,20 @@
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
+
11
+ ## 0.14.10
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [[`38d2c64`](https://github.com/SylphxAI/platform/commit/38d2c648a79294ff454cd003e4ca5e98027d8a2f)]:
16
+ - @sylphx/sdk@0.15.4
17
+
3
18
  ## 0.14.9
4
19
 
5
20
  ### 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.9",
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",
@@ -71,7 +71,7 @@ var init_package = __esm({
71
71
  "@effect/cli": "0.75.1",
72
72
  "@effect/platform": "0.96.0",
73
73
  "@effect/platform-bun": "0.89.0",
74
- "@sylphx/sdk": "0.15.3",
74
+ "@sylphx/sdk": "0.15.4",
75
75
  chalk: "^5.3.0",
76
76
  effect: "3.21.0",
77
77
  eventsource: "^2.0.2",
@@ -7588,7 +7588,7 @@ var init_databases = __esm({
7588
7588
 
7589
7589
  // ../contract/dist/schemas/deployment.js
7590
7590
  import { Schema as Schema53 } from "effect";
7591
- var DeploymentEnvironmentStatus, DeploymentStatus, DeployResult, DeploymentHistoryItem, DeploymentHistoryResult, RollbackResult, ProjectStatusEnvironment, ProjectStatus, DeploymentServiceStatus, DeploymentDetail, DeploySupplyChain, TriggerDeploymentFrameworkSignals, DeploymentServiceNamePattern, DeploymentServiceName, TriggerDeploymentInput, RollbackDeploymentInput, DeployServiceStatus, EnvScopedAppEnvInfo, EnvScopedAppDeployments, EnvScopedTriggerDeployResult, EnvScopedRollbackByCommitInput, EnvScopedRollbackByCommitResult, CancelBuildResult, BuildDetail, EnvScopedEnvVar, EnvScopedListEnvVarsResult, EnvScopedSetEnvVarInput, EnvScopedSetEnvVarResult, EnvScopedDeleteEnvVarResult, EnvScopedDeploymentView, EnvScopedDeploymentHistory, EnvScopedAppHealthStatus, EnvServiceRollbackInput, EnvServiceRollbackResult, PromoteArtifactInput, PromoteArtifactResult, DeployStatusLiteral, TriggerSourceLiteral, EnvServiceHistoryDeployment, EnvServiceHistoryResult;
7591
+ var DeploymentEnvironmentStatus, DeploymentStatus, DeployBuildPlanFailure, QueuedBuildDispatch, DeployResult, DeploymentHistoryItem, DeploymentHistoryResult, RollbackResult, ProjectStatusEnvironment, ProjectStatus, DeploymentServiceStatus, DeploymentDetail, DeploySupplyChain, TriggerDeploymentFrameworkSignals, DeploymentServiceNamePattern, DeploymentServiceName, TriggerDeploymentInput, RollbackDeploymentInput, DeployServiceStatus, EnvScopedAppEnvInfo, EnvScopedAppDeployments, EnvScopedTriggerDeployResult, EnvScopedRollbackByCommitInput, EnvScopedRollbackByCommitResult, CancelBuildResult, BuildDetail, EnvScopedEnvVar, EnvScopedListEnvVarsResult, EnvScopedSetEnvVarInput, EnvScopedSetEnvVarResult, EnvScopedDeleteEnvVarResult, EnvScopedDeploymentView, EnvScopedDeploymentHistory, EnvScopedAppHealthStatus, EnvServiceRollbackInput, EnvServiceRollbackResult, PromoteArtifactInput, PromoteArtifactResult, DeployStatusLiteral, TriggerSourceLiteral, EnvServiceHistoryDeployment, EnvServiceHistoryResult;
7592
7592
  var init_deployment = __esm({
7593
7593
  "../contract/dist/schemas/deployment.js"() {
7594
7594
  "use strict";
@@ -7617,6 +7617,18 @@ var init_deployment = __esm({
7617
7617
  })),
7618
7618
  environments: Schema53.optional(Schema53.Array(DeploymentEnvironmentStatus))
7619
7619
  });
7620
+ DeployBuildPlanFailure = Schema53.Struct({
7621
+ serviceId: ServiceId,
7622
+ serviceName: Schema53.NullOr(Schema53.String),
7623
+ code: Schema53.String,
7624
+ hint: Schema53.NullOr(Schema53.String),
7625
+ message: Schema53.String
7626
+ });
7627
+ QueuedBuildDispatch = Schema53.Struct({
7628
+ serviceId: ServiceId,
7629
+ serviceName: Schema53.NullOr(Schema53.String),
7630
+ reason: Schema53.Literal("admission_deferred")
7631
+ });
7620
7632
  DeployResult = Schema53.Struct({
7621
7633
  deploymentId: Schema53.optional(DeploymentId),
7622
7634
  deploymentRecordId: Schema53.optional(DeploymentId),
@@ -7627,7 +7639,9 @@ var init_deployment = __esm({
7627
7639
  status: Schema53.String,
7628
7640
  environment: Schema53.optional(Schema53.String),
7629
7641
  message: Schema53.optional(Schema53.String),
7630
- triggeredAt: Schema53.optional(Schema53.String)
7642
+ triggeredAt: Schema53.optional(Schema53.String),
7643
+ buildPlanFailures: Schema53.optional(Schema53.Array(DeployBuildPlanFailure)),
7644
+ queuedBuildDispatches: Schema53.optional(Schema53.Array(QueuedBuildDispatch))
7631
7645
  });
7632
7646
  DeploymentHistoryItem = Schema53.Struct({
7633
7647
  id: DeploymentId,
@@ -21861,9 +21875,10 @@ var requireLinkedProjectEffect = Effect9.gen(function* () {
21861
21875
  }
21862
21876
  return linked;
21863
21877
  });
21864
- function resolveOrgScopeEffect(command, org) {
21878
+ function resolveOrgScopeEffect(command, org, options = {}) {
21865
21879
  const explicit = org?.trim();
21866
21880
  if (explicit) return resolveOrgRefEffect(command, explicit);
21881
+ if (options.linkedOrgId) return Effect9.succeed(options.linkedOrgId);
21867
21882
  return Effect9.gen(function* () {
21868
21883
  const cfg = yield* ConfigService;
21869
21884
  const configured = yield* cfg.getDefaultOrg;
@@ -21898,7 +21913,8 @@ function resolveProjectTargetEffect(project) {
21898
21913
  return requireLinkedProjectEffect.pipe(
21899
21914
  Effect9.map((linked) => ({
21900
21915
  projectId: linked.projectId,
21901
- defaultEnv: linked.defaultEnv ?? "production"
21916
+ defaultEnv: linked.defaultEnv ?? "production",
21917
+ orgId: linked.orgId
21902
21918
  }))
21903
21919
  );
21904
21920
  }
@@ -27280,13 +27296,18 @@ function printBuildDetail(build) {
27280
27296
  function deploymentsListEffect(opts) {
27281
27297
  return Effect29.gen(function* () {
27282
27298
  yield* requireAuthEffect;
27283
- const orgId = yield* resolveOrgScopeEffect("deployments", opts.org);
27284
- 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(
27285
27301
  Effect29.map((linked) => ({
27286
27302
  projectId: linked.projectId,
27287
- defaultEnv: linked.defaultEnv ?? "production"
27303
+ defaultEnv: linked.defaultEnv ?? "production",
27304
+ orgId: linked.orgId
27288
27305
  }))
27289
27306
  );
27307
+ let orgId = explicitOrgId;
27308
+ if (!orgId) {
27309
+ orgId = yield* resolveOrgScopeEffect("deployments", opts.org, { linkedOrgId: target.orgId });
27310
+ }
27290
27311
  const api2 = yield* ApiService;
27291
27312
  const envType = opts.env ?? target.defaultEnv;
27292
27313
  const history3 = yield* withSpinner(
@@ -31238,13 +31259,18 @@ function logsEffect(input) {
31238
31259
  }
31239
31260
  yield* requireAuthEffect;
31240
31261
  const api2 = yield* ApiService;
31241
- const orgId = yield* resolveOrgScopeEffect("logs", input.org);
31242
- 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(
31243
31264
  Effect44.map((linked) => ({
31244
31265
  projectId: linked.projectId,
31245
- defaultEnv: linked.defaultEnv ?? "production"
31266
+ defaultEnv: linked.defaultEnv ?? "production",
31267
+ orgId: linked.orgId
31246
31268
  }))
31247
31269
  );
31270
+ let orgId = explicitOrgId;
31271
+ if (!orgId) {
31272
+ orgId = yield* resolveOrgScopeEffect("logs", input.org, { linkedOrgId: targetProject.orgId });
31273
+ }
31248
31274
  const target = input.env ?? targetProject.defaultEnv;
31249
31275
  const scope = orgId ? { orgId } : void 0;
31250
31276
  const resolvedEnvId = yield* api2.resolveEnvId(targetProject.projectId, target, scope);
@@ -33095,45 +33121,52 @@ function membersSetRoleEffect(input) {
33095
33121
  );
33096
33122
  });
33097
33123
  }
33098
- var membersListCmd = Command39.make("list", {}, () => membersListEffect).pipe(
33099
- Command39.withDescription("List organization members")
33100
- );
33101
- var membersInviteCmd = Command39.make(
33102
- "invite",
33103
- {
33104
- email: Args25.text({ name: "email" }),
33105
- role: Options40.text("role").pipe(
33106
- Options40.withDescription("Role to assign (admin | member)"),
33107
- Options40.withDefault("member")
33108
- )
33109
- },
33110
- ({ email, role }) => membersInviteEffect({ email, role })
33111
- ).pipe(Command39.withDescription("Invite a member to the organization by email"));
33112
- var membersRemoveCmd = Command39.make(
33113
- "remove",
33114
- { userId: Args25.text({ name: "userId" }) },
33115
- ({ userId }) => membersRemoveEffect(userId)
33116
- ).pipe(Command39.withDescription("Remove a member from the organization"));
33117
- var membersSetRoleCmd = Command39.make(
33118
- "set-role",
33119
- {
33120
- userId: Args25.text({ name: "user-id" }),
33121
- role: Args25.text({ name: "role" }),
33122
- yes: Options40.boolean("yes").pipe(
33123
- Options40.withAlias("y"),
33124
- 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)"
33125
33158
  )
33126
- },
33127
- ({ userId, role, yes }) => membersSetRoleEffect({ userId, role, yes })
33128
- ).pipe(
33129
- Command39.withDescription(
33130
- "Change a member role (super_admin, admin, billing, analytics, developer, viewer, member)"
33131
- )
33132
- );
33133
- var membersCmd = Command39.make("members", {}, () => membersListEffect).pipe(
33134
- Command39.withDescription("Manage organization members"),
33135
- Command39.withSubcommands([membersListCmd, membersInviteCmd, membersRemoveCmd, membersSetRoleCmd])
33136
- );
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
+ }
33137
33170
  var orgsBillingEffect = Effect50.gen(function* () {
33138
33171
  yield* requireAuthEffect;
33139
33172
  const api2 = yield* ApiService;
@@ -33280,69 +33313,83 @@ function auditEffect(input) {
33280
33313
  yield* Console39.log("");
33281
33314
  });
33282
33315
  }
33283
- var billingCmd = Command39.make("billing", {}, () => orgsBillingEffect).pipe(
33284
- Command39.withDescription("Show the current org's plan, balance, and usage snapshot")
33285
- );
33286
- var sessionsListCmd = Command39.make("list", {}, () => sessionsListEffect).pipe(
33287
- Command39.withDescription("List active sessions for all members in the org")
33288
- );
33289
- var sessionsRevokeCmd = Command39.make(
33290
- "revoke",
33291
- { sessionId: Args25.text({ name: "session-id" }) },
33292
- ({ sessionId }) => sessionsRevokeEffect(sessionId)
33293
- ).pipe(Command39.withDescription("Revoke a single session by id"));
33294
- var sessionsCmd = Command39.make("sessions", {}, () => sessionsListEffect).pipe(
33295
- Command39.withDescription("Manage active sessions across the org"),
33296
- Command39.withSubcommands([sessionsListCmd, sessionsRevokeCmd])
33297
- );
33298
- var teamCmd = Command39.make(
33299
- "team",
33300
- {
33301
- role: Options40.text("role").pipe(
33302
- Options40.withDescription("Filter by role: admin | member | viewer | owner"),
33303
- Options40.optional
33304
- )
33305
- },
33306
- ({ role }) => teamEffect({ role: role._tag === "Some" ? role.value : void 0 })
33307
- ).pipe(Command39.withDescription("Show the team roster (members list + --role filter)"));
33308
- var auditCmd2 = Command39.make(
33309
- "audit",
33310
- {
33311
- since: Options40.text("since").pipe(
33312
- Options40.withDescription("ISO-8601 or relative offset (24h, 7d, 30m). Default: 24h"),
33313
- Options40.withDefault("24h")
33314
- ),
33315
- limit: Options40.integer("limit").pipe(
33316
- Options40.withDescription("Max entries to return (default: 100)"),
33317
- Options40.withDefault(100)
33318
- ),
33319
- actor: Options40.text("actor").pipe(
33320
- Options40.withDescription("Filter by actor user-id or email"),
33321
- Options40.optional
33322
- )
33323
- },
33324
- ({ since, limit, actor }) => auditEffect({
33325
- since,
33326
- limit,
33327
- actor: actor._tag === "Some" ? actor.value : void 0
33328
- })
33329
- ).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
+ }
33330
33380
  var orgsCommand = Command39.make(
33331
33381
  "orgs",
33332
33382
  { output: outputOption },
33333
33383
  ({ output }) => orgsShowEffectWith(output)
33334
33384
  ).pipe(
33335
33385
  Command39.withDescription("Manage organizations"),
33336
- Command39.withSubcommands([membersCmd, billingCmd, sessionsCmd, teamCmd, auditCmd2])
33386
+ Command39.withSubcommands(makeOrgSubcommands())
33337
33387
  );
33338
33388
  var orgCommand = Command39.make(
33339
33389
  "org",
33340
33390
  { output: outputOption },
33341
33391
  ({ output }) => orgsShowEffectWith(output)
33342
- ).pipe(
33343
- Command39.withDescription("Alias for `orgs`"),
33344
- Command39.withSubcommands([membersCmd, billingCmd, sessionsCmd, teamCmd, auditCmd2])
33345
- );
33392
+ ).pipe(Command39.withDescription("Alias for `orgs`"), Command39.withSubcommands(makeOrgSubcommands()));
33346
33393
 
33347
33394
  // src/programs/plan.ts
33348
33395
  import { Args as Args26, Command as Command40, Options as Options41 } from "@effect/cli";
@@ -39331,12 +39378,12 @@ var securityCmd = Command66.make(
39331
39378
  { output: outputOption },
39332
39379
  ({ output }) => userSecurityEffect({ output })
39333
39380
  ).pipe(Command66.withDescription("Show your security posture (password/MFA/passkeys)"));
39334
- var sessionsListCmd2 = Command66.make(
39381
+ var sessionsListCmd = Command66.make(
39335
39382
  "list",
39336
39383
  { output: outputOption },
39337
39384
  ({ output }) => userSessionsListEffect({ output })
39338
39385
  ).pipe(Command66.withDescription("List active sessions"));
39339
- var sessionsRevokeCmd2 = Command66.make(
39386
+ var sessionsRevokeCmd = Command66.make(
39340
39387
  "revoke",
39341
39388
  { sessionId: Args45.text({ name: "sessionId" }) },
39342
39389
  ({ sessionId }) => userSessionsRevokeEffect({ sessionId })
@@ -39347,13 +39394,13 @@ var sessionsPurgeCmd = Command66.make(
39347
39394
  { yes: yesOpt5 },
39348
39395
  ({ yes }) => userSessionsPurgeEffect({ yes })
39349
39396
  ).pipe(Command66.withDescription("Revoke all sessions except the current one"));
39350
- var sessionsCmd2 = Command66.make(
39397
+ var sessionsCmd = Command66.make(
39351
39398
  "sessions",
39352
39399
  {},
39353
39400
  () => Console66.log("Run `sylphx user sessions --help` for usage")
39354
39401
  ).pipe(
39355
39402
  Command66.withDescription("Manage active sessions"),
39356
- Command66.withSubcommands([sessionsListCmd2, sessionsRevokeCmd2, sessionsPurgeCmd])
39403
+ Command66.withSubcommands([sessionsListCmd, sessionsRevokeCmd, sessionsPurgeCmd])
39357
39404
  );
39358
39405
  var exportRequestCmd = Command66.make(
39359
39406
  "request",
@@ -39404,7 +39451,7 @@ var userCommand = Command66.make(
39404
39451
  () => Console66.log("Run `sylphx user --help` for usage")
39405
39452
  ).pipe(
39406
39453
  Command66.withDescription("Current user self-service: profile, sessions, security, data export"),
39407
- Command66.withSubcommands([profileCmd, securityCmd, sessionsCmd2, exportsCmd, deleteCmd9])
39454
+ Command66.withSubcommands([profileCmd, securityCmd, sessionsCmd, exportsCmd, deleteCmd9])
39408
39455
  );
39409
39456
 
39410
39457
  // src/programs/users.ts