suthep 0.1.0-beta.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.
Files changed (65) hide show
  1. package/.editorconfig +17 -0
  2. package/.prettierignore +6 -0
  3. package/.prettierrc +7 -0
  4. package/.vscode/settings.json +19 -0
  5. package/LICENSE +21 -0
  6. package/README.md +217 -0
  7. package/dist/commands/deploy.js +318 -0
  8. package/dist/commands/deploy.js.map +1 -0
  9. package/dist/commands/init.js +188 -0
  10. package/dist/commands/init.js.map +1 -0
  11. package/dist/commands/setup.js +90 -0
  12. package/dist/commands/setup.js.map +1 -0
  13. package/dist/index.js +19 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/utils/certbot.js +64 -0
  16. package/dist/utils/certbot.js.map +1 -0
  17. package/dist/utils/config-loader.js +95 -0
  18. package/dist/utils/config-loader.js.map +1 -0
  19. package/dist/utils/deployment.js +76 -0
  20. package/dist/utils/deployment.js.map +1 -0
  21. package/dist/utils/docker.js +393 -0
  22. package/dist/utils/docker.js.map +1 -0
  23. package/dist/utils/nginx.js +303 -0
  24. package/dist/utils/nginx.js.map +1 -0
  25. package/docs/README.md +95 -0
  26. package/docs/TRANSLATIONS.md +211 -0
  27. package/docs/en/README.md +76 -0
  28. package/docs/en/api-reference.md +545 -0
  29. package/docs/en/architecture.md +369 -0
  30. package/docs/en/commands.md +273 -0
  31. package/docs/en/configuration.md +347 -0
  32. package/docs/en/developer-guide.md +588 -0
  33. package/docs/en/docker-ports-config.md +333 -0
  34. package/docs/en/examples.md +537 -0
  35. package/docs/en/getting-started.md +202 -0
  36. package/docs/en/port-binding.md +268 -0
  37. package/docs/en/troubleshooting.md +441 -0
  38. package/docs/th/README.md +64 -0
  39. package/docs/th/commands.md +202 -0
  40. package/docs/th/configuration.md +325 -0
  41. package/docs/th/getting-started.md +203 -0
  42. package/example/README.md +85 -0
  43. package/example/docker-compose.yml +76 -0
  44. package/example/docker-ports-example.yml +81 -0
  45. package/example/muacle.yml +47 -0
  46. package/example/port-binding-example.yml +45 -0
  47. package/example/suthep.yml +46 -0
  48. package/example/suthep=1.yml +46 -0
  49. package/package.json +45 -0
  50. package/src/commands/deploy.ts +405 -0
  51. package/src/commands/init.ts +214 -0
  52. package/src/commands/setup.ts +112 -0
  53. package/src/index.ts +42 -0
  54. package/src/types/config.ts +52 -0
  55. package/src/utils/certbot.ts +144 -0
  56. package/src/utils/config-loader.ts +121 -0
  57. package/src/utils/deployment.ts +157 -0
  58. package/src/utils/docker.ts +755 -0
  59. package/src/utils/nginx.ts +326 -0
  60. package/suthep-0.1.1.tgz +0 -0
  61. package/suthep.example.yml +98 -0
  62. package/test +0 -0
  63. package/todo.md +6 -0
  64. package/tsconfig.json +26 -0
  65. package/vite.config.ts +46 -0
