@sylphx/cli 0.13.1 → 0.14.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/CHANGELOG.md +6 -0
- package/README.md +3 -2
- package/dist/main.js +158 -57
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @sylphx/cli
|
|
2
2
|
|
|
3
|
+
## 0.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1169](https://github.com/SylphxAI/platform/pull/1169) [`53a74bc`](https://github.com/SylphxAI/platform/commit/53a74bc5c612ca00e68d88296526c588bb2d3b04) Thanks [@shtse8](https://github.com/shtse8)! - Route CLI runtime/build log inspection through the environment-scoped Management logs API. `sylphx logs` now uses bounded runtime logs by default, keeps SSE behind `--follow`, and exposes build/deploy logs through `--type build`.
|
|
8
|
+
|
|
3
9
|
## 0.13.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -66,6 +66,7 @@ sylphx whoami # → "Auth: SYLPHX_TOKEN_FILE (...)"
|
|
|
66
66
|
sylphx deploy --env=production
|
|
67
67
|
sylphx status --project=proj_abc123 --org=my-org
|
|
68
68
|
sylphx logs --project=proj_abc123 --org=my-org --tail=100
|
|
69
|
+
sylphx logs --project=proj_abc123 --org=my-org --type=build --tail=100
|
|
69
70
|
sylphx env set DATABASE_URL=postgres://... --project=proj_abc123 --org=my-org --secret
|
|
70
71
|
sylphx config set PUBLIC_URL=https://app.example.com --project=proj_abc123 --org=my-org
|
|
71
72
|
sylphx secrets set --project=proj_abc123 --org=my-org --key STRIPE_SECRET --value sk_live_...
|
|
@@ -196,8 +197,8 @@ The home config is private operator state only. It does not store per-directory
|
|
|
196
197
|
| `sylphx promote` | Promote staging → production for a linked or explicit project |
|
|
197
198
|
| `sylphx rollback` | Roll back a linked or explicit project deployment |
|
|
198
199
|
| `sylphx status` | Deployment + health status for a linked or explicit project |
|
|
199
|
-
| `sylphx logs` |
|
|
200
|
-
| `sylphx tail` |
|
|
200
|
+
| `sylphx logs` | Inspect bounded runtime logs for a linked or explicit project; add `--follow` for SSE or `--type=build` for deploy logs |
|
|
201
|
+
| `sylphx tail` | Follow runtime logs with structured formatting; accepts the same filters as `logs` |
|
|
201
202
|
| `sylphx run-cmd` | Run a local command with remote env from a linked or explicit project |
|
|
202
203
|
|
|
203
204
|
### Managed primitives
|
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.
|
|
18
|
+
version: "0.14.0",
|
|
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",
|
|
@@ -16335,11 +16335,12 @@ __export(environments_exports, {
|
|
|
16335
16335
|
create: () => create4,
|
|
16336
16336
|
delete: () => _delete4,
|
|
16337
16337
|
list: () => list7,
|
|
16338
|
+
logs: () => logs,
|
|
16338
16339
|
promote: () => promote,
|
|
16339
16340
|
resolveId: () => resolveId,
|
|
16340
16341
|
update: () => update2
|
|
16341
16342
|
});
|
|
16342
|
-
var orgHeaders2, list7, resolveId, promote, create4, update2, _delete4, clone;
|
|
16343
|
+
var orgHeaders2, list7, resolveId, promote, logs, create4, update2, _delete4, clone;
|
|
16343
16344
|
var init_environments2 = __esm({
|
|
16344
16345
|
"../management/dist/environments.js"() {
|
|
16345
16346
|
"use strict";
|
|
@@ -16379,6 +16380,19 @@ var init_environments2 = __esm({
|
|
|
16379
16380
|
headers: orgHeaders2(options)
|
|
16380
16381
|
});
|
|
16381
16382
|
};
|
|
16383
|
+
logs = (client, envId, options = {}) => {
|
|
16384
|
+
const { method, path: path7 } = environmentsEndpoints.logs;
|
|
16385
|
+
return request(client, method, interpolatePath(path7, { envId }), {
|
|
16386
|
+
query: {
|
|
16387
|
+
type: options.type,
|
|
16388
|
+
deploymentId: options.deploymentId,
|
|
16389
|
+
since: options.since,
|
|
16390
|
+
limit: options.limit === void 0 ? void 0 : String(options.limit),
|
|
16391
|
+
level: options.level
|
|
16392
|
+
},
|
|
16393
|
+
headers: orgHeaders2(options)
|
|
16394
|
+
});
|
|
16395
|
+
};
|
|
16382
16396
|
create4 = (client, projectId, input, options = {}) => {
|
|
16383
16397
|
const { method, path: path7 } = environmentsEndpoints.createStandalone;
|
|
16384
16398
|
return request(client, method, path7, {
|
|
@@ -17555,7 +17569,7 @@ __export(saml_exports, {
|
|
|
17555
17569
|
create: () => create13,
|
|
17556
17570
|
delete: () => _delete11,
|
|
17557
17571
|
get: () => get8,
|
|
17558
|
-
logs: () =>
|
|
17572
|
+
logs: () => logs2,
|
|
17559
17573
|
metadata: () => metadata,
|
|
17560
17574
|
nameIdFormats: () => nameIdFormats,
|
|
17561
17575
|
setStatus: () => setStatus,
|
|
@@ -17564,7 +17578,7 @@ __export(saml_exports, {
|
|
|
17564
17578
|
testConfig: () => testConfig,
|
|
17565
17579
|
update: () => update5
|
|
17566
17580
|
});
|
|
17567
|
-
var get8, create13, update5, setStatus, _delete11, metadata,
|
|
17581
|
+
var get8, create13, update5, setStatus, _delete11, metadata, logs2, testConfig, templates, nameIdFormats, signatureAlgorithms;
|
|
17568
17582
|
var init_saml3 = __esm({
|
|
17569
17583
|
"../management/dist/saml.js"() {
|
|
17570
17584
|
"use strict";
|
|
@@ -17594,7 +17608,7 @@ var init_saml3 = __esm({
|
|
|
17594
17608
|
const { method, path: path7 } = samlEndpoints.getMetadata;
|
|
17595
17609
|
return request(client, method, path7, { query: { organizationId } });
|
|
17596
17610
|
};
|
|
17597
|
-
|
|
17611
|
+
logs2 = (client, providerId, limit) => {
|
|
17598
17612
|
const { method, path: path7 } = samlEndpoints.getLogs;
|
|
17599
17613
|
return request(client, method, path7, {
|
|
17600
17614
|
query: { providerId, limit: limit !== void 0 ? String(limit) : void 0 }
|
|
@@ -19486,6 +19500,21 @@ async function authedFetch(path7, init = {}) {
|
|
|
19486
19500
|
return await res.text();
|
|
19487
19501
|
});
|
|
19488
19502
|
}
|
|
19503
|
+
async function resolveLogStreamToken() {
|
|
19504
|
+
if (isExternalAuthActive()) {
|
|
19505
|
+
const auth = resolveAuthToken();
|
|
19506
|
+
if (!auth.token) throw new ApiError2(401, unauthenticatedMessage(auth));
|
|
19507
|
+
return auth.token;
|
|
19508
|
+
}
|
|
19509
|
+
let token;
|
|
19510
|
+
try {
|
|
19511
|
+
token = await ensureFreshAccessToken();
|
|
19512
|
+
} catch (err) {
|
|
19513
|
+
throw mapRefreshFailure(err);
|
|
19514
|
+
}
|
|
19515
|
+
if (!token) throw new ApiError2(401, unauthenticatedMessage());
|
|
19516
|
+
return token;
|
|
19517
|
+
}
|
|
19489
19518
|
async function createLogStream(projectId, envType, options) {
|
|
19490
19519
|
const params = new URLSearchParams({ stream: "true", limit: "200" });
|
|
19491
19520
|
if (options?.envId) {
|
|
@@ -19494,25 +19523,30 @@ async function createLogStream(projectId, envType, options) {
|
|
|
19494
19523
|
params.set("envType", envType);
|
|
19495
19524
|
}
|
|
19496
19525
|
const preferredOrgId = options?.orgId ?? resolvePreferredOrgId();
|
|
19497
|
-
|
|
19498
|
-
if (isExternalAuthActive()) {
|
|
19499
|
-
const auth = resolveAuthToken();
|
|
19500
|
-
if (!auth.token) throw new ApiError2(401, unauthenticatedMessage(auth));
|
|
19501
|
-
token = auth.token;
|
|
19502
|
-
} else {
|
|
19503
|
-
try {
|
|
19504
|
-
token = await ensureFreshAccessToken();
|
|
19505
|
-
} catch (err) {
|
|
19506
|
-
throw mapRefreshFailure(err);
|
|
19507
|
-
}
|
|
19508
|
-
}
|
|
19509
|
-
if (!token) throw new ApiError2(401, unauthenticatedMessage());
|
|
19526
|
+
const token = await resolveLogStreamToken();
|
|
19510
19527
|
return {
|
|
19511
19528
|
url: `${API_BASE}/projects/${encodeURIComponent(projectId)}/logs?${params.toString()}`,
|
|
19512
19529
|
token,
|
|
19513
19530
|
...preferredOrgId ? { headers: { "X-Preferred-Org-Id": preferredOrgId } } : {}
|
|
19514
19531
|
};
|
|
19515
19532
|
}
|
|
19533
|
+
async function createEnvironmentLogStream(envId, options = {}) {
|
|
19534
|
+
const params = new URLSearchParams({
|
|
19535
|
+
stream: "true",
|
|
19536
|
+
type: options.type ?? "runtime",
|
|
19537
|
+
limit: String(options.limit ?? 200)
|
|
19538
|
+
});
|
|
19539
|
+
if (options.deploymentId) params.set("deploymentId", options.deploymentId);
|
|
19540
|
+
if (options.since) params.set("since", options.since);
|
|
19541
|
+
if (options.level) params.set("level", options.level);
|
|
19542
|
+
const preferredOrgId = options.orgId ?? resolvePreferredOrgId();
|
|
19543
|
+
const token = await resolveLogStreamToken();
|
|
19544
|
+
return {
|
|
19545
|
+
url: `${API_BASE}/environments/${encodeURIComponent(envId)}/logs?${params.toString()}`,
|
|
19546
|
+
token,
|
|
19547
|
+
...preferredOrgId ? { headers: { "X-Preferred-Org-Id": preferredOrgId } } : {}
|
|
19548
|
+
};
|
|
19549
|
+
}
|
|
19516
19550
|
var version, BASE_URL, USER_AGENT, PREFERRED_ORG_ENV_VARS, api, API_BASE;
|
|
19517
19551
|
var init_api = __esm({
|
|
19518
19552
|
"src/api.ts"() {
|
|
@@ -19603,6 +19637,7 @@ var init_api = __esm({
|
|
|
19603
19637
|
// ── Environments ───────────────────────────────────────────────────────
|
|
19604
19638
|
listEnvironments: (projectId) => withClient((c2) => environments_exports.list(c2, projectId)),
|
|
19605
19639
|
resolveEnvId: (projectId, envType) => withClient((c2) => environments_exports.resolveId(c2, projectId, envType)),
|
|
19640
|
+
listEnvironmentLogs: (envId, options) => withClient((c2) => environments_exports.logs(c2, envId, options)),
|
|
19606
19641
|
createEnvironment: (projectId, body) => withClient((c2) => environments_exports.create(c2, projectId, body)),
|
|
19607
19642
|
updateEnvironment: (envId, body) => withClient((c2) => environments_exports.update(c2, envId, body)),
|
|
19608
19643
|
deleteEnvironment: (envId) => withClient((c2) => environments_exports.delete(c2, envId)),
|
|
@@ -20172,10 +20207,18 @@ var ApiServiceLive = Layer2.succeed(ApiService, {
|
|
|
20172
20207
|
try: () => createLogStream(projectId, envType, options),
|
|
20173
20208
|
catch: mapApiError("logs")
|
|
20174
20209
|
}),
|
|
20210
|
+
createEnvironmentLogStream: (envId, options) => Effect7.tryPromise({
|
|
20211
|
+
try: () => createEnvironmentLogStream(envId, options),
|
|
20212
|
+
catch: mapApiError("logs")
|
|
20213
|
+
}),
|
|
20175
20214
|
listProjectLogs: (projectId, options) => Effect7.tryPromise({
|
|
20176
20215
|
try: () => withAuthedSdk((c2) => logs_exports.list(c2, projectId, options)),
|
|
20177
20216
|
catch: mapApiError("logs")
|
|
20178
20217
|
}),
|
|
20218
|
+
listEnvironmentLogs: (envId, options) => Effect7.tryPromise({
|
|
20219
|
+
try: () => withAuthedSdk((c2) => environments_exports.logs(c2, envId, options)),
|
|
20220
|
+
catch: mapApiError("logs")
|
|
20221
|
+
}),
|
|
20179
20222
|
triggerDeploy: (projectId, envType, options) => Effect7.tryPromise({
|
|
20180
20223
|
try: () => withAuthedSdk((c2) => deployments_exports.trigger(c2, projectId, envType, options)),
|
|
20181
20224
|
catch: mapApiError("deploy")
|
|
@@ -25547,7 +25590,14 @@ function parseLogLine(raw) {
|
|
|
25547
25590
|
const level = status3 === "error" || status3 === "failed" ? "error" : status3 === "success" || status3 === "done" ? "success" : lvl;
|
|
25548
25591
|
const tsRaw = entry.timestamp ?? entry.ts;
|
|
25549
25592
|
const timestamp = tsRaw ? new Date(tsRaw) : void 0;
|
|
25550
|
-
return {
|
|
25593
|
+
return {
|
|
25594
|
+
raw,
|
|
25595
|
+
entry,
|
|
25596
|
+
message,
|
|
25597
|
+
level,
|
|
25598
|
+
timestamp,
|
|
25599
|
+
service: entry.service ?? entry.source ?? void 0
|
|
25600
|
+
};
|
|
25551
25601
|
}
|
|
25552
25602
|
function formatLogEntry(raw) {
|
|
25553
25603
|
let entry;
|
|
@@ -29411,7 +29461,7 @@ var inspectCommand = Command28.make(
|
|
|
29411
29461
|
Options30.withDescription("Machine-readable JSON output (no colour)")
|
|
29412
29462
|
)
|
|
29413
29463
|
},
|
|
29414
|
-
({ id, wait, logs:
|
|
29464
|
+
({ id, wait, logs: logs3, json }) => inspectEffect({ id, wait, logs: logs3, json })
|
|
29415
29465
|
).pipe(Command28.withDescription("Inspect a deployment by id"));
|
|
29416
29466
|
|
|
29417
29467
|
// src/programs/link.ts
|
|
@@ -29796,6 +29846,10 @@ var serviceOption = Options32.text("service").pipe(
|
|
|
29796
29846
|
Options32.withDescription("Restrict to a single service"),
|
|
29797
29847
|
Options32.optional
|
|
29798
29848
|
);
|
|
29849
|
+
var logTypeOption = Options32.choice("type", ["runtime", "build"]).pipe(
|
|
29850
|
+
Options32.withDescription("Log source to inspect: runtime app logs or build/deploy logs"),
|
|
29851
|
+
Options32.withDefault("runtime")
|
|
29852
|
+
);
|
|
29799
29853
|
var jsonOption = Options32.boolean("json").pipe(
|
|
29800
29854
|
Options32.withDescription("Emit machine-readable NDJSON (one JSON object per line)")
|
|
29801
29855
|
);
|
|
@@ -29903,6 +29957,7 @@ function tailFormat(line) {
|
|
|
29903
29957
|
}
|
|
29904
29958
|
function describeFilters(opts) {
|
|
29905
29959
|
const parts = [];
|
|
29960
|
+
if (opts.type) parts.push(`type=${opts.type}`);
|
|
29906
29961
|
if (opts.levels && opts.levels.size > 0) {
|
|
29907
29962
|
const lst = [...opts.levels].sort().join("/");
|
|
29908
29963
|
parts.push(opts.levels.size === 1 ? `${lst} only` : `levels=${lst}`);
|
|
@@ -29940,13 +29995,13 @@ function logsEffect(input) {
|
|
|
29940
29995
|
);
|
|
29941
29996
|
const target = input.env ?? targetProject.defaultEnv;
|
|
29942
29997
|
const scope = orgId ? { orgId } : void 0;
|
|
29943
|
-
const resolvedEnvId =
|
|
29944
|
-
if (
|
|
29998
|
+
const resolvedEnvId = yield* api2.resolveEnvId(targetProject.projectId, target, scope);
|
|
29999
|
+
if (!resolvedEnvId) {
|
|
29945
30000
|
return yield* Effect42.fail(
|
|
29946
30001
|
new CliCommandError({
|
|
29947
30002
|
command: "logs",
|
|
29948
30003
|
reason: "not-found",
|
|
29949
|
-
message: `Environment not found: ${
|
|
30004
|
+
message: `Environment not found: ${target}`
|
|
29950
30005
|
})
|
|
29951
30006
|
);
|
|
29952
30007
|
}
|
|
@@ -29954,10 +30009,11 @@ function logsEffect(input) {
|
|
|
29954
30009
|
yield* Console32.log("");
|
|
29955
30010
|
yield* Console32.log(
|
|
29956
30011
|
chalk_default.bold(
|
|
29957
|
-
`
|
|
30012
|
+
` ${input.type} logs for ${chalk_default.cyan(targetProject.projectId)} [${chalk_default.white(target)}]${input.follow ? chalk_default.dim(" (following...)") : ""}`
|
|
29958
30013
|
)
|
|
29959
30014
|
);
|
|
29960
30015
|
const summary2 = describeFilters({
|
|
30016
|
+
type: input.type,
|
|
29961
30017
|
levels,
|
|
29962
30018
|
sinceRaw: input.since,
|
|
29963
30019
|
grepRaw: input.grep,
|
|
@@ -29968,32 +30024,51 @@ function logsEffect(input) {
|
|
|
29968
30024
|
yield* Console32.log(chalk_default.dim(` ${"\u2500".repeat(50)}`));
|
|
29969
30025
|
yield* Console32.log("");
|
|
29970
30026
|
}
|
|
29971
|
-
const logStream = yield* api2.createLogStream(
|
|
29972
|
-
targetProject.projectId,
|
|
29973
|
-
target,
|
|
29974
|
-
orgId || resolvedEnvId ? { ...orgId ? { orgId } : {}, ...resolvedEnvId ? { envId: resolvedEnvId } : {} } : void 0
|
|
29975
|
-
);
|
|
29976
|
-
const url = appendQuery(logStream.url, {
|
|
29977
|
-
since: since ? String(since.getTime()) : void 0,
|
|
29978
|
-
limit: input.tail ? String(input.tail) : void 0,
|
|
29979
|
-
service: input.service
|
|
29980
|
-
});
|
|
29981
30027
|
const filter = buildFilter({ levels, since, grep, service: input.service });
|
|
29982
|
-
|
|
29983
|
-
|
|
29984
|
-
|
|
29985
|
-
|
|
29986
|
-
|
|
29987
|
-
|
|
29988
|
-
|
|
29989
|
-
|
|
29990
|
-
|
|
29991
|
-
|
|
29992
|
-
|
|
29993
|
-
|
|
29994
|
-
|
|
29995
|
-
|
|
29996
|
-
|
|
30028
|
+
if (!input.follow) {
|
|
30029
|
+
const result = yield* api2.listEnvironmentLogs(resolvedEnvId, {
|
|
30030
|
+
type: input.type,
|
|
30031
|
+
...orgId ? { orgId } : {},
|
|
30032
|
+
...since ? { since: since.toISOString() } : {},
|
|
30033
|
+
...input.tail ? { limit: input.tail } : {},
|
|
30034
|
+
...levels.size === 1 ? { level: [...levels][0] } : {}
|
|
30035
|
+
});
|
|
30036
|
+
let emitted = 0;
|
|
30037
|
+
for (const entry of result.data) {
|
|
30038
|
+
const raw = JSON.stringify(entry);
|
|
30039
|
+
const line = parseLogLine(raw);
|
|
30040
|
+
if (!filter(line)) continue;
|
|
30041
|
+
yield* Console32.log(input.json ? jsonFormat(line) : formatLogEntry(raw));
|
|
30042
|
+
emitted++;
|
|
30043
|
+
if (input.tail && emitted >= input.tail) break;
|
|
30044
|
+
}
|
|
30045
|
+
} else {
|
|
30046
|
+
const logStream = yield* api2.createEnvironmentLogStream(resolvedEnvId, {
|
|
30047
|
+
type: input.type,
|
|
30048
|
+
...orgId ? { orgId } : {},
|
|
30049
|
+
...since ? { since: since.toISOString() } : {},
|
|
30050
|
+
...input.tail ? { limit: input.tail } : {},
|
|
30051
|
+
...levels.size === 1 ? { level: [...levels][0] } : {}
|
|
30052
|
+
});
|
|
30053
|
+
const url = appendQuery(logStream.url, {
|
|
30054
|
+
service: input.service
|
|
30055
|
+
});
|
|
30056
|
+
yield* Effect42.tryPromise({
|
|
30057
|
+
try: () => streamLogs(url, logStream.token, {
|
|
30058
|
+
follow: true,
|
|
30059
|
+
exitOnDone: false,
|
|
30060
|
+
filter,
|
|
30061
|
+
format: input.json ? jsonFormat : void 0,
|
|
30062
|
+
limit: input.tail,
|
|
30063
|
+
headers: logStream.headers
|
|
30064
|
+
}),
|
|
30065
|
+
catch: (cause) => new CliCommandError({
|
|
30066
|
+
command: "logs",
|
|
30067
|
+
reason: "transient",
|
|
30068
|
+
message: `Log stream failed: ${cause instanceof Error ? cause.message : String(cause)}`
|
|
30069
|
+
})
|
|
30070
|
+
});
|
|
30071
|
+
}
|
|
29997
30072
|
if (!input.follow && !input.json) {
|
|
29998
30073
|
yield* Console32.log("");
|
|
29999
30074
|
}
|
|
@@ -30019,6 +30094,7 @@ var logsCommand = Command32.make(
|
|
|
30019
30094
|
project: projectOption18,
|
|
30020
30095
|
org: orgOption9,
|
|
30021
30096
|
env: envOption9,
|
|
30097
|
+
type: logTypeOption,
|
|
30022
30098
|
follow: followOption,
|
|
30023
30099
|
level: levelOption,
|
|
30024
30100
|
since: sinceOption,
|
|
@@ -30027,10 +30103,11 @@ var logsCommand = Command32.make(
|
|
|
30027
30103
|
service: serviceOption,
|
|
30028
30104
|
json: jsonOption
|
|
30029
30105
|
},
|
|
30030
|
-
({ project, org, env, follow, level, since, tail, grep, service, json }) => logsEffect({
|
|
30106
|
+
({ project, org, env, type, follow, level, since, tail, grep, service, json }) => logsEffect({
|
|
30031
30107
|
project: project._tag === "Some" ? project.value : void 0,
|
|
30032
30108
|
org: org._tag === "Some" ? org.value : void 0,
|
|
30033
30109
|
env: env._tag === "Some" ? env.value : void 0,
|
|
30110
|
+
type,
|
|
30034
30111
|
follow,
|
|
30035
30112
|
level,
|
|
30036
30113
|
since: since._tag === "Some" ? since.value : void 0,
|
|
@@ -30039,7 +30116,11 @@ var logsCommand = Command32.make(
|
|
|
30039
30116
|
service: service._tag === "Some" ? service.value : void 0,
|
|
30040
30117
|
json
|
|
30041
30118
|
})
|
|
30042
|
-
).pipe(
|
|
30119
|
+
).pipe(
|
|
30120
|
+
Command32.withDescription(
|
|
30121
|
+
"Inspect runtime logs; use --follow for SSE or --type build for deploy logs"
|
|
30122
|
+
)
|
|
30123
|
+
);
|
|
30043
30124
|
|
|
30044
30125
|
// src/programs/migrate.ts
|
|
30045
30126
|
import { Command as Command33, Options as Options34 } from "@effect/cli";
|
|
@@ -36914,8 +36995,20 @@ function tailEffect(input) {
|
|
|
36914
36995
|
projectId = linked.projectId;
|
|
36915
36996
|
target = input.env ?? linked.defaultEnv;
|
|
36916
36997
|
}
|
|
36998
|
+
const scope = orgId ? { orgId } : void 0;
|
|
36999
|
+
const envId = yield* api2.resolveEnvId(projectId, target, scope);
|
|
37000
|
+
if (!envId) {
|
|
37001
|
+
return yield* Effect71.fail(
|
|
37002
|
+
new CliCommandError({
|
|
37003
|
+
command: "tail",
|
|
37004
|
+
reason: "not-found",
|
|
37005
|
+
message: `Environment not found: ${target}`
|
|
37006
|
+
})
|
|
37007
|
+
);
|
|
37008
|
+
}
|
|
36917
37009
|
if (!input.json) {
|
|
36918
37010
|
const summary2 = describeFilters({
|
|
37011
|
+
type: input.type,
|
|
36919
37012
|
levels,
|
|
36920
37013
|
sinceRaw: input.since,
|
|
36921
37014
|
grepRaw: input.grep,
|
|
@@ -36924,14 +37017,20 @@ function tailEffect(input) {
|
|
|
36924
37017
|
});
|
|
36925
37018
|
yield* Console61.log("");
|
|
36926
37019
|
yield* Console61.log(
|
|
36927
|
-
chalk_default.dim(
|
|
37020
|
+
chalk_default.dim(
|
|
37021
|
+
` tailing ${input.type} logs for ${chalk_default.cyan(projectId)} [${chalk_default.white(target)}] \xB7 ${summary2}`
|
|
37022
|
+
)
|
|
36928
37023
|
);
|
|
36929
37024
|
yield* Console61.log("");
|
|
36930
37025
|
}
|
|
36931
|
-
const logStream = yield* api2.
|
|
37026
|
+
const logStream = yield* api2.createEnvironmentLogStream(envId, {
|
|
37027
|
+
type: input.type,
|
|
37028
|
+
...orgId ? { orgId } : {},
|
|
37029
|
+
...since ? { since: since.toISOString() } : {},
|
|
37030
|
+
...input.tail ? { limit: input.tail } : {},
|
|
37031
|
+
...levels.size === 1 ? { level: [...levels][0] } : {}
|
|
37032
|
+
});
|
|
36932
37033
|
const url = appendQuery(logStream.url, {
|
|
36933
|
-
since: since ? String(since.getTime()) : void 0,
|
|
36934
|
-
limit: input.tail ? String(input.tail) : void 0,
|
|
36935
37034
|
service: input.service
|
|
36936
37035
|
});
|
|
36937
37036
|
const filter = buildFilter({ levels, since, grep, service: input.service });
|
|
@@ -36966,6 +37065,7 @@ var tailCommand = Command61.make(
|
|
|
36966
37065
|
project: projectArg,
|
|
36967
37066
|
org: orgOption25,
|
|
36968
37067
|
env: envOption9,
|
|
37068
|
+
type: logTypeOption,
|
|
36969
37069
|
level: levelOption,
|
|
36970
37070
|
since: sinceOption,
|
|
36971
37071
|
tail: tailOption,
|
|
@@ -36973,10 +37073,11 @@ var tailCommand = Command61.make(
|
|
|
36973
37073
|
service: serviceOption,
|
|
36974
37074
|
json: jsonOption
|
|
36975
37075
|
},
|
|
36976
|
-
({ project, org, env, level, since, tail, grep, service, json }) => tailEffect({
|
|
37076
|
+
({ project, org, env, type, level, since, tail, grep, service, json }) => tailEffect({
|
|
36977
37077
|
project: project._tag === "Some" ? project.value : void 0,
|
|
36978
37078
|
org: org._tag === "Some" ? org.value : void 0,
|
|
36979
37079
|
env: env._tag === "Some" ? env.value : void 0,
|
|
37080
|
+
type,
|
|
36980
37081
|
level,
|
|
36981
37082
|
since: since._tag === "Some" ? since.value : void 0,
|
|
36982
37083
|
tail: tail._tag === "Some" ? tail.value : void 0,
|
|
@@ -36984,7 +37085,7 @@ var tailCommand = Command61.make(
|
|
|
36984
37085
|
service: service._tag === "Some" ? service.value : void 0,
|
|
36985
37086
|
json
|
|
36986
37087
|
})
|
|
36987
|
-
).pipe(Command61.withDescription("
|
|
37088
|
+
).pipe(Command61.withDescription("Follow runtime logs with structured formatting"));
|
|
36988
37089
|
|
|
36989
37090
|
// src/programs/tasks.ts
|
|
36990
37091
|
import { Args as Args42, Command as Command62, Options as Options63 } from "@effect/cli";
|