@zerct/zerct 0.1.6 → 0.1.8
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/README.md +3 -2
- package/bin/zerct.js +63 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,8 +20,9 @@ on `0.0.0.0:$PORT` and expose the configured health endpoint.
|
|
|
20
20
|
From a full-stack repo root, the same deploy command discovers nested
|
|
21
21
|
`zerct.toml` files and deploys the whole workspace in one command.
|
|
22
22
|
|
|
23
|
-
Agents can also inspect
|
|
24
|
-
|
|
23
|
+
Agents can also inspect API capabilities, account identity, usage, account
|
|
24
|
+
activity, apps, complete app overviews, deploys, builds, app/deploy/build logs,
|
|
25
|
+
env metadata, custom domains, and billing portal links through the same CLI.
|
|
25
26
|
|
|
26
27
|
On first deploy, the CLI opens browser login, waits for GitHub or Google, stores
|
|
27
28
|
the Zerct session in the OS credential store when available, and continues the
|
package/bin/zerct.js
CHANGED
|
@@ -4,7 +4,7 @@ import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSy
|
|
|
4
4
|
import { homedir } from 'node:os'
|
|
5
5
|
import path from 'node:path'
|
|
6
6
|
|
|
7
|
-
const VERSION = '0.1.
|
|
7
|
+
const VERSION = '0.1.8'
|
|
8
8
|
const DEFAULT_API_URL = 'https://api.zerct.com'
|
|
9
9
|
const ARCHIVE_LIMIT_BYTES = 48 * 1024 * 1024
|
|
10
10
|
const SESSION_DIR = '.zerct'
|
|
@@ -65,9 +65,14 @@ Usage:
|
|
|
65
65
|
zerct doctor [path] [--json]
|
|
66
66
|
zerct login [--token <token>] [--api <url>]
|
|
67
67
|
zerct deploy [path] [--database] [--api <url>] [--json]
|
|
68
|
+
zerct capabilities [--api <url>] [--json]
|
|
69
|
+
zerct me [--api <url>] [--json]
|
|
70
|
+
zerct usage [--api <url>] [--json]
|
|
71
|
+
zerct activity [--limit <n>] [--cursor <cursor>] [--api <url>] [--json]
|
|
68
72
|
zerct apps [--api <url>] [--json]
|
|
69
|
-
zerct
|
|
70
|
-
zerct
|
|
73
|
+
zerct overview --app <app_id> [--limit <n>] [--cursor <cursor>] [--api <url>] [--json]
|
|
74
|
+
zerct deploys [--app <app_id>] [--limit <n>] [--cursor <cursor>] [--api <url>] [--json]
|
|
75
|
+
zerct builds [--app <app_id>] [--limit <n>] [--cursor <cursor>] [--api <url>] [--json]
|
|
71
76
|
zerct logs --app <app_id> [--deploy <deploy_id>] [--build <build_id>] [--limit <n>] [--cursor <cursor>] [--api <url>] [--json]
|
|
72
77
|
zerct status --app <app_id> [--api <url>] [--json]
|
|
73
78
|
zerct inspect --app <app_id> [--api <url>] [--json]
|
|
@@ -116,9 +121,24 @@ async function main() {
|
|
|
116
121
|
case 'deploy':
|
|
117
122
|
await deploy(projectPath(cli.args[0]), cli)
|
|
118
123
|
break
|
|
124
|
+
case 'capabilities':
|
|
125
|
+
await capabilities(cli)
|
|
126
|
+
break
|
|
127
|
+
case 'me':
|
|
128
|
+
await me(cli)
|
|
129
|
+
break
|
|
130
|
+
case 'usage':
|
|
131
|
+
await usage(cli)
|
|
132
|
+
break
|
|
133
|
+
case 'activity':
|
|
134
|
+
await activity(cli)
|
|
135
|
+
break
|
|
119
136
|
case 'apps':
|
|
120
137
|
await apps(cli)
|
|
121
138
|
break
|
|
139
|
+
case 'overview':
|
|
140
|
+
await overview(cli)
|
|
141
|
+
break
|
|
122
142
|
case 'deploys':
|
|
123
143
|
await deploys(cli)
|
|
124
144
|
break
|
|
@@ -541,13 +561,51 @@ async function apps(cli) {
|
|
|
541
561
|
printJsonOrPretty(cli, response)
|
|
542
562
|
}
|
|
543
563
|
|
|
564
|
+
async function capabilities(cli) {
|
|
565
|
+
const response = await apiRequest(cli, 'GET', '/v1/capabilities', null, null)
|
|
566
|
+
printJsonOrPretty(cli, response)
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
async function me(cli) {
|
|
570
|
+
const token = await readOrLoginToken(process.cwd(), cli)
|
|
571
|
+
const response = await apiRequest(cli, 'GET', '/v1/me', token, null)
|
|
572
|
+
printJsonOrPretty(cli, response)
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
async function usage(cli) {
|
|
576
|
+
const token = await readOrLoginToken(process.cwd(), cli)
|
|
577
|
+
const response = await apiRequest(cli, 'GET', '/v1/usage', token, null)
|
|
578
|
+
printJsonOrPretty(cli, response)
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
async function activity(cli) {
|
|
582
|
+
const token = await readOrLoginToken(process.cwd(), cli)
|
|
583
|
+
const response = await apiRequest(cli, 'GET', `/v1/activity${pageQuery(cli)}`, token, null)
|
|
584
|
+
printJsonOrPretty(cli, response)
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
async function overview(cli) {
|
|
588
|
+
const token = await readOrLoginToken(process.cwd(), cli)
|
|
589
|
+
const app = requireApp(cli)
|
|
590
|
+
const response = await apiRequest(cli, 'GET', `/v1/apps/${encodeURIComponent(app)}/overview${pageQuery(cli)}`, token, null)
|
|
591
|
+
printJsonOrPretty(cli, response)
|
|
592
|
+
}
|
|
593
|
+
|
|
544
594
|
async function deploys(cli) {
|
|
545
|
-
const
|
|
595
|
+
const token = await readOrLoginToken(process.cwd(), cli)
|
|
596
|
+
const route = cli.app
|
|
597
|
+
? `/v1/apps/${encodeURIComponent(cli.app)}/deploys${pageQuery(cli)}`
|
|
598
|
+
: `/v1/deploys${pageQuery(cli)}`
|
|
599
|
+
const response = await apiRequest(cli, 'GET', route, token, null)
|
|
546
600
|
printJsonOrPretty(cli, response)
|
|
547
601
|
}
|
|
548
602
|
|
|
549
603
|
async function builds(cli) {
|
|
550
|
-
const
|
|
604
|
+
const token = await readOrLoginToken(process.cwd(), cli)
|
|
605
|
+
const route = cli.app
|
|
606
|
+
? `/v1/apps/${encodeURIComponent(cli.app)}/builds${pageQuery(cli)}`
|
|
607
|
+
: `/v1/builds${pageQuery(cli)}`
|
|
608
|
+
const response = await apiRequest(cli, 'GET', route, token, null)
|
|
551
609
|
printJsonOrPretty(cli, response)
|
|
552
610
|
}
|
|
553
611
|
|