@serve.zone/cli 5.3.0 → 5.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serve.zone/cli",
3
- "version": "5.3.0",
3
+ "version": "5.5.1",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "exports": {
@@ -9,11 +9,11 @@
9
9
  }
10
10
  },
11
11
  "dependencies": {
12
- "@serve.zone/api": "5.3.0",
13
- "@serve.zone/interfaces": "5.3.0",
14
- "@push.rocks/projectinfo": "^5.0.1",
15
- "@push.rocks/qenv": "^6.1.3",
16
- "@push.rocks/smartcli": "^4.0.11"
12
+ "@serve.zone/api": "^5.3.5",
13
+ "@serve.zone/interfaces": "^5.5.0",
14
+ "@push.rocks/projectinfo": "^5.1.0",
15
+ "@push.rocks/qenv": "^6.1.4",
16
+ "@push.rocks/smartcli": "^4.0.21"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@git.zone/tsbuild": "2.1.67"
@@ -27,13 +27,13 @@
27
27
  "dist_ts_web/**/*",
28
28
  "assets/**/*",
29
29
  "cli.js",
30
- "npmextra.json",
30
+ ".smartconfig.json",
31
31
  "readme.md"
32
32
  ],
33
33
  "bin": {
34
34
  "servezone": "./cli.js"
35
35
  },
36
36
  "scripts": {
37
- "build": "tsbuild tsfolders --allowimplicitany"
37
+ "build": "tsbuild tsfolders"
38
38
  }
39
39
  }
package/readme.md CHANGED
@@ -1,358 +1,105 @@
1
- # @serve.zone/cli 🚀
1
+ # @serve.zone/cli
2
2
 
3
- **Command-line interface for Cloudly.** Manage your multi-cloud infrastructure from the terminal with powerful, intuitive commands.
3
+ `@serve.zone/cli` is the published Cloudly CLI submodule. It provides the `servezone` binary and currently acts as a thin environment-driven client for connecting to a Cloudly control plane and listing clusters through `@serve.zone/api`.
4
4
 
5
- ## 🎯 What is @serve.zone/cli?
5
+ ## Issue Reporting and Security
6
6
 
7
- The Cloudly CLI brings the full power of the Cloudly platform to your terminal. Whether you're automating deployments, managing secrets, or monitoring services, the CLI provides a streamlined interface for all your cloud operations.
7
+ For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
8
8
 
9
- ## ✨ Features
9
+ ## Current Scope
10
10
 
11
- - **⚡ Fast & Efficient** - Optimized for speed and minimal resource usage
12
- - **🔐 Secure Authentication** - Token-based authentication with secure storage
13
- - **📝 Intuitive Commands** - Clear, consistent command structure
14
- - **🎨 Formatted Output** - Beautiful, readable output with color coding
15
- - **🔄 Scriptable** - Perfect for CI/CD pipelines and automation
16
- - **📊 Comprehensive** - Access to all Cloudly features from the terminal
11
+ This submodule is intentionally small in the current codebase:
17
12
 
18
- ## 🚀 Installation
13
+ - Reads `CLOUDLY_URL` through `@push.rocks/qenv`.
14
+ - Authenticates with either `CLOUDLY_TOKEN` or `CLOUDLY_USERNAME` plus `CLOUDLY_PASSWORD`.
15
+ - Starts a `CloudlyApiClient` registered as `cli`.
16
+ - Creates a `CliClient` wrapper around the API client.
17
+ - Calls `CliClient.getClusters()` and prints the result.
19
18
 
20
- ### Global Installation (Recommended)
19
+ It is not currently a full command tree for services, secrets, deployments, logs, profiles, or shell completion. Those flows should be implemented against `@serve.zone/api` before documenting them as CLI commands.
21
20
 