@@ -0,0 +1,369 @@
1
+ # Architecture
2
+
3
+ This document explains how Suthep works under the hood, including its components, deployment strategies, and internal architecture.
4
+
5
+ > **For Developers**: If you're looking to contribute or extend Suthep, check out the [Developer Guide](./developer-guide.md) for detailed information on development setup, code organization, and contributing guidelines.
6
+
7
+ ## Overview
8
+
9
+ Suthep is a deployment automation tool that orchestrates multiple components to provide a seamless deployment experience:
10
+
11
+ ```
12
+ ┌─────────────────────────────────────────────────────────┐
13
+ │ Suthep CLI Tool │
14
+ │ (init, setup, deploy commands) │
15
+ └─────────────────────────────────────────────────────────┘
16
+
17
+
18
+ ┌─────────────────────────────────────┐
19
+ │ Configuration Loader │
20
+ │ (Loads and validates suthep.yml) │
21
+ └─────────────────────────────────────┘
22
+
23
+ ┌─────────────────┴─────────────────┐
24
+ │ │
25
+ ▼ ▼
26
+ ┌───────────────┐ ┌──────────────┐
27
+ │ Docker │ │ Nginx │
28
+ │ Manager │ │ Manager │
29
+ └───────────────┘ └──────────────┘
30
+ │ │
31
+ │ ▼
32
+ │ ┌──────────────┐
33
+ │ │ Certbot │
34
+ │ │ Manager │
35
+ │ └──────────────┘
36
+ │ │
37
+ └───────────────────────────────────┘
38
+
39
+
40
+ ┌─────────────────┐
41
+ │ Deployment │
42
+ │ Strategy │
43
+ │ (Rolling/ │
44
+ │ Blue-Green) │
45
+ └─────────────────┘
46
+ ```
47
+
48
+ ## Core Components
49
+
50
+ ### 1. Configuration System
51
+
52
+ **File**: `src/utils/config-loader.ts`
53
+
54
+ The configuration system:
55
+ - Loads YAML configuration files
56
+ - Validates configuration structure
57
+ - Provides type-safe configuration objects
58
+
59
+ **Type Definitions**: `src/types/config.ts`
60
+
61
+ All configuration types are defined using TypeScript interfaces:
62
+ - `DeployConfig`: Root configuration object
63
+ - `ServiceConfig`: Individual service configuration
64
+ - `DockerConfig`: Docker-specific settings
65
+ - `HealthCheckConfig`: Health check settings
66
+ - `NginxConfig`: Nginx settings
67
+ - `CertbotConfig`: SSL certificate settings
68
+ - `DeploymentConfig`: Deployment strategy settings
69
+
70
+ ### 2. Docker Manager
71
+
72
+ **File**: `src/utils/docker.ts`
73
+
74
+ The Docker manager handles:
75
+ - **Container lifecycle**: Start, stop, remove containers
76
+ - **Image management**: Pull and run Docker images
77
+ - **Port mapping**: Maps host ports to container ports
78
+ - **Environment variables**: Injects environment variables into containers
79
+ - **Container inspection**: Check container status and logs
80
+
81
+ **Key Functions**:
82
+ - `startDockerContainer()`: Starts or connects to a container
83
+ - `stopDockerContainer()`: Stops a running container
84
+ - `isContainerRunning()`: Checks if a container is running
85
+ - `getContainerLogs()`: Retrieves container logs
86
+
87
+ **Container Logic**:
88
+ 1. Check if container exists
89
+ 2. If exists and running: Use existing container
90
+ 3. If exists but stopped: Start the container
91
+ 4. If doesn't exist and image provided: Create and run new container
92
+ 5. If doesn't exist and no image: Error (connect to existing only)
93
+
94
+ ### 3. Nginx Manager
95
+
96
+ **File**: `src/utils/nginx.ts`
97
+
98
+ The Nginx manager:
99
+ - **Configuration generation**: Creates Nginx server blocks
100
+ - **Site management**: Enables/disables Nginx sites
101
+ - **Configuration reload**: Tests and reloads Nginx
102
+
103
+ **Generated Configuration Structure**:
104
+
105
+ ```nginx
106
+ # Upstream definition
107
+ upstream service_backend {
108
+ server localhost:PORT;
109
+ keepalive 32;
110
+ }
111
+
112
+ # HTTP server (redirects to HTTPS if SSL enabled)
113
+ server {
114
+ listen 80;
115
+ server_name domain1.com domain2.com;
116
+ return 301 https://$server_name$request_uri;
117
+ }
118
+
119
+ # HTTPS server
120
+ server {
121
+ listen 443 ssl http2;
122
+ server_name domain1.com domain2.com;
123
+
124
+ # SSL configuration
125
+ ssl_certificate /etc/letsencrypt/live/domain/fullchain.pem;
126
+ ssl_certificate_key /etc/letsencrypt/live/domain/privkey.pem;
127
+
128
+ # Proxy settings
129
+ location / {
130
+ proxy_pass http://service_backend;
131
+ proxy_set_header Host $host;
132
+ proxy_set_header X-Real-IP $remote_addr;
133
+ # ... more proxy headers
134
+ }
135
+
136
+ # Health check endpoint
137
+ location /health {
138
+ proxy_pass http://service_backend;
139
+ access_log off;
140
+ }
141
+ }
142
+ ```
143
+
144
+ **Key Functions**:
145
+ - `generateNginxConfig()`: Creates Nginx configuration
146
+ - `enableSite()`: Creates symlink in sites-enabled
147
+ - `reloadNginx()`: Tests and reloads Nginx
148
+ - `disableSite()`: Removes site from sites-enabled
149
+
150
+ ### 4. Certbot Manager
151
+
152
+ **File**: `src/utils/certbot.ts`
153
+
154
+ The Certbot manager handles SSL certificate operations:
155
+ - **Certificate requests**: Obtains certificates from Let's Encrypt
156
+ - **Certificate renewal**: Renews expiring certificates
157
+ - **Certificate revocation**: Revokes certificates
158
+ - **Certificate inspection**: Checks certificate expiration
159
+
160
+ **Key Functions**:
161
+ - `requestCertificate()`: Requests SSL certificate for a domain
162
+ - `renewCertificates()`: Renews all certificates
163
+ - `checkCertificateExpiration()`: Checks when certificate expires
164
+ - `revokeCertificate()`: Revokes a certificate
165
+
166
+ **Certificate Request Process**:
167
+ 1. Run `certbot certonly --nginx` for each domain
168
+ 2. Certbot validates domain ownership
169
+ 3. Certbot obtains and stores certificate
170
+ 4. Nginx configuration updated with certificate paths
171
+
172
+ ### 5. Deployment Strategy
173
+
174
+ **File**: `src/utils/deployment.ts`
175
+
176
+ Suthep supports two deployment strategies:
177
+
178
+ #### Rolling Deployment
179
+
180
+ Gradually replaces old instances with new ones:
181
+
182
+ 1. Start new service instance
183
+ 2. Wait for health check to pass
184
+ 3. Switch traffic to new instance
185
+ 4. Stop old instance (if applicable)
186
+
187
+ **Current Implementation**: Simplified - assumes service is already running and verifies health before proceeding.
188
+
189
+ #### Blue-Green Deployment
190
+
191
+ Maintains two identical environments:
192
+
193
+ 1. Deploy to "green" environment
194
+ 2. Run health checks on green
195
+ 3. Switch router/load balancer to green
196
+ 4. Keep blue as backup
197
+
198
+ **Current Implementation**: Simplified - verifies service health before proceeding.
199
+
200
+ **Key Functions**:
201
+ - `deployService()`: Main deployment function (routes to strategy)
202
+ - `rollingDeploy()`: Rolling deployment implementation
203
+ - `blueGreenDeploy()`: Blue-green deployment implementation
204
+ - `performHealthCheck()`: Checks service health endpoint
205
+ - `waitForService()`: Waits for service to become healthy
206
+
207
+ ### 6. Health Check System
208
+
209
+ **File**: `src/utils/deployment.ts`
210
+
211
+ Health checks ensure services are ready before routing traffic:
212
+
213
+ 1. **Polling**: Checks health endpoint every 2 seconds
214
+ 2. **Timeout**: Stops checking after configured timeout
215
+ 3. **Validation**: Requires HTTP 200 response
216
+ 4. **Failure**: Throws error if service doesn't become healthy
217
+
218
+ **Health Check Flow**:
219
+ ```
220
+ Start deployment
221
+
222
+ Wait 2 seconds
223
+
224
+ GET /health endpoint
225
+
226
+ Is response 200 OK?
227
+ ├─ Yes → Service healthy ✅
228
+ └─ No → Wait 2 seconds, retry
229
+
230
+ Timeout exceeded?
231
+ ├─ No → Retry
232
+ └─ Yes → Deployment failed ❌
233
+ ```
234
+
235
+ ## Command Implementations
236
+
237
+ ### `init` Command
238
+
239
+ **File**: `src/commands/init.ts`
240
+
241
+ Interactive configuration creation:
242
+ 1. Check if file exists (prompt for overwrite)
243
+ 2. Gather project information
244
+ 3. Loop through services:
245
+ - Service details
246
+ - Docker configuration
247
+ - Health check configuration
248
+ 4. Gather Certbot information
249
+ 5. Build configuration object
250
+ 6. Save to YAML file
251
+
252
+ ### `setup` Command
253
+
254
+ **File**: `src/commands/setup.ts`
255
+
256
+ Prerequisites installation:
257
+ 1. Detect operating system
258
+ 2. Check if Nginx installed → Install if needed
259
+ 3. Start and enable Nginx service
260
+ 4. Check if Certbot installed → Install if needed
261
+ 5. Verify installations
262
+
263
+ ### `deploy` Command
264
+
265
+ **File**: `src/commands/deploy.ts`
266
+
267
+ Main deployment orchestration:
268
+ 1. Load and validate configuration
269
+ 2. For each service:
270
+ a. Start Docker container (if configured)
271
+ b. Deploy service (using strategy)
272
+ c. Generate Nginx config (HTTP)
273
+ d. Enable Nginx site
274
+ e. Request SSL certificates (if HTTPS enabled)
275
+ f. Update Nginx config (HTTPS)
276
+ g. Reload Nginx
277
+ h. Perform health check
278
+ 3. Print service URLs
279
+
280
+ ## Data Flow
281
+
282
+ ### Deployment Flow
283
+
284
+ ```
285
+ User runs: suthep deploy
286
+
287
+ Load suthep.yml
288
+
289
+ For each service:
290
+ ├─ Start Docker container
291
+ ├─ Deploy service (strategy)
292
+ ├─ Generate Nginx config
293
+ ├─ Enable Nginx site
294
+ ├─ Request SSL certificate
295
+ ├─ Update Nginx config (HTTPS)
296
+ ├─ Reload Nginx
297
+ └─ Health check
298
+
299
+ All services deployed ✅
300
+ ```
301
+
302
+ ### Configuration Flow
303
+
304
+ ```
305
+ suthep.yml (YAML)
306
+
307
+ config-loader.ts (Load & Parse)
308
+
309
+ TypeScript Types (Validate)
310
+
311
+ Command Handlers (Use)
312
+
313
+ Utility Functions (Execute)
314
+ ```
315
+
316
+ ## File System Structure
317
+
318
+ Suthep creates and manages:
319
+
320
+ ```
321
+ /etc/nginx/
322
+ ├── sites-available/
323
+ │ ├── service1.conf (Generated)
324
+ │ └── service2.conf (Generated)
325
+ └── sites-enabled/
326
+ ├── service1.conf (Symlink)
327
+ └── service2.conf (Symlink)
328
+
329
+ /etc/letsencrypt/
330
+ ├── live/
331
+ │ ├── domain1.com/
332
+ │ │ ├── fullchain.pem
333
+ │ │ └── privkey.pem
334
+ │ └── domain2.com/
335
+ │ ├── fullchain.pem
336
+ │ └── privkey.pem
337
+ └── archive/ (Certificate history)
338
+ ```
339
+
340
+ ## Error Handling
341
+
342
+ Suthep uses a fail-fast approach:
343
+ - If any step fails, deployment stops
344
+ - Detailed error messages are shown
345
+ - Exit code 1 indicates failure
346
+ - Previous successful steps remain in place
347
+
348
+ ## Security Considerations
349
+
350
+ 1. **sudo Access**: Required for Nginx and Certbot operations
351
+ 2. **SSL Certificates**: Stored in `/etc/letsencrypt/` (root access required)
352
+ 3. **Nginx Configs**: Written to system directories (sudo required)
353
+ 4. **Docker**: Runs with user permissions (no sudo needed)
354
+
355
+ ## Extensibility
356
+
357
+ Suthep is designed to be extensible:
358
+
359
+ 1. **New Deployment Strategies**: Add to `deployment.ts`
360
+ 2. **New Service Types**: Extend `ServiceConfig` type
361
+ 3. **Custom Health Checks**: Modify `performHealthCheck()`
362
+ 4. **Additional Providers**: Add new managers (e.g., Traefik, Caddy)
363
+
364
+ ## Performance Considerations
365
+
366
+ 1. **Parallel Deployment**: Currently sequential (can be parallelized)
367
+ 2. **Health Check Polling**: 2-second intervals (configurable)
368
+ 3. **Nginx Reload**: Only once per service (could batch)
369
+ 4. **Certificate Requests**: Sequential per domain (rate limits apply)
@@ -0,0 +1,273 @@
1
+ # Commands Reference
2
+
3
+ Suthep provides three main commands for managing deployments. This document describes each command in detail.
4
+
5
+ ## `suthep init`
6
+
7
+ Initialize a new deployment configuration file.
8
+
9
+ ### Usage
10
+
11
+ ```bash
12
+ suthep init [options]
13
+ ```
14
+
15
+ ### Options
16
+
17
+ | Option | Short | Description | Default |
18
+ |--------|-------|-------------|---------|
19
+ | `--file` | `-f` | Configuration file path | `suthep.yml` |
20
+
21
+ ### Description
22
+
23
+ The `init` command interactively creates a `suthep.yml` configuration file. It will:
24
+
25
+ 1. Prompt for project name and version
26
+ 2. Guide you through configuring one or more services
27
+ 3. Ask about Docker configuration for each service
28
+ 4. Set up health check endpoints
29
+ 5. Configure Certbot email and staging mode
30
+ 6. Save the configuration to the specified file
31
+
32
+ ### Examples
33
+
34
+ ```bash
35
+ # Create default suthep.yml
36
+ suthep init
37
+
38
+ # Create custom configuration file
39
+ suthep init -f production.yml
40
+ ```
41
+
42
+ ### Interactive Prompts
43
+
44
+ The command will ask you:
45
+
46
+ 1. **Project name**: Name of your project
47
+ 2. **Project version**: Version number
48
+ 3. **Service name**: Unique identifier for the service
49
+ 4. **Service port**: Port the service runs on (1-65535)
50
+ 5. **Domain names**: Comma-separated list of domains
51
+ 6. **Use Docker?**: Whether to use Docker
52
+ 7. **Docker image**: Image to use (optional, for new containers)
53
+ 8. **Container name**: Name of the Docker container
54
+ 9. **Container port**: Port inside the container
55
+ 10. **Add health check?**: Whether to configure health checks
56
+ 11. **Health check path**: HTTP path for health endpoint
57
+ 12. **Health check interval**: Check interval in seconds
58
+ 13. **Add another service?**: Whether to configure more services
59
+ 14. **Email for SSL certificates**: Email for Let's Encrypt
60
+ 15. **Use Certbot staging?**: Use staging environment for testing
61
+
62
+ ## `suthep setup`
63
+
64
+ Setup Nginx and Certbot on the system.
65
+
66
+ ### Usage
67
+
68
+ ```bash
69
+ suthep setup [options]
70
+ ```
71
+
72
+ ### Options
73
+
74
+ | Option | Description |
75
+ |--------|-------------|
76
+ | `--nginx-only` | Only setup Nginx (skip Certbot) |
77
+ | `--certbot-only` | Only setup Certbot (skip Nginx) |
78
+
79
+ ### Description
80
+
81
+ The `setup` command installs and configures the prerequisites for Suthep:
82
+
83
+ 1. **Nginx Installation**:
84
+ - Checks if Nginx is already installed
85
+ - Installs Nginx using the appropriate package manager:
86
+ - `apt-get` on Debian/Ubuntu
87
+ - `yum` on RHEL/CentOS
88
+ - `brew` on macOS
89
+ - Starts and enables the Nginx service
90
+
91
+ 2. **Certbot Installation**:
92
+ - Checks if Certbot is already installed
93
+ - Installs Certbot and the Nginx plugin:
94
+ - `certbot` and `python3-certbot-nginx` on Linux
95
+ - `certbot` on macOS via Homebrew
96
+
97
+ ### Examples
98
+
99
+ ```bash
100
+ # Setup both Nginx and Certbot
101
+ suthep setup
102
+
103
+ # Only setup Nginx
104
+ suthep setup --nginx-only
105
+
106
+ # Only setup Certbot
107
+ suthep setup --certbot-only
108
+ ```
109
+
110
+ ### Platform Support
111
+
112
+ - **Linux**: Supports Debian/Ubuntu (apt-get) and RHEL/CentOS (yum)
113
+ - **macOS**: Uses Homebrew for installation
114
+ - **Other platforms**: Will show an error message with manual installation instructions
115
+
116
+ ### Requirements
117
+
118
+ - `sudo` access (for installing system packages)
119
+ - Internet connection (to download packages)
120
+
121
+ ## `suthep deploy`
122
+
123
+ Deploy a project using the configuration file.
124
+
125
+ ### Usage
126
+
127
+ ```bash
128
+ suthep deploy [options]
129
+ ```
130
+
131
+ ### Options
132
+
133
+ | Option | Short | Description | Default |
134
+ |--------|-------|-------------|---------|
135
+ | `--file` | `-f` | Configuration file path | `suthep.yml` |
136
+ | `--no-https` | | Skip HTTPS setup | `false` |
137
+ | `--no-nginx` | | Skip Nginx configuration | `false` |
138
+
139
+ ### Description
140
+
141
+ The `deploy` command is the main deployment command. It performs the following steps for each service:
142
+
143
+ 1. **Load Configuration**: Reads and validates the configuration file
144
+ 2. **Docker Management**: Starts or connects to Docker containers (if configured)
145
+ 3. **Service Deployment**: Deploys the service using the configured strategy
146
+ 4. **Nginx Configuration**: Generates and enables Nginx reverse proxy configuration
147
+ 5. **SSL Certificate**: Requests SSL certificates from Let's Encrypt (if HTTPS enabled)
148
+ 6. **Nginx Reload**: Tests and reloads Nginx configuration
149
+ 7. **Health Check**: Performs health check to verify service is running
150
+
151
+ ### Deployment Flow
152
+
153
+ For each service in your configuration:
154
+
155
+ ```
156
+ 1. Start Docker container (if configured)
157
+
158
+ 2. Deploy service (rolling or blue-green strategy)
159
+
160
+ 3. Generate Nginx configuration (HTTP)
161
+
162
+ 4. Enable Nginx site
163
+
164
+ 5. Request SSL certificates (if --no-https not used)
165
+
166
+ 6. Update Nginx configuration (HTTPS)
167
+
168
+ 7. Reload Nginx
169
+
170
+ 8. Perform health check (if configured)
171
+
172
+ 9. Service deployed successfully!
173
+ ```
174
+
175
+ ### Examples
176
+
177
+ ```bash
178
+ # Deploy using default suthep.yml
179
+ suthep deploy
180
+
181
+ # Deploy using custom configuration file
182
+ suthep deploy -f production.yml
183
+
184
+ # Deploy without HTTPS (HTTP only)
185
+ suthep deploy --no-https
186
+
187
+ # Deploy without Nginx (only Docker/health checks)
188
+ suthep deploy --no-nginx
189
+
190
+ # Deploy without both HTTPS and Nginx
191
+ suthep deploy --no-https --no-nginx
192
+ ```
193
+
194
+ ### Error Handling
195
+
196
+ If any step fails, the deployment will:
197
+ - Show a detailed error message
198
+ - Exit with a non-zero status code
199
+ - Not proceed with remaining services (if one fails)
200
+
201
+ ### Output
202
+
203
+ The command provides detailed output including:
204
+ - Configuration loading status
205
+ - Service deployment progress
206
+ - Docker container status
207
+ - Nginx configuration status
208
+ - SSL certificate status
209
+ - Health check results
210
+ - Final service URLs
211
+
212
+ Example output:
213
+
214
+ ```
215
+ 🚀 Deploying Services
216
+
217
+ 📄 Loading configuration from suthep.yml...
218
+ ✅ Configuration loaded for project: my-app
219
+ Services: api, webapp
220
+
221
+ 📦 Deploying service: api
222
+ 🐳 Managing Docker container...
223
+ ⚙️ Configuring Nginx reverse proxy...
224
+ ✅ Nginx configured for api.example.com
225
+ 🔐 Setting up HTTPS certificates...
226
+ ✅ SSL certificate obtained for api.example.com
227
+ 🔄 Reloading Nginx...
228
+ 🏥 Performing health check...
229
+ ✅ Service api is healthy
230
+
231
+ ✨ Service api deployed successfully!
232
+
233
+ 🎉 All services deployed successfully!
234
+
235
+ 📋 Service URLs:
236
+ api: https://api.example.com
237
+ ```
238
+
239
+ ## Global Options
240
+
241
+ All commands support these global options:
242
+
243
+ | Option | Short | Description |
244
+ |--------|-------|-------------|
245
+ | `--version` | `-V` | Show version number |
246
+ | `--help` | `-h` | Show help for command |
247
+
248
+ ### Examples
249
+
250
+ ```bash
251
+ # Show version
252
+ suthep --version
253
+
254
+ # Show help for deploy command
255
+ suthep deploy --help
256
+ ```
257
+
258
+ ## Exit Codes
259
+
260
+ - `0`: Success
261
+ - `1`: Error occurred (see error message for details)
262
+
263
+ ## Command Aliases
264
+
265
+ After running `npm link`, the `suthep` command is available globally. You can also use it directly from the project directory:
266
+
267
+ ```bash
268
+ # From project directory
269
+ npm run dev -- deploy
270
+
271
+ # Or after building
272
+ node dist/index.js deploy
273
+ ```