@zerct/zerct 0.1.6 → 0.1.7
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 +42 -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, apps,
|
|
24
|
+
deploys, builds, app/deploy/build logs, env metadata, custom domains, and
|
|
25
|
+
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.7'
|
|
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,12 @@ 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]
|
|
68
71
|
zerct apps [--api <url>] [--json]
|
|
69
|
-
zerct deploys --app <app_id> [--limit <n>] [--cursor <cursor>] [--api <url>] [--json]
|
|
70
|
-
zerct builds --app <app_id> [--limit <n>] [--cursor <cursor>] [--api <url>] [--json]
|
|
72
|
+
zerct deploys [--app <app_id>] [--limit <n>] [--cursor <cursor>] [--api <url>] [--json]
|
|
73
|
+
zerct builds [--app <app_id>] [--limit <n>] [--cursor <cursor>] [--api <url>] [--json]
|
|
71
74
|
zerct logs --app <app_id> [--deploy <deploy_id>] [--build <build_id>] [--limit <n>] [--cursor <cursor>] [--api <url>] [--json]
|
|
72
75
|
zerct status --app <app_id> [--api <url>] [--json]
|
|
73
76
|
zerct inspect --app <app_id> [--api <url>] [--json]
|
|
@@ -116,6 +119,15 @@ async function main() {
|
|
|
116
119
|
case 'deploy':
|
|
117
120
|
await deploy(projectPath(cli.args[0]), cli)
|
|
118
121
|
break
|
|
122
|
+
case 'capabilities':
|
|
123
|
+
await capabilities(cli)
|
|
124
|
+
break
|
|
125
|
+
case 'me':
|
|
126
|
+
await me(cli)
|
|
127
|
+
break
|
|
128
|
+
case 'usage':
|
|
129
|
+
await usage(cli)
|
|
130
|
+
break
|
|
119
131
|
case 'apps':
|
|
120
132
|
await apps(cli)
|
|
121
133
|
break
|
|
@@ -541,13 +553,38 @@ async function apps(cli) {
|
|
|
541
553
|
printJsonOrPretty(cli, response)
|
|
542
554
|
}
|
|
543
555
|
|
|
556
|
+
async function capabilities(cli) {
|
|
557
|
+
const response = await apiRequest(cli, 'GET', '/v1/capabilities', null, null)
|
|
558
|
+
printJsonOrPretty(cli, response)
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
async function me(cli) {
|
|
562
|
+
const token = await readOrLoginToken(process.cwd(), cli)
|
|
563
|
+
const response = await apiRequest(cli, 'GET', '/v1/me', token, null)
|
|
564
|
+
printJsonOrPretty(cli, response)
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
async function usage(cli) {
|
|
568
|
+
const token = await readOrLoginToken(process.cwd(), cli)
|
|
569
|
+
const response = await apiRequest(cli, 'GET', '/v1/usage', token, null)
|
|
570
|
+
printJsonOrPretty(cli, response)
|
|
571
|
+
}
|
|
572
|
+
|
|
544
573
|
async function deploys(cli) {
|
|
545
|
-
const
|
|
574
|
+
const token = await readOrLoginToken(process.cwd(), cli)
|
|
575
|
+
const route = cli.app
|
|
576
|
+
? `/v1/apps/${encodeURIComponent(cli.app)}/deploys${pageQuery(cli)}`
|
|
577
|
+
: `/v1/deploys${pageQuery(cli)}`
|
|
578
|
+
const response = await apiRequest(cli, 'GET', route, token, null)
|
|
546
579
|
printJsonOrPretty(cli, response)
|
|
547
580
|
}
|
|
548
581
|
|
|
549
582
|
async function builds(cli) {
|
|
550
|
-
const
|
|
583
|
+
const token = await readOrLoginToken(process.cwd(), cli)
|
|
584
|
+
const route = cli.app
|
|
585
|
+
? `/v1/apps/${encodeURIComponent(cli.app)}/builds${pageQuery(cli)}`
|
|
586
|
+
: `/v1/builds${pageQuery(cli)}`
|
|
587
|
+
const response = await apiRequest(cli, 'GET', route, token, null)
|
|
551
588
|
printJsonOrPretty(cli, response)
|
|
552
589
|
}
|
|
553
590
|
|