22
- ```bash
23
- pnpm add -g @serve.zone/cli
24
- ```
25
-
26
- ### Local Installation
27
-
28
- ```bash
29
- pnpm add @serve.zone/cli
30
- ```
31
-
32
- ## 🎬 Quick Start
33
-
34
- ```bash
35
- # Configure your Cloudly instance
36
- servezone config --url https://cloudly.example.com
37
-
38
- # Login with your service token
39
- servezone login --token your-service-token
40
-
41
- # List your clusters
42
- servezone clusters list
43
-
44
- # Deploy a service
45
- servezone deploy --cluster production --image myapp:latest
46
- ```
47
-
48
- ## 🔑 Authentication
49
-
50
- ### Initial Setup
51
-
52
- ```bash
53
- # Set your Cloudly instance URL
54
- servezone config --url https://cloudly.example.com
55
-
56
- # Authenticate with a service token
57
- servezone login --token YOUR_SERVICE_TOKEN
58
-
59
- # Or use environment variables
60
- export CLOUDLY_URL=https://cloudly.example.com
61
- export CLOUDLY_TOKEN=YOUR_SERVICE_TOKEN
62
- ```
63
-
64
- ### Managing Profiles
65
-
66
- ```bash
67
- # Create a profile for different environments
68
- servezone profile create production --url https://prod.cloudly.com
69
- servezone profile create staging --url https://stage.cloudly.com
70
-
71
- # Switch between profiles
72
- servezone profile use production
73
-
74
- # List all profiles
75
- servezone profile list
76
- ```
77
-
78
- ## 📚 Core Commands
79
-
80
- ### 🌐 Cluster Management
81
-
82
- ```bash
83
- # List all clusters
84
- servezone clusters list
85
-
86
- # Get cluster details
87
- servezone clusters info production-cluster
88
-
89
- # Create a new cluster
90
- servezone clusters create \
91
- --name production-cluster \
92
- --region eu-central \
93
- --nodes 3
94
-
95
- # Scale a cluster
96
- servezone clusters scale production-cluster --nodes 5
97
-
98
- # Delete a cluster
99
- servezone clusters delete staging-cluster
100
- ```
101
-
102
- ### 🐳 Service Deployment
103
-
104
- ```bash
105
- # Deploy a service
106
- servezone deploy \
107
- --cluster production \
108
- --name api-service \
109
- --image myapp:2.0.0 \
110
- --replicas 3 \
111
- --port 80:3000
112
-
113
- # Update a service
114
- servezone service update api-service \
115
- --image myapp:2.1.0 \
116
- --replicas 5
117
-
118
- # Scale a service
119
- servezone service scale api-service --replicas 10
120
-
121
- # Remove a service
122
- servezone service remove api-service
123
- ```
124
-
125
- ### 🔐 Secret Management
126
-
127
- ```bash
128
- # Create a secret
129
- servezone secrets create \
130
- --name database-url \
131
- --value "postgres://user:pass@host/db"
132
-
133
- # Create a secret group
134
- servezone secrets create-group \
135
- --name api-secrets \
136
- --secret DATABASE_URL=postgres://... \
137
- --secret REDIS_URL=redis://...
138
-
139
- # List secrets
140
- servezone secrets list
141
-
142
- # Get secret value
143
- servezone secrets get database-url
144
-
145
- # Delete a secret
146
- servezone secrets delete old-secret
147
- ```
148
-
149
- ### 📦 Image Management
150
-
151
- ```bash
152
- # List images
153
- servezone images list
154
-
155
- # Push a new image
156
- servezone images push \
157
- --name myapp \
158
- --version 2.0.0 \
159
- --file ./myapp.tar
160
-
161
- # Tag an image
162
- servezone images tag myapp:2.0.0 myapp:latest
163
-
164
- # Delete an image
165
- servezone images delete myapp:1.0.0
166
- ```
167
-
168
- ### 📊 Monitoring & Logs
169
-
170
- ```bash
171
- # View service logs
172
- servezone logs api-service
173
-
174
- # Follow logs in real-time
175
- servezone logs api-service --follow
176
-
177
- # Filter logs
178
- servezone logs api-service --since 1h --grep ERROR
179
-
180
- # Get service status
181
- servezone service status api-service
182
-
183
- # Monitor cluster health
184
- servezone clusters health production-cluster
185
- ```
186
-
187
- ### 🔧 DNS Management
188
-
189
- ```bash
190
- # List DNS records
191
- servezone dns list --domain example.com
192
-
193
- # Create a DNS record
194
- servezone dns create \
195
- --domain example.com \
196
- --name api \
197
- --type A \
198
- --value 192.168.1.1
199
-
200
- # Update a DNS record
201
- servezone dns update api.example.com --value 192.168.1.2
202
-
203
- # Delete a DNS record
204
- servezone dns delete old.example.com
205
- ```
206
-
207
- ## 🎯 Advanced Usage
21
+ ## Installation
208
22
 
209
- ### Environment Variables
23
+ The package is published from `cloudly/ts_cliclient` via `tspublish.json` under the name `@serve.zone/cli` with the `servezone` binary.
210
24
 
