sealos-cli 1.0.0 → 1.1.1
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 +50 -60
- package/dist/bin/cli.cjs +145 -21
- package/dist/bin/cli.mjs +145 -21
- package/dist/main.cjs +145 -21
- package/dist/main.mjs +145 -21
- package/package.json +5 -4
- package/src/commands/app/index.ts +5 -4
- package/src/commands/database/index.ts +1 -1
- package/src/commands/quota/index.ts +4 -3
- package/src/commands/s3/index.ts +5 -5
- package/src/commands/template/index.ts +4 -4
- package/src/lib/api-client.ts +1 -1
- package/src/lib/auth.ts +5 -5
- package/src/lib/errors.ts +1 -1
- package/src/lib/output.ts +5 -6
- package/src/main.ts +3 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Sealos CLI
|
|
2
2
|
|
|
3
|
-
Official CLI tool for Sealos Cloud - Manage
|
|
3
|
+
Official CLI tool for Sealos Cloud - Manage auth, workspaces, devboxes, databases, and templates.
|
|
4
4
|
|
|
5
5
|
## Project Structure
|
|
6
6
|
|
|
@@ -18,16 +18,10 @@ src/
|
|
|
18
18
|
│ │ └── index.ts
|
|
19
19
|
│ ├── devbox/ # Devbox management
|
|
20
20
|
│ │ └── index.ts
|
|
21
|
-
│ ├── s3/ # S3 object storage
|
|
22
|
-
│ │ └── index.ts
|
|
23
21
|
│ ├── database/ # Database management
|
|
24
22
|
│ │ └── index.ts
|
|
25
23
|
│ ├── template/ # Template management
|
|
26
24
|
│ │ └── index.ts
|
|
27
|
-
│ ├── quota/ # Resource quotas
|
|
28
|
-
│ │ └── index.ts
|
|
29
|
-
│ ├── app/ # Application management
|
|
30
|
-
│ └── index.ts
|
|
31
25
|
├── lib/ # Shared libraries
|
|
32
26
|
│ ├── api-client.ts # OpenAPI client factories
|
|
33
27
|
│ ├── auth.ts # Sealos auth and kubeconfig headers
|
|
@@ -55,7 +49,7 @@ src/
|
|
|
55
49
|
|
|
56
50
|
### Output Formatting (`lib/output.ts`)
|
|
57
51
|
|
|
58
|
-
-
|
|
52
|
+
- JSON and table output helpers for command responses
|
|
59
53
|
- Colored terminal output using chalk
|
|
60
54
|
- Loading spinners using ora
|
|
61
55
|
- Table formatting using table
|
|
@@ -103,78 +97,78 @@ npm test
|
|
|
103
97
|
|
|
104
98
|
```bash
|
|
105
99
|
# Login in browser and exchange for regional token + kubeconfig automatically
|
|
106
|
-
sealos login https://usw-1.sealos.io
|
|
100
|
+
sealos-cli login https://usw-1.sealos.io
|
|
107
101
|
|
|
108
102
|
# Check current user
|
|
109
|
-
sealos whoami
|
|
103
|
+
sealos-cli whoami
|
|
110
104
|
|
|
111
105
|
# Inspect auth and switch workspace
|
|
112
|
-
sealos auth info
|
|
113
|
-
sealos auth list
|
|
114
|
-
sealos auth switch <workspace-id-or-team-name>
|
|
106
|
+
sealos-cli auth info
|
|
107
|
+
sealos-cli auth list
|
|
108
|
+
sealos-cli auth switch <workspace-id-or-team-name>
|
|
115
109
|
|
|
116
110
|
# Logout
|
|
117
|
-
sealos logout
|
|
111
|
+
sealos-cli logout
|
|
118
112
|
```
|
|
119
113
|
|
|
120
114
|
### Template Management
|
|
121
115
|
|
|
122
116
|
```bash
|
|
123
117
|
# Deploy from the catalog
|
|
124
|
-
sealos template deploy perplexica --name my-app --set OPENAI_API_KEY=xxx
|
|
118
|
+
sealos-cli template deploy perplexica --name my-app --set OPENAI_API_KEY=xxx
|
|
125
119
|
|
|
126
120
|
# Validate raw template YAML without creating resources
|
|
127
|
-
sealos template deploy --file ./template.yaml --dry-run
|
|
121
|
+
sealos-cli template deploy --file ./template.yaml --dry-run
|
|
128
122
|
```
|
|
129
123
|
|
|
130
124
|
### Workspace Management
|
|
131
125
|
|
|
132
126
|
```bash
|
|
133
127
|
# List workspaces
|
|
134
|
-
sealos workspace list
|
|
128
|
+
sealos-cli workspace list
|
|
135
129
|
|
|
136
130
|
# Switch workspace
|
|
137
|
-
sealos workspace switch production
|
|
131
|
+
sealos-cli workspace switch production
|
|
138
132
|
|
|
139
133
|
# Show current workspace
|
|
140
|
-
sealos workspace current
|
|
134
|
+
sealos-cli workspace current
|
|
141
135
|
```
|
|
142
136
|
|
|
143
137
|
### Devbox Management
|
|
144
138
|
|
|
145
139
|
```bash
|
|
146
140
|
# Create a devbox
|
|
147
|
-
sealos devbox create --name my-devbox --runtime next.js --cpu 2c --memory 4g --port 3000:http:public
|
|
141
|
+
sealos-cli devbox create --name my-devbox --runtime next.js --cpu 2c --memory 4g --port 3000:http:public
|
|
148
142
|
|
|
149
143
|
# List devboxes
|
|
150
|
-
sealos devbox list
|
|
151
|
-
sealos devbox list --output json
|
|
144
|
+
sealos-cli devbox list
|
|
145
|
+
sealos-cli devbox list --output json
|
|
152
146
|
|
|
153
147
|
# Get devbox details
|
|
154
|
-
sealos devbox get my-devbox
|
|
148
|
+
sealos-cli devbox get my-devbox
|
|
155
149
|
|
|
156
150
|
# Update resources or ports
|
|
157
|
-
sealos devbox update my-devbox --cpu 4 --memory 8 --port portName=web,number=3000,protocol=http,isPublic=true
|
|
151
|
+
sealos-cli devbox update my-devbox --cpu 4 --memory 8 --port portName=web,number=3000,protocol=http,isPublic=true
|
|
158
152
|
|
|
159
153
|
# Start/Pause/Shutdown/Restart
|
|
160
|
-
sealos devbox start my-devbox
|
|
161
|
-
sealos devbox pause my-devbox
|
|
162
|
-
sealos devbox shutdown my-devbox
|
|
163
|
-
sealos devbox restart my-devbox
|
|
154
|
+
sealos-cli devbox start my-devbox
|
|
155
|
+
sealos-cli devbox pause my-devbox
|
|
156
|
+
sealos-cli devbox shutdown my-devbox
|
|
157
|
+
sealos-cli devbox restart my-devbox
|
|
164
158
|
|
|
165
159
|
# Configure autostart and inspect monitor data
|
|
166
|
-
sealos devbox autostart my-devbox --exec-command "npm start"
|
|
167
|
-
sealos devbox monitor my-devbox --step 2m
|
|
160
|
+
sealos-cli devbox autostart my-devbox --exec-command "npm start"
|
|
161
|
+
sealos-cli devbox monitor my-devbox --step 2m
|
|
168
162
|
|
|
169
163
|
# Templates, releases, and deployments
|
|
170
|
-
sealos devbox templates
|
|
171
|
-
sealos devbox releases list my-devbox
|
|
172
|
-
sealos devbox releases create my-devbox --tag v1-0-0 --description "First release"
|
|
173
|
-
sealos devbox releases deploy my-devbox v1-0-0
|
|
174
|
-
sealos devbox deployments my-devbox
|
|
164
|
+
sealos-cli devbox templates
|
|
165
|
+
sealos-cli devbox releases list my-devbox
|
|
166
|
+
sealos-cli devbox releases create my-devbox --tag v1-0-0 --description "First release"
|
|
167
|
+
sealos-cli devbox releases deploy my-devbox v1-0-0
|
|
168
|
+
sealos-cli devbox deployments my-devbox
|
|
175
169
|
|
|
176
170
|
# Delete devbox
|
|
177
|
-
sealos devbox delete my-devbox
|
|
171
|
+
sealos-cli devbox delete my-devbox
|
|
178
172
|
```
|
|
179
173
|
|
|
180
174
|
Implementation: `src/commands/devbox/index.ts`, backed by `src/docs/devbox_openapi.json`.
|
|
@@ -183,33 +177,33 @@ Implementation: `src/commands/devbox/index.ts`, backed by `src/docs/devbox_opena
|
|
|
183
177
|
|
|
184
178
|
```bash
|
|
185
179
|
# List databases
|
|
186
|
-
sealos database list
|
|
180
|
+
sealos-cli database list
|
|
187
181
|
|
|
188
182
|
# Get database details
|
|
189
|
-
sealos database get my-db
|
|
183
|
+
sealos-cli database get my-db
|
|
190
184
|
|
|
191
185
|
# Create a database
|
|
192
|
-
sealos database create postgresql --name my-db --cpu 1 --memory 2 --storage 5 --replicas 1
|
|
186
|
+
sealos-cli database create postgresql --name my-db --cpu 1 --memory 2 --storage 5 --replicas 1
|
|
193
187
|
|
|
194
188
|
# Show connection details
|
|
195
|
-
sealos database connection my-db
|
|
189
|
+
sealos-cli database connection my-db
|
|
196
190
|
|
|
197
191
|
# More commands
|
|
198
|
-
sealos database --help
|
|
199
|
-
sealos database <subcommand> --help
|
|
192
|
+
sealos-cli database --help
|
|
193
|
+
sealos-cli database <subcommand> --help
|
|
200
194
|
|
|
201
195
|
# Operational commands backed by src/docs/database_openapi.json
|
|
202
|
-
sealos database update my-db --cpu 2 --memory 4
|
|
203
|
-
sealos database start my-db
|
|
204
|
-
sealos database pause my-db
|
|
205
|
-
sealos database restart my-db
|
|
206
|
-
sealos database backup my-db --name manual-backup
|
|
207
|
-
sealos database backups my-db
|
|
208
|
-
sealos database restore my-db --from manual-backup --name restored-db
|
|
209
|
-
sealos database enable-public my-db
|
|
210
|
-
sealos database disable-public my-db
|
|
211
|
-
sealos database log-files <pod-name> --db-type postgresql --log-type runtimeLog
|
|
212
|
-
sealos database logs <pod-name> --db-type postgresql --log-type runtimeLog --log-path /path/to/log
|
|
196
|
+
sealos-cli database update my-db --cpu 2 --memory 4
|
|
197
|
+
sealos-cli database start my-db
|
|
198
|
+
sealos-cli database pause my-db
|
|
199
|
+
sealos-cli database restart my-db
|
|
200
|
+
sealos-cli database backup my-db --name manual-backup
|
|
201
|
+
sealos-cli database backups my-db
|
|
202
|
+
sealos-cli database restore my-db --from manual-backup --name restored-db
|
|
203
|
+
sealos-cli database enable-public my-db
|
|
204
|
+
sealos-cli database disable-public my-db
|
|
205
|
+
sealos-cli database log-files <pod-name> --db-type postgresql --log-type runtimeLog
|
|
206
|
+
sealos-cli database logs <pod-name> --db-type postgresql --log-type runtimeLog --log-path /path/to/log
|
|
213
207
|
```
|
|
214
208
|
|
|
215
209
|
Implementation: `src/commands/database/index.ts`
|
|
@@ -221,13 +215,9 @@ Implementation: `src/commands/database/index.ts`
|
|
|
221
215
|
- `SEALOS_DEVBOX_HOST`: Override devbox provider host for devbox commands
|
|
222
216
|
- `DEBUG`: Enable debug mode for verbose error output
|
|
223
217
|
|
|
224
|
-
##
|
|
225
|
-
|
|
226
|
-
Some command implementations still contain TODO comments where API integration is needed. Key areas:
|
|
218
|
+
## v1 Scope
|
|
227
219
|
|
|
228
|
-
|
|
229
|
-
2. **Interactive Prompts**: Use inquirer for confirmations
|
|
230
|
-
3. **YAML Support**: Add YAML output formatting
|
|
220
|
+
The v1 command surface is limited to auth, workspace, template, database, and devbox operations. Future modules such as S3/object storage, quota inspection, and application management are intentionally not registered or documented as available commands.
|
|
231
221
|
|
|
232
222
|
## Best Practices Implemented
|
|
233
223
|
|
|
@@ -235,7 +225,7 @@ Some command implementations still contain TODO comments where API integration i
|
|
|
235
225
|
- TypeScript for type safety
|
|
236
226
|
- Shared utilities for common operations
|
|
237
227
|
- Consistent error handling
|
|
238
|
-
-
|
|
228
|
+
- JSON and table output formats
|
|
239
229
|
- Environment variable support
|
|
240
230
|
- Loading indicators for async operations
|
|
241
231
|
- Color-coded terminal output
|
package/dist/bin/cli.cjs
CHANGED
|
@@ -90,7 +90,7 @@ __name(saveAuth, "saveAuth");
|
|
|
90
90
|
function loadAuth(deps = {}) {
|
|
91
91
|
const { paths } = withDeps(deps);
|
|
92
92
|
if (!(0, import_node_fs.existsSync)(paths.authPath)) {
|
|
93
|
-
throw new Error("Not authenticated. Please run: sealos login");
|
|
93
|
+
throw new Error("Not authenticated. Please run: sealos-cli login");
|
|
94
94
|
}
|
|
95
95
|
return JSON.parse((0, import_node_fs.readFileSync)(paths.authPath, "utf-8"));
|
|
96
96
|
}
|
|
@@ -112,7 +112,7 @@ __name(getAuthHeaders, "getAuthHeaders");
|
|
|
112
112
|
function requireAuth(deps = {}) {
|
|
113
113
|
const headers = getAuthHeaders(deps);
|
|
114
114
|
if (!headers) {
|
|
115
|
-
throw new Error('Authentication required. Please run "sealos login" first.');
|
|
115
|
+
throw new Error('Authentication required. Please run "sealos-cli login" first.');
|
|
116
116
|
}
|
|
117
117
|
return headers;
|
|
118
118
|
}
|
|
@@ -398,7 +398,7 @@ __name(loginWithDeviceFlow, "loginWithDeviceFlow");
|
|
|
398
398
|
async function listWorkspaces(deps = {}) {
|
|
399
399
|
const auth = loadAuth(deps);
|
|
400
400
|
if (!auth.regional_token) {
|
|
401
|
-
throw new Error("No regional_token found. Please run: sealos login");
|
|
401
|
+
throw new Error("No regional_token found. Please run: sealos-cli login");
|
|
402
402
|
}
|
|
403
403
|
const workspaces = await listRemoteWorkspaces(auth.region, auth.regional_token, deps);
|
|
404
404
|
return {
|
|
@@ -415,12 +415,12 @@ async function listWorkspaces(deps = {}) {
|
|
|
415
415
|
__name(listWorkspaces, "listWorkspaces");
|
|
416
416
|
async function switchWorkspace(target, deps = {}) {
|
|
417
417
|
if (!target) {
|
|
418
|
-
throw new Error("Usage: sealos auth switch <namespace-id-or-uid>");
|
|
418
|
+
throw new Error("Usage: sealos-cli auth switch <namespace-id-or-uid>");
|
|
419
419
|
}
|
|
420
420
|
const fullDeps = withDeps(deps);
|
|
421
421
|
const auth = loadAuth(fullDeps);
|
|
422
422
|
if (!auth.regional_token) {
|
|
423
|
-
throw new Error("No regional_token found. Please run: sealos login");
|
|
423
|
+
throw new Error("No regional_token found. Please run: sealos-cli login");
|
|
424
424
|
}
|
|
425
425
|
const workspaces = await listRemoteWorkspaces(auth.region, auth.regional_token, fullDeps);
|
|
426
426
|
if (workspaces.length === 0) {
|
|
@@ -3388,11 +3388,7 @@ var StdinDiscarder = class {
|
|
|
3388
3388
|
}
|
|
3389
3389
|
const code = typeof chunk === "string" ? chunk.codePointAt(0) : chunk[0];
|
|
3390
3390
|
if (code === ASCII_ETX_CODE) {
|
|
3391
|
-
|
|
3392
|
-
import_node_process5.default.emit("SIGINT");
|
|
3393
|
-
} else {
|
|
3394
|
-
import_node_process5.default.kill(import_node_process5.default.pid, "SIGINT");
|
|
3395
|
-
}
|
|
3391
|
+
import_node_process5.default.kill(import_node_process5.default.pid, "SIGINT");
|
|
3396
3392
|
}
|
|
3397
3393
|
}, "#handleInputBound");
|
|
3398
3394
|
start() {
|
|
@@ -3449,6 +3445,7 @@ var RENDER_DEFERRAL_TIMEOUT = 200;
|
|
|
3449
3445
|
var SYNCHRONIZED_OUTPUT_ENABLE = "\x1B[?2026h";
|
|
3450
3446
|
var SYNCHRONIZED_OUTPUT_DISABLE = "\x1B[?2026l";
|
|
3451
3447
|
var activeHooksPerStream = /* @__PURE__ */ new Map();
|
|
3448
|
+
var validColors = /* @__PURE__ */ new Set(["black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "gray"]);
|
|
3452
3449
|
var Ora = class {
|
|
3453
3450
|
static {
|
|
3454
3451
|
__name(this, "Ora");
|
|
@@ -3465,7 +3462,7 @@ var Ora = class {
|
|
|
3465
3462
|
#drainHandler;
|
|
3466
3463
|
#deferRenderTimer;
|
|
3467
3464
|
#isDiscardingStdin = false;
|
|
3468
|
-
color;
|
|
3465
|
+
#color;
|
|
3469
3466
|
// Helper to execute writes while preventing hook recursion
|
|
3470
3467
|
#internalWrite(fn) {
|
|
3471
3468
|
this.#isInternalWrite = true;
|
|
@@ -3550,6 +3547,9 @@ var Ora = class {
|
|
|
3550
3547
|
if (typeof this.#options.isSilent !== "boolean") {
|
|
3551
3548
|
this.#options.isSilent = false;
|
|
3552
3549
|
}
|
|
3550
|
+
if (this.#options.interval !== void 0 && !(Number.isInteger(this.#options.interval) && this.#options.interval > 0)) {
|
|
3551
|
+
throw new Error("The `interval` option must be a positive integer");
|
|
3552
|
+
}
|
|
3553
3553
|
const userInterval = this.#options.interval;
|
|
3554
3554
|
this.spinner = this.#options.spinner;
|
|
3555
3555
|
this.#options.interval = userInterval;
|
|
@@ -3664,6 +3664,15 @@ var Ora = class {
|
|
|
3664
3664
|
}
|
|
3665
3665
|
return count;
|
|
3666
3666
|
}
|
|
3667
|
+
get color() {
|
|
3668
|
+
return this.#color;
|
|
3669
|
+
}
|
|
3670
|
+
set color(value) {
|
|
3671
|
+
if (value !== void 0 && value !== false && !validColors.has(value)) {
|
|
3672
|
+
throw new Error("The `color` option must be a valid color or `false` to disable");
|
|
3673
|
+
}
|
|
3674
|
+
this.#color = value;
|
|
3675
|
+
}
|
|
3667
3676
|
get isEnabled() {
|
|
3668
3677
|
return this.#options.isEnabled && !this.#options.isSilent;
|
|
3669
3678
|
}
|
|
@@ -3690,8 +3699,8 @@ var Ora = class {
|
|
|
3690
3699
|
}
|
|
3691
3700
|
const { frames } = this.#spinner;
|
|
3692
3701
|
let frame = frames[this.#frameIndex];
|
|
3693
|
-
if (this
|
|
3694
|
-
frame = source_default[this
|
|
3702
|
+
if (this.#color) {
|
|
3703
|
+
frame = source_default[this.#color](frame);
|
|
3695
3704
|
}
|
|
3696
3705
|
const fullPrefixText = this.#getFullPrefixText(this.#options.prefixText, " ");
|
|
3697
3706
|
const fullText = typeof this.text === "string" ? " " + this.text : "";
|
|
@@ -3938,7 +3947,7 @@ var AuthError = class extends CliError {
|
|
|
3938
3947
|
static {
|
|
3939
3948
|
__name(this, "AuthError");
|
|
3940
3949
|
}
|
|
3941
|
-
constructor(message = 'Authentication required. Please run "sealos login" first.') {
|
|
3950
|
+
constructor(message = 'Authentication required. Please run "sealos-cli login" first.') {
|
|
3942
3951
|
super(message, 1);
|
|
3943
3952
|
this.name = "AuthError";
|
|
3944
3953
|
}
|
|
@@ -4739,7 +4748,7 @@ function resolveHost(options) {
|
|
|
4739
4748
|
}
|
|
4740
4749
|
const host = options?.baseUrl || process.env.SEALOS_REGION || authRegion || DEFAULT_SEALOS_REGION;
|
|
4741
4750
|
if (!host) {
|
|
4742
|
-
throw new ConfigError('No Sealos Cloud host configured. Run "sealos login <host>" first.');
|
|
4751
|
+
throw new ConfigError('No Sealos Cloud host configured. Run "sealos-cli login <host>" first.');
|
|
4743
4752
|
}
|
|
4744
4753
|
return host.replace(/\/+$/, "");
|
|
4745
4754
|
}
|
|
@@ -5702,7 +5711,7 @@ function createDatabaseCommand() {
|
|
|
5702
5711
|
}
|
|
5703
5712
|
ctx.spinner.succeed(`Database "${data.name}" created successfully`);
|
|
5704
5713
|
console.log(source_default.dim(` Provisioning status: ${data.status}`));
|
|
5705
|
-
console.log(source_default.dim(` Next: sealos database get ${data.name}`));
|
|
5714
|
+
console.log(source_default.dim(` Next: sealos-cli database get ${data.name}`));
|
|
5706
5715
|
}));
|
|
5707
5716
|
dbCmd.command("get <name>").alias("describe").description("Get database details").option("-o, --output <format>", "Output format (json|table)", "table").action(withAuth({ spinnerText: "Loading database..." }, async (ctx, name, options) => {
|
|
5708
5717
|
const client = createDatabaseClient();
|
|
@@ -6241,14 +6250,14 @@ function createTemplateCommand() {
|
|
|
6241
6250
|
tplCmd.command("deploy [template]").description("Deploy a template (from catalog or raw YAML)").option("--name <name>", "Instance name (required when deploying from catalog)").option("--file <path>", "Path to template YAML file").option("--yaml <yaml>", "Template YAML string").option("--set <KEY=VALUE...>", "Set template arguments", (val, prev) => [...prev, val], []).option("--dry-run", "Validate raw template YAML without creating resources").addHelpText("after", `
|
|
6242
6251
|
Examples:
|
|
6243
6252
|
Catalog:
|
|
6244
|
-
sealos template deploy perplexica --name my-app --set OPENAI_API_KEY=xxx
|
|
6253
|
+
sealos-cli template deploy perplexica --name my-app --set OPENAI_API_KEY=xxx
|
|
6245
6254
|
|
|
6246
6255
|
Raw:
|
|
6247
|
-
sealos template deploy --file ./template.yaml --dry-run
|
|
6248
|
-
sealos template deploy --yaml 'apiVersion: app.sealos.io/v1
|
|
6256
|
+
sealos-cli template deploy --file ./template.yaml --dry-run
|
|
6257
|
+
sealos-cli template deploy --yaml 'apiVersion: app.sealos.io/v1
|
|
6249
6258
|
kind: Template
|
|
6250
6259
|
...'
|
|
6251
|
-
cat template.yaml | sealos template deploy --dry-run
|
|
6260
|
+
cat template.yaml | sealos-cli template deploy --dry-run
|
|
6252
6261
|
`).action(async (template, options) => {
|
|
6253
6262
|
const mode = resolveTemplateDeployMode(template, options);
|
|
6254
6263
|
await deployTemplate(template, options, mode);
|
|
@@ -6257,10 +6266,125 @@ kind: Template
|
|
|
6257
6266
|
}
|
|
6258
6267
|
__name(createTemplateCommand, "createTemplateCommand");
|
|
6259
6268
|
|
|
6269
|
+
// package.json
|
|
6270
|
+
var package_default = {
|
|
6271
|
+
name: "sealos-cli",
|
|
6272
|
+
version: "1.1.1",
|
|
6273
|
+
description: "Official CLI tool for Sealos Cloud - Manage auth, workspaces, devboxes, databases, and templates",
|
|
6274
|
+
types: "dist/main.d.ts",
|
|
6275
|
+
type: "module",
|
|
6276
|
+
bin: {
|
|
6277
|
+
"sealos-cli": "dist/bin/cli.cjs"
|
|
6278
|
+
},
|
|
6279
|
+
exports: {
|
|
6280
|
+
".": {
|
|
6281
|
+
import: {
|
|
6282
|
+
types: "./dist/main.d.ts",
|
|
6283
|
+
default: "./dist/main.mjs"
|
|
6284
|
+
},
|
|
6285
|
+
require: {
|
|
6286
|
+
types: "./dist/main.d.cts",
|
|
6287
|
+
default: "./dist/main.cjs"
|
|
6288
|
+
},
|
|
6289
|
+
default: "./dist/main.mjs"
|
|
6290
|
+
},
|
|
6291
|
+
"./dist/*": {
|
|
6292
|
+
types: "./dist/*.d.ts",
|
|
6293
|
+
import: "./dist/*.mjs",
|
|
6294
|
+
require: "./dist/*.cjs"
|
|
6295
|
+
}
|
|
6296
|
+
},
|
|
6297
|
+
engines: {
|
|
6298
|
+
node: ">=22.0.0"
|
|
6299
|
+
},
|
|
6300
|
+
packageManager: "npm@8.4.0",
|
|
6301
|
+
files: [
|
|
6302
|
+
"dist",
|
|
6303
|
+
"src",
|
|
6304
|
+
"bin"
|
|
6305
|
+
],
|
|
6306
|
+
scripts: {
|
|
6307
|
+
start: "node --import tsx src/bin/cli.ts",
|
|
6308
|
+
"generate:api": "openapi-typescript src/docs/template_openapi.json -o src/generated/template.ts && openapi-typescript src/docs/database_openapi.json -o src/generated/database.ts && openapi-typescript src/docs/devbox_openapi.json -o src/generated/devbox.ts",
|
|
6309
|
+
build: "npm run generate:api && tsc && tsup",
|
|
6310
|
+
lint: "eslint . && npm run lint:lockfile && npm run lint:markdown",
|
|
6311
|
+
"lint:markdown": "npx -y markdownlint-cli@0.45.0 -c .github/.markdownlint.yml -i '.git' -i '__tests__' -i '.github' -i '.changeset' -i 'CODE_OF_CONDUCT.md' -i 'CHANGELOG.md' -i 'docs/**' -i 'node_modules' -i 'dist' '**/**.md' --fix",
|
|
6312
|
+
"lint:fix": "eslint . --fix",
|
|
6313
|
+
"lint:lockfile": "lockfile-lint --path package-lock.json --validate-https --allowed-hosts npm yarn",
|
|
6314
|
+
test: "vitest run",
|
|
6315
|
+
"test:watch": "vitest",
|
|
6316
|
+
"test:coverage": "vitest run --coverage",
|
|
6317
|
+
"coverage:view": "open coverage/lcov-report/index.html",
|
|
6318
|
+
version: "changeset version",
|
|
6319
|
+
release: "changeset publish"
|
|
6320
|
+
},
|
|
6321
|
+
author: {
|
|
6322
|
+
name: "zjy365",
|
|
6323
|
+
email: "3161362058@qq.com",
|
|
6324
|
+
url: "https://github.com/zjy365"
|
|
6325
|
+
},
|
|
6326
|
+
publishConfig: {
|
|
6327
|
+
provenance: true,
|
|
6328
|
+
access: "public"
|
|
6329
|
+
},
|
|
6330
|
+
license: "Apache-2.0",
|
|
6331
|
+
keywords: [
|
|
6332
|
+
"sealos",
|
|
6333
|
+
"cli",
|
|
6334
|
+
"cloud",
|
|
6335
|
+
"devbox",
|
|
6336
|
+
"database",
|
|
6337
|
+
"kubernetes",
|
|
6338
|
+
"deployment",
|
|
6339
|
+
"template",
|
|
6340
|
+
"workspace"
|
|
6341
|
+
],
|
|
6342
|
+
homepage: "https://github.com/zjy365/sealos-cli.git",
|
|
6343
|
+
bugs: {
|
|
6344
|
+
url: "https://github.com/zjy365/sealos-cli.git/issues"
|
|
6345
|
+
},
|
|
6346
|
+
repository: {
|
|
6347
|
+
type: "git",
|
|
6348
|
+
url: "git+https://github.com/zjy365/sealos-cli.git"
|
|
6349
|
+
},
|
|
6350
|
+
dependencies: {
|
|
6351
|
+
axios: "^1.15.0",
|
|
6352
|
+
chalk: "^5.2.0",
|
|
6353
|
+
commander: "^14.0.3",
|
|
6354
|
+
"openapi-fetch": "^0.17.0",
|
|
6355
|
+
ora: "^9.3.0",
|
|
6356
|
+
table: "^6.8.1"
|
|
6357
|
+
},
|
|
6358
|
+
devDependencies: {
|
|
6359
|
+
"@changesets/changelog-github": "^0.5.0",
|
|
6360
|
+
"@changesets/cli": "^2.27.7",
|
|
6361
|
+
"@types/node": "^20.14.10",
|
|
6362
|
+
"@vitest/coverage-v8": "^4.1.6",
|
|
6363
|
+
eslint: "^9.6.0",
|
|
6364
|
+
"eslint-plugin-security": "^3.0.1",
|
|
6365
|
+
husky: "^9.0.11",
|
|
6366
|
+
"lint-staged": "^15.2.7",
|
|
6367
|
+
"lockfile-lint": "^4.14.0",
|
|
6368
|
+
neostandard: "^0.11.0",
|
|
6369
|
+
"openapi-typescript": "^7.13.0",
|
|
6370
|
+
"ts-node": "^10.9.2",
|
|
6371
|
+
tsup: "^8.1.0",
|
|
6372
|
+
tsx: "^4.19.4",
|
|
6373
|
+
typescript: "^5.5.3",
|
|
6374
|
+
"validate-conventional-commit": "^1.0.4",
|
|
6375
|
+
vitest: "^4.1.6"
|
|
6376
|
+
},
|
|
6377
|
+
"lint-staged": {
|
|
6378
|
+
"**/*.{js,json}": [
|
|
6379
|
+
"npm run lint:fix"
|
|
6380
|
+
]
|
|
6381
|
+
}
|
|
6382
|
+
};
|
|
6383
|
+
|
|
6260
6384
|
// src/main.ts
|
|
6261
6385
|
function createProgram() {
|
|
6262
6386
|
const program = new import_commander9.Command();
|
|
6263
|
-
program.name("sealos").description("Official CLI tool for Sealos Cloud - Manage devbox, databases, templates, auth, and workspaces").version(
|
|
6387
|
+
program.name("sealos-cli").description("Official CLI tool for Sealos Cloud - Manage devbox, databases, templates, auth, and workspaces").version(package_default.version);
|
|
6264
6388
|
registerAuthCommands(program);
|
|
6265
6389
|
program.addCommand(createWorkspaceCommand());
|
|
6266
6390
|
program.addCommand(createDevboxCommand());
|