@byteplus-iga-pages/cli 0.0.0-stage → 1.1.13

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BytePlus Pte. Ltd.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,291 @@
1
- # Temporary Holding Version
1
+ <br/>
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <div align="center">
4
+ <h3 align="center">BytePlus IGA Pages CLI</h3>
5
+ </div>
6
+
7
+ <br/>
8
+
9
+ ## Overview
10
+
11
+ BytePlus IGA Pages is a full-stack development and deployment platform powered by BytePlus IGA. It supports static sites, server-side rendering, and serverless functions, delivering projects to a global edge network with zero infrastructure management.
12
+
13
+ `@byteplus-iga-pages/cli` is the official command-line interface for BytePlus IGA Pages, helping you manage projects, develop locally, and debug Functions from your terminal.
14
+
15
+ <br/>
16
+
17
+ ## Prerequisites
18
+
19
+ To get started, create an account with [BytePlus](https://console.byteplus.com).
20
+
21
+ <br/>
22
+
23
+ ## Installation
24
+
25
+ ```bash
26
+ npm install -g @byteplus-iga-pages/cli
27
+ ```
28
+
29
+ Verify the installation:
30
+
31
+ ```bash
32
+ iga -v
33
+ iga -h
34
+ ```
35
+
36
+ <br/>
37
+
38
+ ## Commands
39
+
40
+ ### `bp-iga login`
41
+
42
+ Authenticate with your BytePlus account:
43
+
44
+ ```bash
45
+ bp-iga login # local browser login
46
+ bp-iga login --remote # cross-device login (e.g. SSH)
47
+ bp-iga login --accessKey <AK> --secretKey <SK> # AK/SK for automation
48
+ ```
49
+
50
+ `--remote` cannot be combined with AK/SK.
51
+
52
+ ---
53
+
54
+ ### `bp-iga pages init`
55
+
56
+ ```bash
57
+ bp-iga pages init --list --json
58
+ bp-iga pages init my-agent --template <template-id>
59
+ bp-iga pages init my-agent --template <template-id> --name my-remote-project
60
+ ```
61
+
62
+ Download a template into a new or empty directory. AI templates also create a remote project, bind an AI Gateway, and write `.env.local`. Use `--name` to override the directory-based project name. Install dependencies, then run `bp-iga pages dev`.
63
+
64
+ ---
65
+
66
+ ### `bp-iga switch`
67
+
68
+ Switch to a different BytePlus account by re-running the login flow.
69
+
70
+ ```bash
71
+ bp-iga switch
72
+ ```
73
+
74
+ `bp-iga logout` removes only the local `~/.bp-iga/auth.json`; it does not revoke the server-side Refresh Token.
75
+
76
+ ---
77
+
78
+ ### `bp-iga pages link`
79
+
80
+ Link the current directory to an BytePlus IGA Pages project. The CLI auto-detects a matching project by directory name, or lets you pick from your existing projects. If no project exists yet, it can create one (including GitHub-connected projects when a Git remote is detected).
81
+
82
+ ```bash
83
+ bp-iga pages link
84
+ bp-iga pages link --format=json
85
+ bp-iga pages link --yes --format=json
86
+ bp-iga pages link --project <project-id-or-name> --yes
87
+ ```
88
+
89
+ `--format=json` controls the output format. Without an execution option, it prints existing project choices, the directory-derived default project name, a matching project when one exists, and a suggested `nextCommand` without changing local or remote state. Combined with `--yes`, `--project`, or `--name`, it performs the requested link or creation and prints a `status=success` result.
90
+
91
+ `--project` links to an existing project without prompting. It matches ProjectID first, then ProjectName. If a name is ambiguous, pass the ProjectID from `bp-iga pages link --format=json`.
92
+
93
+ ---
94
+
95
+ ### `bp-iga pages deploy`
96
+
97
+ Build and deploy the current project to the BytePlus IGA Pages edge network. The CLI supports two deployment modes:
98
+
99
+ - **Git-based** — If a GitHub remote is detected and authorized, the platform pulls source code directly from the repository.
100
+ - **Direct upload** — Source files are zipped and uploaded when no Git provider is available.
101
+
102
+ For linked projects (see `bp-iga pages link`), re-deployment is triggered automatically. For new projects, the CLI walks you through creation first.
103
+
104
+ ```bash
105
+ bp-iga pages deploy # deploy current project
106
+ bp-iga pages deploy --logs # stream complete build logs
107
+ ```
108
+
109
+ By default, show deployment progress and full logs on failure. Use `--logs` to stream all build logs.
110
+
111
+ ---
112
+
113
+ ### `bp-iga pages inspect`
114
+
115
+ Inspect a deployment from any directory, optionally wait for completion or show
116
+ its build logs.
117
+
118
+ ```bash
119
+ bp-iga pages inspect <deployment-id>
120
+ bp-iga pages inspect <deployment-id> --wait --timeout 3m
121
+ bp-iga pages inspect <deployment-id> --logs
122
+ bp-iga pages inspect <deployment-id> --logs --wait --format json
123
+ ```
124
+
125
+ `--format json` writes only the final summary or three-stage build-log array to
126
+ stdout. Diagnostics use stderr. `--project` validates ownership but is not
127
+ required to resolve the deployment. The summary keeps the API status unchanged,
128
+ omits provider, and resolves an accessible Preview URL through
129
+ `GetPreviewDomain`; preview lookup failure is reported as `-` or
130
+ `previewUrl: null` without failing the command.
131
+
132
+ ---
133
+
134
+ ### `bp-iga pages preview`
135
+
136
+ Resolve the preview URL for a project or a specific deployment.
137
+
138
+ ```bash
139
+ bp-iga pages preview --project <name-or-id>
140
+ bp-iga pages preview --project <name-or-id> --deployment <deployment-id>
141
+ bp-iga pages preview --json
142
+ ```
143
+
144
+ Without `--deployment`, the request sends only `ProjectID` to `GetPreviewDomain`;
145
+ no deployment is selected automatically. Without a project argument, the linked
146
+ project in `.iga/project.json` is used. JSON output contains `previewUrl`,
147
+ `projectId`, and `projectName`; `deployId` is included only when specified.
148
+
149
+ ---
150
+
151
+ ### `bp-iga pages logs`
152
+
153
+ Query historical runtime logs for the linked project or an explicit deployment.
154
+ The default range is the latest 24 hours and the default total limit is 100.
155
+
156
+ ```bash
157
+ bp-iga pages logs
158
+ bp-iga pages logs <deployment-id> --since 1h --limit 250
159
+ bp-iga pages logs --project <name-or-id> --content timeout
160
+ bp-iga pages logs --content error --level error
161
+ bp-iga pages logs --json | jq .
162
+ ```
163
+
164
+ `--content` and `--level` generate quoted query clauses. When both are present,
165
+ the CLI joins them with `AND`.
166
+
167
+ Human-readable output removes terminal control sequences from every backend
168
+ field and renders embedded line controls as visible escapes, so one record stays
169
+ on one terminal line. Ordinary text is unchanged.
170
+
171
+ `--json/-j` emits one stable JSON object per line. Pagination uses the API
172
+ Context internally; field values remain unchanged and are escaped by JSON
173
+ encoding. This command is a historical query and does not implement real-time
174
+ follow.
175
+
176
+ ---
177
+
178
+ ### `bp-iga pages dev`
179
+
180
+ Start a local development server. The CLI reads the `dev` or `start` script from your `package.json`, injects the port automatically if the framework supports it, and falls back to framework defaults when no script is found.
181
+
182
+ ```bash
183
+ bp-iga pages dev # start on http://localhost:3000
184
+ ```
185
+
186
+ ---
187
+
188
+ ### `bp-iga pages list`
189
+
190
+ List recent deployments for the currently-linked project, or all projects in your account. Aliased as `bp-iga pages ls`.
191
+
192
+ When run inside a linked directory (or with a project name/ID), it lists that project's recent deployments. Otherwise it lists every project in your account, so you can discover a name or ID to link or inspect.
193
+
194
+ ```bash
195
+ bp-iga pages list # linked project's deployments, or all projects
196
+ bp-iga pages list my-project # a specific project's deployments (by name or ID)
197
+ bp-iga pages ls --json # machine-readable output
198
+ ```
199
+
200
+ | Flag | Description |
201
+ | ---------------- | ------------------------------------------------------------------ |
202
+ | `[project]` | Project name or ID (defaults to the linked `.iga/project.json`) |
203
+ | `--project <id>` | Project name or ID (alias for the positional argument) |
204
+ | `--json` | Output machine-readable JSON |
205
+
206
+ ---
207
+
208
+ ### `bp-iga pages env`
209
+
210
+ Manage project-level environment variables for the linked BytePlus IGA Pages project.
211
+
212
+ ```bash
213
+ bp-iga pages env list
214
+ bp-iga pages env list --format=json
215
+ bp-iga pages env add <name> --value <value> --yes
216
+ bp-iga pages env update <name> --value <value> --yes
217
+ bp-iga pages env remove <name> --yes
218
+ bp-iga pages env pull
219
+ ```
220
+
221
+ `env list` only shows variable names. `--format=json` returns `env[].key` and never prints values.
222
+
223
+ ---
224
+
225
+ ### `bp-iga pages integration`
226
+
227
+ Manage project integrations: `supabase` (`byteplus_supabase`) and `aigateway` (`ai_gateway`).
228
+
229
+ ```bash
230
+ bp-iga pages integration list
231
+ bp-iga pages integration list --format=json
232
+
233
+ bp-iga pages integration link supabase
234
+ bp-iga pages integration link supabase --region <region> --format=json
235
+ bp-iga pages integration link supabase \
236
+ --product byteplus_supabase \
237
+ --region <region> \
238
+ --resource <workspace-name-or-id> \
239
+ --branch <branch-name-or-id> \
240
+ --framework-prefix NEXT_PUBLIC_ \
241
+ --prefix APP_ \
242
+ --yes
243
+
244
+ bp-iga pages integration unlink
245
+ bp-iga pages integration unlink supabase --format=json
246
+ bp-iga pages integration unlink supabase \
247
+ --product byteplus_supabase \
248
+ --resource <workspace-name-or-id> \
249
+ --branch <branch-name-or-id> \
250
+ --yes
251
+ ```
252
+
253
+ Bind or unbind an existing AI Gateway in a linked project directory:
254
+
255
+ ```bash
256
+ bp-iga pages integration link aigateway
257
+ bp-iga pages integration link aigateway --resource <gateway-name-or-id>
258
+ bp-iga pages integration link aigateway --format=json
259
+ bp-iga pages integration unlink aigateway --yes
260
+ bp-iga pages env pull
261
+ ```
262
+
263
+ Each project can bind one gateway by name or ID. Unlink it before switching; the instance is kept. Changes take effect on the next deployment. Gateway variables stay server-side and ignore prefixes.
264
+
265
+ `--format=json` returns structured choices and next steps for IDEs and agents.
266
+
267
+ Prefixes must be 1–63 characters, start with a letter, and contain only letters, numbers, or underscores. Use an empty `--framework-prefix` to skip browser-exposed variables.
268
+
269
+ ---
270
+
271
+ ### `bp-iga logout`
272
+
273
+ Sign out of the currently logged-in BytePlus account.
274
+
275
+ ```bash
276
+ bp-iga logout
277
+ ```
278
+
279
+ ---
280
+
281
+ ### `bp-iga whoami`
282
+
283
+ Display information about the currently authenticated account.
284
+
285
+ ```bash
286
+ bp-iga whoami
287
+ ```
288
+
289
+ ## License
290
+
291
+ MIT © BytePlus Pte. Ltd.
package/bin/bp-iga.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+
3
+ require('../dist/index.js');
4
+