211
- ```bash
212
- # Set environment variables for a service
213
- servezone deploy \
214
- --name api-service \
215
- --env NODE_ENV=production \
216
- --env PORT=3000 \
217
- --env DATABASE_URL=@secret:database-url
218
- ```
219
-
220
- ### Configuration Files
221
-
222
- Create a `cloudly.yaml` file:
223
-
224
- ```yaml
225
- cluster: production
226
- service:
227
- name: api-service
228
- image: myapp:latest
229
- replicas: 3
230
- ports:
231
- - 80:3000
232
- environment:
233
- NODE_ENV: production
234
- DATABASE_URL: "@secret:database-url"
25
+ ```sh
26
+ pnpm add -g @serve.zone/cli
235
27
  ```
236
28
 
237
- Deploy using the config file:
29
+ For local development inside the Cloudly repository, build the parent package:
238
30
 
239
- ```bash
240
- servezone deploy --config cloudly.yaml
31
+ ```sh
32
+ pnpm install
33
+ pnpm build
241
34
  ```
242
35
 
243
- ### Batch Operations
36
+ ## Usage
244
37
 
245
- ```bash
246
- # Deploy multiple services
247
- servezone deploy --config services/*.yaml
38
+ Authenticate with a machine token:
248
39
 
249
- # Update all services in a namespace
250
- servezone service update --namespace api --image-tag v2.0.0
251
-
252
- # Delete all staging resources
253
- servezone cleanup --environment staging
40
+ ```sh
41
+ CLOUDLY_URL=https://cloudly.example.com \
42
+ CLOUDLY_TOKEN=cluster-or-api-token \
43
+ servezone
254
44
  ```
255
45
 
256
- ## 🔄 CI/CD Integration
257
-
258
- ### GitHub Actions
46
+ Authenticate with username and password:
259
47
 
260
- ```yaml
261
- - name: Deploy to Cloudly
262
- run: |
263
- servezone config --url ${{ secrets.CLOUDLY_URL }}
264
- servezone login --token ${{ secrets.CLOUDLY_TOKEN }}
265
- servezone deploy \
266
- --cluster production \
267
- --name api-service \
268
- --image myapp:${{ github.sha }}
48
+ ```sh
49
+ CLOUDLY_URL=https://cloudly.example.com \
50
+ CLOUDLY_USERNAME=admin \
51
+ CLOUDLY_PASSWORD=change-me \
52
+ servezone
269
53
  ```
270
54
 
271
- ### GitLab CI
55
+ When `CLOUDLY_TOKEN` is present, the CLI requests a stateful identity and asks Cloudly to tag the WebSocket connection. When username/password are present instead, it uses Cloudly's admin login flow. If no credentials are provided, the CLI prints a warning before attempting the default cluster-list operation.
272
56
 
273
- ```yaml
274
- deploy:
275
- script:
276
- - servezone config --url $CLOUDLY_URL
277
- - servezone login --token $CLOUDLY_TOKEN
278
- - servezone deploy --config cloudly.yaml
279
- ```
57
+ ## Programmatic Use
280
58
 
281
- ## 🎨 Output Formats
59
+ The submodule exports the `runCli()` entry point and uses `CliClient` internally:
282
60
 
283
- ```bash
284
- # JSON output for scripting
285
- servezone clusters list --output json
61
+ ```ts
62
+ import { CloudlyApiClient } from '@serve.zone/api';
63
+ import { CliClient } from './classes.cliclient.js';
286
64
 
287
- # YAML output
288
- servezone service info api-service --output yaml
65
+ const apiClient = new CloudlyApiClient({
66
+ registerAs: 'cli',
67
+ cloudlyUrl: 'https://cloudly.example.com',
68
+ });
289
69
 
290
- # Table output (default)
291
- servezone images list --output table
70
+ await apiClient.start();
71
+ await apiClient.loginWithUsernameAndPassword('admin', 'change-me');
292
72
 
293
- # Quiet mode (IDs only)
294
- servezone clusters list --quiet
73
+ const cli = new CliClient(apiClient);
74
+ await cli.getClusters();
295
75
  ```
296
76
 
297
- ## 🛠️ Troubleshooting
77
+ ## Files
298
78
 
299
- ```bash
300
- # Enable debug output
301
- servezone --debug clusters list
302
-
303
- # Check CLI version
304
- servezone version
305
-
306
- # Test connection
307
- servezone ping
308
-
309
- # View configuration
310
- servezone config show
311
-
312
- # Clear cache and credentials
313
- servezone logout --clear-cache
314
- ```
315
-
316
- ## 📝 Command Reference
317
-
318
- ```bash
319
- servezone --help # Show all commands
320
- servezone <command> --help # Show command-specific help
321
- servezone clusters --help # Show cluster commands
322
- servezone service --help # Show service commands
323
- servezone secrets --help # Show secret commands
324
- ```
325
-
326
- ## 🔌 Shell Completion
327
-
328
- Enable tab completion for your shell:
329
-
330
- ```bash
331
- # Bash
332
- servezone completion bash > /etc/bash_completion.d/servezone
333
-
334
- # Zsh
335
- servezone completion zsh > ~/.zsh/completions/_servezone
336
-
337
- # Fish
338
- servezone completion fish > ~/.config/fish/completions/servezone.fish
339
- ```
79
+ | Path | Purpose |
80
+ | --- | --- |
81
+ | `index.ts` | Runtime entry point for the published CLI. |
82
+ | `classes.cliclient.ts` | Minimal client wrapper; currently exposes `getClusters()`. |
83
+ | `plugins.ts` | Centralized imports for the submodule. |
84
+ | `tspublish.json` | Published package name, dependencies, registry targets, and `servezone` bin metadata. |
340
85
 
341
86
  ## License and Legal Information
342
87
 
343
- This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
88
+ This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [license](../license) file.
344
89
 
345
90
  **Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
346
91
 
347
92
  ### Trademarks
348
93
 
349
- This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
94
+ This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
95
+
96
+ Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
350
97
 
351
98
  ### Company Information
352
99
 
353
100
  Task Venture Capital GmbH
354
- Registered at District court Bremen HRB 35230 HB, Germany
101
+ Registered at District Court Bremen HRB 35230 HB, Germany
355
102
 
356
- For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
103
+ For any legal inquiries or further information, please contact us via email at hello@task.vc.
357
104
 
358
- By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
105
+ By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
@@ -1,11 +1,28 @@
1
1
  import * as plugins from './plugins.js';
2
- import { CliClient } from "./classes.cliclient.js";
2
+ import { CliClient } from './classes.cliclient.js';
3
3
 
4
4
  export const runCli = async () => {
5
5
  const cliQenv = new plugins.qenv.Qenv();
6
+ const cloudlyUrl = await cliQenv.getEnvVarOnDemand('CLOUDLY_URL');
7
+ const token = process.env.CLOUDLY_TOKEN;
8
+ const username = process.env.CLOUDLY_USERNAME;
9
+ const password = process.env.CLOUDLY_PASSWORD;
10
+
6
11
  const apiClient = new plugins.servezoneApi.CloudlyApiClient({
7
12
  registerAs: 'cli',
8
- cloudlyUrl: await cliQenv.getEnvVarOnDemand('CLOUDLY_URL'),
13
+ cloudlyUrl,
9
14
  });
15
+ await apiClient.start();
16
+
17
+ if (token) {
18
+ await apiClient.getIdentityByToken(token, { tagConnection: true, statefullIdentity: true });
19
+ } else if (username && password) {
20
+ await apiClient.loginWithUsernameAndPassword(username, password);
21
+ } else {
22
+ console.log('No credentials provided. Set CLOUDLY_TOKEN or CLOUDLY_USERNAME/CLOUDLY_PASSWORD.');
23
+ }
24
+
10
25
  const cliClient = new CliClient(apiClient);
11
- };
26
+ // Default action example: list clusters when invoked without subcommands
27
+ await cliClient.getClusters();
28
+ };
@@ -14,4 +14,4 @@ import * as qenv from '@push.rocks/qenv';
14
14
  export {
15
15
  projectinfo,
16
16
  qenv,
17
- }
17
+ }
@@ -1,358 +1,105 @@
1
- # @serve.zone/cli 🚀
1
+ # @serve.zone/cli
2
2
 
3
- **Command-line interface for Cloudly.** Manage your multi-cloud infrastructure from the terminal with powerful, intuitive commands.
3
+ `@serve.zone/cli` is the published Cloudly CLI submodule. It provides the `servezone` binary and currently acts as a thin environment-driven client for connecting to a Cloudly control plane and listing clusters through `@serve.zone/api`.
4
4
 
5
- ## 🎯 What is @serve.zone/cli?
5
+ ## Issue Reporting and Security
6
6
 
7
- The Cloudly CLI brings the full power of the Cloudly platform to your terminal. Whether you're automating deployments, managing secrets, or monitoring services, the CLI provides a streamlined interface for all your cloud operations.
7
+ For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
8
8
 
9
- ## ✨ Features
9
+ ## Current Scope
10
10
 
11
- - **⚡ Fast & Efficient** - Optimized for speed and minimal resource usage
12
- - **🔐 Secure Authentication** - Token-based authentication with secure storage
13
- - **📝 Intuitive Commands** - Clear, consistent command structure
14
- - **🎨 Formatted Output** - Beautiful, readable output with color coding
15
- - **🔄 Scriptable** - Perfect for CI/CD pipelines and automation
16
- - **📊 Comprehensive** - Access to all Cloudly features from the terminal
11
+ This submodule is intentionally small in the current codebase:
17
12
 
18
- ## 🚀 Installation
13
+ - Reads `CLOUDLY_URL` through `@push.rocks/qenv`.
14
+ - Authenticates with either `CLOUDLY_TOKEN` or `CLOUDLY_USERNAME` plus `CLOUDLY_PASSWORD`.
15
+ - Starts a `CloudlyApiClient` registered as `cli`.
16
+ - Creates a `CliClient` wrapper around the API client.
17
+ - Calls `CliClient.getClusters()` and prints the result.
19
18
 
20
- ### Global Installation (Recommended)
19
+ It is not currently a full command tree for services, secrets, deployments, logs, profiles, or shell completion. Those flows should be implemented against `@serve.zone/api` before documenting them as CLI commands.
21
20
 
22
- ```bash
23
- pnpm add -g @serve.zone/cli
24
- ```
25
-
26
- ### Local Installation
27
-
28
- ```bash
29
- pnpm add @serve.zone/cli
30
- ```
31
-
32
- ## 🎬 Quick Start
33
-
34
- ```bash
35
- # Configure your Cloudly instance
36
- servezone config --url https://cloudly.example.com
37
-
38
- # Login with your service token
39
- servezone login --token your-service-token
40
-
41
- # List your clusters
42
- servezone clusters list
43
-
44
- # Deploy a service
45
- servezone deploy --cluster production --image myapp:latest
46
- ```
47
-
48
- ## 🔑 Authentication
49
-
50
- ### Initial Setup
51
-
52
- ```bash
53
- # Set your Cloudly instance URL
54
- servezone config --url https://cloudly.example.com
55
-
56
- # Authenticate with a service token
57
- servezone login --token YOUR_SERVICE_TOKEN
58
-
59
- # Or use environment variables
60
- export CLOUDLY_URL=https://cloudly.example.com
61
- export CLOUDLY_TOKEN=YOUR_SERVICE_TOKEN
62
- ```
63
-
64
- ### Managing Profiles
65
-
66
- ```bash
67
- # Create a profile for different environments
68
- servezone profile create production --url https://prod.cloudly.com
69
- servezone profile create staging --url https://stage.cloudly.com
70
-
71
- # Switch between profiles
72
- servezone profile use production
73
-
74
- # List all profiles
75
- servezone profile list
76
- ```
77
-
78
- ## 📚 Core Commands
79
-
80
- ### 🌐 Cluster Management
81
-
82
- ```bash
83
- # List all clusters
84
- servezone clusters list
85
-
86
- # Get cluster details
87
- servezone clusters info production-cluster
88
-
89
- # Create a new cluster
90
- servezone clusters create \
91
- --name production-cluster \
92
- --region eu-central \
93
- --nodes 3
94
-
95
- # Scale a cluster
96
- servezone clusters scale production-cluster --nodes 5
97
-
98
- # Delete a cluster
99
- servezone clusters delete staging-cluster
100
- ```
101
-
102
- ### 🐳 Service Deployment
103
-
104
- ```bash
105
- # Deploy a service
106
- servezone deploy \
107
- --cluster production \
108
- --name api-service \
109
- --image myapp:2.0.0 \
110
- --replicas 3 \
111
- --port 80:3000
112
-
113
- # Update a service
114
- servezone service update api-service \
115
- --image myapp:2.1.0 \
116
- --replicas 5
117
-
118
- # Scale a service
119
- servezone service scale api-service --replicas 10
120
-
121
- # Remove a service
122
- servezone service remove api-service
123
- ```
124
-
125
- ### 🔐 Secret Management
126
-
127
- ```bash
128
- # Create a secret
129
- servezone secrets create \
130
- --name database-url \
131
- --value "postgres://user:pass@host/db"
132
-
133
- # Create a secret group
134
- servezone secrets create-group \
135
- --name api-secrets \
136
- --secret DATABASE_URL=postgres://... \
137
- --secret REDIS_URL=redis://...
138
-
139
- # List secrets
140
- servezone secrets list
141
-
142
- # Get secret value
143
- servezone secrets get database-url
144
-
145
- # Delete a secret
146
- servezone secrets delete old-secret
147
- ```
148
-
149
- ### 📦 Image Management
150
-
151
- ```bash
152
- # List images
153
- servezone images list
154
-
155
- # Push a new image
156
- servezone images push \
157
- --name myapp \
158
- --version 2.0.0 \
159
- --file ./myapp.tar
160
-
161
- # Tag an image
162
- servezone images tag myapp:2.0.0 myapp:latest
163
-
164
- # Delete an image
165
- servezone images delete myapp:1.0.0
166
- ```
167
-
168
- ### 📊 Monitoring & Logs
169
-
170
- ```bash
171
- # View service logs
172
- servezone logs api-service
173
-
174
- # Follow logs in real-time
175
- servezone logs api-service --follow
176
-
177
- # Filter logs
178
- servezone logs api-service --since 1h --grep ERROR
179
-
180
- # Get service status
181
- servezone service status api-service
182
-
183
- # Monitor cluster health
184
- servezone clusters health production-cluster
185
- ```
186
-
187
- ### 🔧 DNS Management
188
-
189
- ```bash
190
- # List DNS records
191
- servezone dns list --domain example.com
192
-
193
- # Create a DNS record
194
- servezone dns create \
195
- --domain example.com \
196
- --name api \
197
- --type A \
198
- --value 192.168.1.1
199
-
200
- # Update a DNS record
201
- servezone dns update api.example.com --value 192.168.1.2
202
-
203
- # Delete a DNS record
204
- servezone dns delete old.example.com
205
- ```
206
-
207
- ## 🎯 Advanced Usage
21
+ ## Installation
208
22
 
209
- ### Environment Variables
23
+ The package is published from `cloudly/ts_cliclient` via `tspublish.json` under the name `@serve.zone/cli` with the `servezone` binary.
210
24
 
211
- ```bash
212
- # Set environment variables for a service
213
- servezone deploy \
214
- --name api-service \
215
- --env NODE_ENV=production \
216
- --env PORT=3000 \
217
- --env DATABASE_URL=@secret:database-url
218
- ```
219
-
220
- ### Configuration Files
221
-
222
- Create a `cloudly.yaml` file:
223
-
224
- ```yaml
225
- cluster: production
226
- service:
227
- name: api-service
228
- image: myapp:latest
229
- replicas: 3
230
- ports:
231
- - 80:3000
232
- environment:
233
- NODE_ENV: production
234
- DATABASE_URL: "@secret:database-url"
25
+ ```sh
26
+ pnpm add -g @serve.zone/cli
235
27
  ```
236
28
 
237
- Deploy using the config file:
29
+ For local development inside the Cloudly repository, build the parent package:
238
30
 
239
- ```bash
240
- servezone deploy --config cloudly.yaml
31
+ ```sh
32
+ pnpm install
33
+ pnpm build
241
34
  ```
242
35
 
243
- ### Batch Operations
36
+ ## Usage
244
37
 
245
- ```bash
246
- # Deploy multiple services
247
- servezone deploy --config services/*.yaml
38
+ Authenticate with a machine token:
248
39
 
249
- # Update all services in a namespace
250
- servezone service update --namespace api --image-tag v2.0.0
251
-
252
- # Delete all staging resources
253
- servezone cleanup --environment staging
40
+ ```sh
41
+ CLOUDLY_URL=https://cloudly.example.com \
42
+ CLOUDLY_TOKEN=cluster-or-api-token \
43
+ servezone
254
44
  ```
255
45
 
256
- ## 🔄 CI/CD Integration
257
-
258
- ### GitHub Actions
46
+ Authenticate with username and password:
259
47
 
260
- ```yaml
261
- - name: Deploy to Cloudly
262
- run: |
263
- servezone config --url ${{ secrets.CLOUDLY_URL }}
264
- servezone login --token ${{ secrets.CLOUDLY_TOKEN }}
265
- servezone deploy \
266
- --cluster production \
267
- --name api-service \
268
- --image myapp:${{ github.sha }}
48
+ ```sh
49
+ CLOUDLY_URL=https://cloudly.example.com \
50
+ CLOUDLY_USERNAME=admin \
51
+ CLOUDLY_PASSWORD=change-me \
52
+ servezone
269
53
  ```
270
54
 
271
- ### GitLab CI
55
+ When `CLOUDLY_TOKEN` is present, the CLI requests a stateful identity and asks Cloudly to tag the WebSocket connection. When username/password are present instead, it uses Cloudly's admin login flow. If no credentials are provided, the CLI prints a warning before attempting the default cluster-list operation.
272
56
 
273
- ```yaml
274
- deploy:
275
- script:
276
- - servezone config --url $CLOUDLY_URL
277
- - servezone login --token $CLOUDLY_TOKEN
278
- - servezone deploy --config cloudly.yaml
279
- ```
57
+ ## Programmatic Use
280
58
 
281
- ## 🎨 Output Formats
59
+ The submodule exports the `runCli()` entry point and uses `CliClient` internally:
282
60
 
283
- ```bash
284
- # JSON output for scripting
285
- servezone clusters list --output json
61
+ ```ts
62
+ import { CloudlyApiClient } from '@serve.zone/api';
63
+ import { CliClient } from './classes.cliclient.js';
286
64
 
287
- # YAML output
288
- servezone service info api-service --output yaml
65
+ const apiClient = new CloudlyApiClient({
66
+ registerAs: 'cli',
67
+ cloudlyUrl: 'https://cloudly.example.com',
68
+ });
289
69
 
290
- # Table output (default)
291
- servezone images list --output table
70
+ await apiClient.start();
71
+ await apiClient.loginWithUsernameAndPassword('admin', 'change-me');
292
72
 
293
- # Quiet mode (IDs only)
294
- servezone clusters list --quiet
73
+ const cli = new CliClient(apiClient);
74
+ await cli.getClusters();
295
75
  ```
296
76
 
297
- ## 🛠️ Troubleshooting
77
+ ## Files
298
78
 
299
- ```bash
300
- # Enable debug output
301
- servezone --debug clusters list
302
-
303
- # Check CLI version
304
- servezone version
305
-
306
- # Test connection
307
- servezone ping
308
-
309
- # View configuration
310
- servezone config show
311
-
312
- # Clear cache and credentials
313
- servezone logout --clear-cache
314
- ```
315
-
316
- ## 📝 Command Reference
317
-
318
- ```bash
319
- servezone --help # Show all commands
320
- servezone <command> --help # Show command-specific help
321
- servezone clusters --help # Show cluster commands
322
- servezone service --help # Show service commands
323
- servezone secrets --help # Show secret commands
324
- ```
325
-
326
- ## 🔌 Shell Completion
327
-
328
- Enable tab completion for your shell:
329
-
330
- ```bash
331
- # Bash
332
- servezone completion bash > /etc/bash_completion.d/servezone
333
-
334
- # Zsh
335
- servezone completion zsh > ~/.zsh/completions/_servezone
336
-
337
- # Fish
338
- servezone completion fish > ~/.config/fish/completions/servezone.fish
339
- ```
79
+ | Path | Purpose |
80
+ | --- | --- |
81
+ | `index.ts` | Runtime entry point for the published CLI. |
82
+ | `classes.cliclient.ts` | Minimal client wrapper; currently exposes `getClusters()`. |
83
+ | `plugins.ts` | Centralized imports for the submodule. |
84
+ | `tspublish.json` | Published package name, dependencies, registry targets, and `servezone` bin metadata. |
340
85
 
341
86
  ## License and Legal Information
342
87
 
343
- This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
88
+ This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [license](../license) file.
344
89
 
345
90
  **Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
346
91
 
347
92
  ### Trademarks
348
93
 
349
- This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
94
+ This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
95
+
96
+ Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
350
97
 
351
98
  ### Company Information
352
99
 
353
100
  Task Venture Capital GmbH
354
- Registered at District court Bremen HRB 35230 HB, Germany
101
+ Registered at District Court Bremen HRB 35230 HB, Germany
355
102
 
356
- For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
103
+ For any legal inquiries or further information, please contact us via email at hello@task.vc.
357
104
 
358
- By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
105
+ By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
@@ -1,6 +0,0 @@
1
- import { CloudlyApiClient } from '@serve.zone/api';
2
- export declare class CliClient {
3
- cloudlyApiClient: CloudlyApiClient;
4
- constructor(cloudlyApiClientArg: CloudlyApiClient);
5
- getClusters(): Promise<void>;
6
- }
@@ -1,12 +0,0 @@
1
- import * as plugins from './plugins.js';
2
- import { CloudlyApiClient } from '@serve.zone/api';
3
- export class CliClient {
4
- constructor(cloudlyApiClientArg) {
5
- this.cloudlyApiClient = cloudlyApiClientArg;
6
- }
7
- async getClusters() {
8
- const clusters = await this.cloudlyApiClient.cluster.getClusters();
9
- console.log(clusters);
10
- }
11
- }
12
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3Nlcy5jbGljbGllbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90c19jbGljbGllbnQvY2xhc3Nlcy5jbGljbGllbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSxjQUFjLENBQUM7QUFDeEMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFFbkQsTUFBTSxPQUFPLFNBQVM7SUFHcEIsWUFBWSxtQkFBcUM7UUFDL0MsSUFBSSxDQUFDLGdCQUFnQixHQUFHLG1CQUFtQixDQUFDO0lBQzlDLENBQUM7SUFFTSxLQUFLLENBQUMsV0FBVztRQUN0QixNQUFNLFFBQVEsR0FBRyxNQUFNLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxPQUFPLENBQUMsV0FBVyxFQUFFLENBQUM7UUFDbkUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxRQUFRLENBQUMsQ0FBQztJQUN4QixDQUFDO0NBQ0YifQ==
@@ -1 +0,0 @@
1
- export declare const runCli: () => Promise<void>;
@@ -1,11 +0,0 @@
1
- import * as plugins from './plugins.js';
2
- import { CliClient } from "./classes.cliclient.js";
3
- export const runCli = async () => {
4
- const cliQenv = new plugins.qenv.Qenv();
5
- const apiClient = new plugins.servezoneApi.CloudlyApiClient({
6
- registerAs: 'cli',
7
- cloudlyUrl: await cliQenv.getEnvVarOnDemand('CLOUDLY_URL'),
8
- });
9
- const cliClient = new CliClient(apiClient);
10
- };
11
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90c19jbGljbGllbnQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSxjQUFjLENBQUM7QUFDeEMsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRW5ELE1BQU0sQ0FBQyxNQUFNLE1BQU0sR0FBRyxLQUFLLElBQUksRUFBRTtJQUMvQixNQUFNLE9BQU8sR0FBRyxJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLENBQUM7SUFDeEMsTUFBTSxTQUFTLEdBQUcsSUFBSSxPQUFPLENBQUMsWUFBWSxDQUFDLGdCQUFnQixDQUFDO1FBQzFELFVBQVUsRUFBRSxLQUFLO1FBQ2pCLFVBQVUsRUFBRSxNQUFNLE9BQU8sQ0FBQyxpQkFBaUIsQ0FBQyxhQUFhLENBQUM7S0FDM0QsQ0FBQyxDQUFDO0lBQ0gsTUFBTSxTQUFTLEdBQUcsSUFBSSxTQUFTLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDN0MsQ0FBQyxDQUFDIn0=
@@ -1,6 +0,0 @@
1
- import * as servezoneApi from '@serve.zone/api';
2
- import * as servezoneInterfaces from '@serve.zone/interfaces';
3
- export { servezoneApi, servezoneInterfaces };
4
- import * as projectinfo from '@push.rocks/projectinfo';
5
- import * as qenv from '@push.rocks/qenv';
6
- export { projectinfo, qenv, };
@@ -1,9 +0,0 @@
1
- // @serve.zone scope
2
- import * as servezoneApi from '@serve.zone/api';
3
- import * as servezoneInterfaces from '@serve.zone/interfaces';
4
- export { servezoneApi, servezoneInterfaces };
5
- // @push.rocks scope
6
- import * as projectinfo from '@push.rocks/projectinfo';
7
- import * as qenv from '@push.rocks/qenv';
8
- export { projectinfo, qenv, };
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzX2NsaWNsaWVudC9wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG9CQUFvQjtBQUNwQixPQUFPLEtBQUssWUFBWSxNQUFNLGlCQUFpQixDQUFDO0FBQ2hELE9BQU8sS0FBSyxtQkFBbUIsTUFBTSx3QkFBd0IsQ0FBQztBQUU5RCxPQUFPLEVBQ0wsWUFBWSxFQUNaLG1CQUFtQixFQUNwQixDQUFBO0FBRUQsb0JBQW9CO0FBQ3BCLE9BQU8sS0FBSyxXQUFXLE1BQU0seUJBQXlCLENBQUM7QUFDdkQsT0FBTyxLQUFLLElBQUksTUFBTSxrQkFBa0IsQ0FBQztBQUV6QyxPQUFPLEVBQ0wsV0FBVyxFQUNYLElBQUksR0FDTCxDQUFBIn0=