@startanaicompany/cli 1.4.19 → 1.4.21

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 CHANGED
@@ -8,11 +8,14 @@
8
8
  ## Features
9
9
 
10
10
  - ✨ **Simple & Intuitive** - Deploy with a single command
11
- - 🔐 **Secure** - API key-based authentication
11
+ - 🔐 **Secure** - Session token + OAuth-based authentication
12
12
  - 🚀 **Fast** - Optimized for quick deployments
13
13
  - 📦 **Zero Configuration** - Works out of the box
14
14
  - 🎨 **Beautiful CLI** - Color-coded output and progress indicators
15
15
  - 🔄 **Auto-healing** - Automatically fixes common deployment issues
16
+ - 🖥️ **Remote Shell** - Access your container via WebSocket (Project Aurora)
17
+ - 🔧 **Remote Execution** - Run commands inside your container
18
+ - 📊 **Real-time Logs** - View runtime and deployment logs
16
19
 
17
20
  ## Installation
18
21
 
@@ -24,15 +27,15 @@ npm install -g @startanaicompany/cli
24
27
 
25
28
  ```bash
26
29
  # 1. Register for an account
27
- saac register --email user@example.com
30
+ saac register -e user@example.com
28
31
 
29
- # 2. Verify your email (check MailHog)
32
+ # 2. Verify your email (check MailHog at https://mailhog.goryan.io)
30
33
  saac verify 123456
31
34
 
32
- # 3. Login with your API key
33
- saac login -e user@example.com -k cw_your_api_key
35
+ # 3. Login with your API key (shown after verification)
36
+ saac login -e user@example.com -k cw_your_api_key_here
34
37
 
35
- # 4. Connect your Git account (OAuth)
38
+ # 4. Connect your Git account (OAuth - required!)
36
39
  saac git connect
37
40
 
38
41
  # 5. Create a new application
@@ -40,118 +43,252 @@ saac create my-app -s myapp -r git@git.startanaicompany.com:user/repo.git
40
43
 
41
44
  # 6. Deploy!
42
45
  saac deploy
46
+
47
+ # 7. View logs
48
+ saac logs
49
+
50
+ # 8. Access your container shell
51
+ saac shell
43
52
  ```
44
53
 
45
- ## Commands
54
+ ---
46
55
 
47
- ## Git Authentication
56
+ ## Table of Contents
57
+
58
+ - [Authentication](#authentication)
59
+ - [Register & Login](#register--login)
60
+ - [Session Management](#session-management)
61
+ - [API Keys](#api-keys)
62
+ - [Git OAuth](#git-oauth)
63
+ - [Application Management](#application-management)
64
+ - [Environment Variables](#environment-variables)
65
+ - [Remote Access](#remote-access)
66
+ - [Remote Shell (saac shell)](#remote-shell)
67
+ - [Remote Execution (saac exec)](#remote-execution)
68
+ - [Local Development (saac run)](#local-development)
69
+ - [Logs & Monitoring](#logs--monitoring)
70
+ - [Domain Management](#domain-management)
71
+ - [Complete Workflows](#complete-workflows)
72
+ - [Troubleshooting](#troubleshooting)
48
73
 
49
- SAAC CLI uses **OAuth-only authentication** for Git access. You must connect your Git account before creating applications.
74
+ ---
50
75
 
51
- ### Connect Your Git Account
76
+ ## Authentication
52
77
 
53
- Connect your Git account once, deploy unlimited applications:
78
+ ### Register & Login
54
79
 
55
- ```bash
56
- # Connect Git account (interactive)
57
- saac git connect
80
+ SAAC uses a **session token-based authentication** system for security and ease of use.
58
81
 
59
- # Or specify host directly
60
- saac git connect git.startanaicompany.com
82
+ #### `saac register -e <email>`
61
83
 
62
- # List connected accounts
63
- saac git list
84
+ Register for a new account. Your Git username will be auto-detected from your email.
64
85
 
65
- # Disconnect account
66
- saac git disconnect git.startanaicompany.com
86
+ ```bash
87
+ # Register with email
88
+ saac register -e user@example.com
89
+
90
+ # With custom Git username (optional)
91
+ saac register -e user@example.com --git-username myusername
67
92
  ```
68
93
 
69
- **Benefits:**
70
- - Connect once, deploy unlimited apps
71
- - No need to remember or copy tokens
72
- - Tokens stored encrypted on server
73
- - ✅ Supports Gitea, GitHub, and GitLab
74
- - 🔒 More secure than manual tokens
94
+ **What happens:**
95
+ 1. Account created in database
96
+ 2. Verification code sent to email
97
+ 3. You're prompted to verify your email
98
+
99
+ **Required:**
100
+ - `-e, --email <email>` - Your email address
101
+
102
+ **Optional:**
103
+ - `--git-username <username>` - Git username (auto-detected from email if not provided)
104
+
105
+ #### `saac verify <code>`
106
+
107
+ Verify your email address with the 6-digit code from your email.
75
108
 
76
- **Creating apps with OAuth:**
77
109
  ```bash
78
- # OAuth connection required!
79
- saac create my-app -s myapp -r git@git.startanaicompany.com:user/repo.git
110
+ saac verify 123456
111
+ ```
112
+
113
+ **Important:** The verification response shows your **API key** (starts with `cw_`). **Save this immediately** - it's only shown once!
80
114
 
81
- # CLI automatically uses your connected account
82
- # ✅ Using connected account: username@git.startanaicompany.com
83
115
  ```
116
+ ✓ Email verified successfully!
84
117
 
85
- **⚠️ Important:** You must connect your Git account with `saac git connect` before creating applications. Manual tokens are no longer supported.
118
+ Your API Key (save this now!):
86
119
 
87
- ---
120
+ cw_kgzfNByNNrtrDsAW07h6ORwTtP3POK6O98klH9Rm8jTt9ByHojeH7zDmGwaF
121
+
122
+ ⚠️ This API key is shown only once. Store it securely!
123
+ ```
88
124
 
89
- ### Authentication
125
+ **Where to check for codes:** https://mailhog.goryan.io (development environment)
90
126
 
91
- #### `saac register`
92
- Register for a new account
127
+ #### `saac login -e <email> -k <api-key>`
128
+
129
+ Login with your email and API key. This exchanges your permanent API key for a temporary session token (valid for 1 year).
93
130
 
94
131
  ```bash
95
- saac register --email user@example.com
96
- saac register -e user@example.com --gitea-username myuser
132
+ saac login -e user@example.com -k cw_your_api_key_here
97
133
  ```
98
134
 
135
+ **What happens:**
136
+ 1. API key verified with backend
137
+ 2. Session token generated (valid for 1 year)
138
+ 3. Session token stored locally in `~/.config/startanaicompany/config.json`
139
+ 4. All future commands use session token automatically
140
+
99
141
  **Required:**
100
142
  - `-e, --email <email>` - Your email address
143
+ - `-k, --api-key <key>` - Your API key (from verification step)
101
144
 
102
- **Optional:**
103
- - `--gitea-username <username>` - Your Gitea username (auto-detected if not provided)
145
+ **Alternative: OTP Login (Optional)**
104
146
 
105
- #### `saac login`
106
- Login with existing credentials
147
+ You can also login with a one-time password sent to your email:
107
148
 
108
149
  ```bash
109
- saac login --email user@example.com --api-key cw_...
110
- saac login -e user@example.com -k cw_...
150
+ saac login -e user@example.com --otp 123456
111
151
  ```
112
152
 
113
- **Required:**
114
- - `-e, --email <email>` - Your email address
115
- - `-k, --api-key <key>` - Your API key
153
+ ### Session Management
116
154
 
117
- #### `saac verify <code>`
118
- Verify your email address
155
+ #### `saac sessions`
156
+
157
+ List all active sessions across all devices.
119
158
 
120
159
  ```bash
121
- saac verify 123456
160
+ saac sessions
122
161
  ```
123
162
 
124
- **Note:** Check MailHog at https://mailhog.goryan.io for verification codes
163
+ **Shows:**
164
+ - Device/location
165
+ - Session creation date
166
+ - Last used timestamp
167
+ - IP address
168
+ - Expiration date
169
+
170
+ **Example output:**
171
+ ```
172
+ Active Sessions
173
+ ───────────────
174
+
175
+ Session 1
176
+ Created: Jan 26, 2026, 10:00 AM
177
+ Last Used: Jan 29, 2026, 9:00 AM
178
+ IP: 192.168.1.100
179
+ Expires: Jan 26, 2027
180
+
181
+ Session 2
182
+ Created: Jan 20, 2026, 2:00 PM
183
+ Last Used: Jan 28, 2026, 5:00 PM
184
+ IP: 10.0.0.50
185
+ Expires: Jan 20, 2027
186
+
187
+ Total: 2 active sessions
188
+ ```
125
189
 
126
190
  #### `saac logout`
127
- Logout from current device (revokes session token)
191
+
192
+ Logout from current device (revokes current session token only).
128
193
 
129
194
  ```bash
130
195
  saac logout
131
196
  ```
132
197
 
133
- #### `saac logout-all`
134
- Logout from all devices (revokes all session tokens)
198
+ **What happens:**
199
+ - Current session token revoked on server
200
+ - Local config cleared
201
+ - Other devices remain logged in
202
+
203
+ #### `saac logout-all [-y]`
204
+
205
+ Logout from **all devices** (revokes all session tokens).
135
206
 
136
207
  ```bash
208
+ # With confirmation prompt
137
209
  saac logout-all
138
- saac logout-all --yes # Skip confirmation
210
+
211
+ # Skip confirmation
212
+ saac logout-all --yes
213
+ saac logout-all -y
139
214
  ```
140
215
 
141
- **Options:**
142
- - `-y, --yes` - Skip confirmation prompt
216
+ **What happens:**
217
+ - ALL session tokens revoked on server
218
+ - Local config cleared
219
+ - All devices logged out
220
+ - You'll need to login again on all devices
143
221
 
144
- #### `saac sessions`
145
- List all active sessions
222
+ **Use case:** Security - if you suspect your session was compromised.
223
+
224
+ ### API Keys
225
+
226
+ #### `saac keys show`
227
+
228
+ Show your API key information (masked for security).
146
229
 
147
230
  ```bash
148
- saac sessions
231
+ saac keys show
232
+ saac keys info # Alias
233
+ ```
234
+
235
+ **Shows:**
236
+ - API key (masked)
237
+ - Creation date
238
+ - Last used timestamp
239
+
240
+ #### `saac keys regenerate`
241
+
242
+ Generate a new API key (invalidates the old one).
243
+
244
+ ```bash
245
+ saac keys regenerate
149
246
  ```
150
247
 
151
- Shows all devices where you're currently logged in with creation date, last used time, IP address, and expiration date.
248
+ **⚠️ Warning:** Your old API key will stop working immediately! Save the new key securely.
152
249
 
153
- #### `saac git connect [host]`
154
- Connect a Git account via OAuth
250
+ **What happens:**
251
+ 1. Old API key invalidated
252
+ 2. New API key generated
253
+ 3. New key displayed (only shown once)
254
+ 4. You'll need to update any scripts/automation using the old key
255
+
256
+ #### `saac whoami`
257
+
258
+ Show current user information.
259
+
260
+ ```bash
261
+ saac whoami
262
+ ```
263
+
264
+ **Shows:**
265
+ - Email
266
+ - User ID
267
+ - Verification status
268
+ - Member since date
269
+ - Connected Git accounts
270
+ - Application quotas
271
+ - Available commands
272
+
273
+ ---
274
+
275
+ ## Git OAuth
276
+
277
+ SAAC CLI uses **OAuth-only authentication** for Git access. You must connect your Git account before creating applications.
278
+
279
+ ### Why OAuth?
280
+
281
+ **Benefits:**
282
+ - ✅ Connect once, deploy unlimited apps
283
+ - ✅ No need to remember or manually provide tokens
284
+ - ✅ Tokens stored encrypted on server (AES-256-GCM)
285
+ - ✅ Auto-refresh for expired tokens
286
+ - ✅ Supports multiple Git providers (Gitea, GitHub, GitLab)
287
+ - 🔒 More secure than manual token management
288
+
289
+ ### `saac git connect [host]`
290
+
291
+ Connect a Git account via OAuth.
155
292
 
156
293
  ```bash
157
294
  # Interactive mode - select from providers
@@ -167,95 +304,227 @@ saac git connect git@git.startanaicompany.com:user/repo.git
167
304
  **What happens:**
168
305
  1. Browser opens to OAuth authorization page
169
306
  2. You authorize on the Git provider
170
- 3. Connection saved (encrypted on server)
171
- 4. Future app creations use this connection automatically
307
+ 3. CLI polls for completion (every 2 seconds, max 5 minutes)
308
+ 4. Connection saved encrypted on server
309
+ 5. Future app creations use this connection automatically
310
+
311
+ **Example output:**
312
+ ```
313
+ Git OAuth Connection
314
+ ────────────────────
315
+
316
+ ℹ Opening browser for OAuth authorization...
317
+ ℹ Authorize the application in your browser
318
+
319
+ ⏳ Waiting for authorization... (0s)
172
320
 
173
- #### `saac git list`
174
- List all connected Git accounts
321
+ Git account connected successfully!
322
+
323
+ Provider: gitea
324
+ Host: git.startanaicompany.com
325
+ Username: ryan.gogo
326
+ Expires: Never (auto-refreshed)
327
+
328
+ ℹ You can now create applications without providing Git tokens:
329
+ saac create my-app -s myapp -r git@git.startanaicompany.com:user/repo.git
330
+ ```
331
+
332
+ ### `saac git list`
333
+
334
+ List all connected Git accounts.
175
335
 
176
336
  ```bash
177
337
  saac git list
178
338
  saac git ls # Alias
179
339
  ```
180
340
 
181
- Shows host, username, provider, expiration date, and last used time.
341
+ **Shows:**
342
+ - Git host
343
+ - Username
344
+ - Provider (gitea/github/gitlab)
345
+ - Connection date
346
+ - Expiration (if applicable)
347
+ - Last used timestamp
348
+
349
+ **Example output:**
350
+ ```
351
+ Connected Git Accounts
352
+ ──────────────────────
353
+
354
+ ┌─────────────────────────────┬────────────┬──────────┬──────────────┐
355
+ │ Host │ Username │ Provider │ Connected │
356
+ ├─────────────────────────────┼────────────┼──────────┼──────────────┤
357
+ │ git.startanaicompany.com │ ryan.gogo │ gitea │ Jan 26, 2026 │
358
+ └─────────────────────────────┴────────────┴──────────┴──────────────┘
182
359
 
183
- #### `saac git disconnect <host>`
184
- Disconnect a Git account
360
+ Total: 1 connection(s)
361
+ ```
362
+
363
+ ### `saac git disconnect <host>`
364
+
365
+ Disconnect (revoke) a Git account connection.
185
366
 
186
367
  ```bash
187
368
  saac git disconnect git.startanaicompany.com
188
369
  ```
189
370
 
190
- ### Application Management
371
+ **What happens:**
372
+ - OAuth token revoked on server
373
+ - Connection removed
374
+ - Existing applications continue to work
375
+ - New applications will require reconnection
376
+
377
+ ---
378
+
379
+ ## Application Management
380
+
381
+ ### `saac init`
191
382
 
192
- #### `saac init`
193
- Link an existing SAAC application to the current directory
383
+ Link an existing SAAC application to the current directory.
194
384
 
195
385
  ```bash
196
- # Interactive mode - select from your applications
197
386
  cd my-project
198
387
  saac init
199
388
  ```
200
389
 
201
- **Use Case:** When you clone a Git repository or have an existing project and want to link it to a SAAC application.
390
+ **Use case:** When you:
391
+ - Clone a Git repository
392
+ - Have an existing project
393
+ - Want to manage an application from a different directory
202
394
 
203
395
  **What it does:**
204
- 1. Shows all your SAAC applications
205
- 2. Let you select which one to link to this directory
206
- 3. Saves the link to `.saac/config.json`
396
+ 1. Fetches all your SAAC applications
397
+ 2. Shows interactive list to select from
398
+ 3. Saves selected application info to `.saac/config.json`
207
399
  4. Now you can use `saac deploy`, `saac logs`, etc.
208
400
 
209
- **Note:** To create a new application, use `saac create` instead.
401
+ **Example:**
402
+ ```bash
403
+ $ saac init
404
+
405
+ Select Application
406
+ ──────────────────
407
+
408
+ ? Which application do you want to link to this directory?
409
+ ❯ mysimpleflowershop (mysimpleflowershop.startanaicompany.com)
410
+ api-server (api.startanaicompany.com)
411
+ landing-page (landing.startanaicompany.com)
412
+
413
+ ✓ Application linked successfully!
210
414
 
211
- #### `saac create <name>`
212
- Create a new application
415
+ Configuration saved to .saac/config.json
416
+ You can now use:
417
+ saac deploy - Deploy application
418
+ saac logs - View logs
419
+ saac status - Check status
420
+ ```
421
+
422
+ ### `saac create <name>`
423
+
424
+ Create a new application with full configuration options.
213
425
 
214
426
  ```bash
215
427
  # Basic application (OAuth required!)
216
428
  saac create my-app -s myapp -r git@git.startanaicompany.com:user/repo.git
217
429
 
218
- # Advanced with health checks and migration
219
- saac create api -s api -r git@git... \
430
+ # Advanced with health checks and migrations
431
+ saac create api \
432
+ -s api \
433
+ -r git@git.startanaicompany.com:user/api-server.git \
220
434
  --build-pack nixpacks \
221
435
  --port 8080 \
222
436
  --pre-deploy-cmd "npm run migrate" \
437
+ --post-deploy-cmd "npm run seed" \
223
438
  --health-check \
224
439
  --health-path /api/health \
225
- --env NODE_ENV=production
440
+ --health-interval 30 \
441
+ --health-timeout 10 \
442
+ --health-retries 3 \
443
+ --cpu-limit 2 \
444
+ --memory-limit 2G \
445
+ --env NODE_ENV=production \
446
+ --env LOG_LEVEL=debug \
447
+ --env DATABASE_URL=postgresql://...
226
448
  ```
227
449
 
228
- **Required:**
229
- - `<name>` - Application name
230
- - `-s, --subdomain <subdomain>` - Subdomain for your app
231
- - `-r, --repository <url>` - Git repository URL (SSH format)
232
-
233
450
  **Prerequisites:**
234
- - You must connect your Git account first: `saac git connect`
451
+ - You must be logged in: `saac login`
452
+ - ✅ You must connect Git account: `saac git connect`
235
453
 
236
- **Optional:**
237
- - `-b, --branch <branch>` - Git branch (default: master)
238
- - `-d, --domain-suffix <suffix>` - Domain suffix (default: startanaicompany.com)
239
- - `-p, --port <port>` - Port to expose (default: 3000)
240
- - `--build-pack <pack>` - Build pack: dockercompose, nixpacks, dockerfile, static
241
- - `--install-cmd <command>` - Install command
242
- - `--build-cmd <command>` - Build command
243
- - `--start-cmd <command>` - Start command
244
- - `--pre-deploy-cmd <command>` - Pre-deployment command (e.g., migrations)
245
- - `--post-deploy-cmd <command>` - Post-deployment command (e.g., seeding)
246
- - `--cpu-limit <limit>` - CPU limit (e.g., "1", "2.5")
247
- - `--memory-limit <limit>` - Memory limit (e.g., "512M", "2G")
454
+ **Required:**
455
+ - `<name>` - Application name (alphanumeric, hyphens allowed)
456
+ - `-s, --subdomain <subdomain>` - Subdomain (e.g., `myapp` → `myapp.startanaicompany.com`)
457
+ - `-r, --repository <url>` - Git repository URL in SSH format
458
+
459
+ **Basic Options:**
460
+ - `-b, --branch <branch>` - Git branch (default: `master`)
461
+ - `-d, --domain-suffix <suffix>` - Domain suffix (default: `startanaicompany.com`)
462
+ - `-p, --port <port>` - Port to expose (default: `3000`)
463
+
464
+ **Build Pack Options:**
465
+ - `--build-pack <pack>` - Build system to use:
466
+ - `nixpacks` (default) - Auto-detects language and builds
467
+ - `dockerfile` - Uses Dockerfile in repository
468
+ - `dockercompose` - Uses docker-compose.yml
469
+ - `static` - Static site hosting
470
+
471
+ **Custom Commands:**
472
+ - `--install-cmd <command>` - Install command (e.g., `pnpm install`)
473
+ - `--build-cmd <command>` - Build command (e.g., `npm run build`)
474
+ - `--start-cmd <command>` - Start command (e.g., `node dist/server.js`)
475
+ - `--pre-deploy-cmd <command>` - Pre-deployment hook (e.g., `npm run migrate`)
476
+ - `--post-deploy-cmd <command>` - Post-deployment hook (e.g., `npm run seed`)
477
+
478
+ **Resource Limits:**
479
+ - `--cpu-limit <limit>` - CPU limit (e.g., `1`, `2.5`)
480
+ - `--memory-limit <limit>` - Memory limit (e.g., `512M`, `1G`, `2G`)
481
+
482
+ **Note:** Free tier limited to 1 vCPU, 1024M RAM. Upgrades required for higher limits.
483
+
484
+ **Health Checks:**
248
485
  - `--health-check` - Enable health checks
249
- - `--health-path <path>` - Health check path (default: /health)
250
- - `--health-interval <seconds>` - Health check interval in seconds
251
- - `--health-timeout <seconds>` - Health check timeout in seconds
252
- - `--health-retries <count>` - Health check retries (1-10)
253
- - `--env <KEY=VALUE>` - Environment variable (can be used multiple times)
486
+ - `--health-path <path>` - Health check endpoint (default: `/health`)
487
+ - `--health-interval <seconds>` - Check interval (default: 30s)
488
+ - `--health-timeout <seconds>` - Check timeout (default: 10s)
489
+ - `--health-retries <count>` - Number of retries before marking unhealthy (1-10)
490
+
491
+ **Environment Variables:**
492
+ - `--env <KEY=VALUE>` - Set environment variable (can be used multiple times)
493
+ - Maximum 50 variables per application
494
+
495
+ **Example with all features:**
496
+ ```bash
497
+ saac create production-api \
498
+ -s api \
499
+ -r git@git.startanaicompany.com:company/api.git \
500
+ -b main \
501
+ --build-pack nixpacks \
502
+ --port 8080 \
503
+ --pre-deploy-cmd "npm run db:migrate" \
504
+ --start-cmd "node dist/index.js" \
505
+ --cpu-limit 2 \
506
+ --memory-limit 2G \
507
+ --health-check \
508
+ --health-path /api/health \
509
+ --health-interval 30 \
510
+ --health-timeout 10 \
511
+ --health-retries 3 \
512
+ --env NODE_ENV=production \
513
+ --env LOG_LEVEL=info \
514
+ --env DATABASE_URL=postgresql://user:pass@host/db \
515
+ --env REDIS_URL=redis://redis:6379
516
+ ```
517
+
518
+ **What happens:**
519
+ 1. Validates all inputs
520
+ 2. Checks Git OAuth connection
521
+ 3. Creates application on Coolify via wrapper API
522
+ 4. Saves configuration to `.saac/config.json`
523
+ 5. Shows next steps (deploy, logs, status)
254
524
 
255
- **Note:** Free tier limited to 1 vCPU, 1024M RAM
525
+ ### `saac update`
256
526
 
257
- #### `saac update`
258
- Update application configuration
527
+ Update application configuration after creation.
259
528
 
260
529
  ```bash
261
530
  # Update port and enable health checks
@@ -265,254 +534,1551 @@ saac update --port 8080 --health-check --health-path /api/health
265
534
  saac update --build-pack nixpacks --cpu-limit 2 --memory-limit 2G
266
535
 
267
536
  # Update custom commands
268
- saac update --pre-deploy-cmd "npm run migrate"
537
+ saac update --pre-deploy-cmd "npm run migrate" --start-cmd "npm start"
269
538
 
270
539
  # Disable health checks
271
540
  saac update --no-health-check
541
+
542
+ # Update environment variables
543
+ saac update --env NODE_ENV=production --env DEBUG=true
544
+
545
+ # Change restart policy
546
+ saac update --restart on-failure
272
547
  ```
273
548
 
274
- **Options:** All options from `create` command can be updated individually
549
+ **Options:** All options from `create` command can be updated individually.
275
550
 
276
551
  **Important:** Configuration changes require redeployment to take effect:
277
552
  ```bash
278
553
  saac deploy
279
554
  ```
280
555
 
281
- #### `saac deploy`
282
- Deploy your application
556
+ **Supported Updates:**
557
+ - Basic: name, branch, port
558
+ - Build pack and custom commands
559
+ - Resource limits (subject to tier limits)
560
+ - Health checks (enable/disable and all parameters)
561
+ - Restart policy: `always`, `on-failure`, `unless-stopped`, `no`
562
+ - Environment variables
563
+
564
+ **Note:** Only the fields you specify will be updated (partial updates).
565
+
566
+ ### `saac deploy [-f]`
567
+
568
+ Trigger deployment of your application.
283
569
 
284
570
  ```bash
571
+ # Normal deployment
285
572
  saac deploy
573
+
574
+ # Force deployment (rebuild from scratch)
286
575
  saac deploy --force
576
+ saac deploy -f
287
577
  ```
288
578
 
289
- #### `saac logs`
290
- View application logs
579
+ **What happens:**
580
+ 1. Validates authentication and project config
581
+ 2. Triggers deployment on Coolify via wrapper API
582
+ 3. Shows deployment ID and status
583
+ 4. Provides command to follow logs
291
584
 
292
- ```bash
293
- saac logs
294
- saac logs --tail 50
295
- saac logs --follow
585
+ **Options:**
586
+ - `-f, --force` - Force rebuild (ignore cache)
587
+
588
+ **Example output:**
296
589
  ```
590
+ Deploying Application
591
+ ─────────────────────
297
592
 
298
- ### Environment Variables
593
+ Application: mysimpleflowershop
594
+ ℹ Repository: git@git.startanaicompany.com:user/repo.git
595
+ ℹ Branch: master
299
596
 
300
- #### `saac env set <vars...>`
301
- Set environment variables
597
+ Triggering deployment...
302
598
 
303
- ```bash
304
- saac env set KEY=value
305
- saac env set KEY1=value1 KEY2=value2
306
- ```
599
+ ✓ Deployment triggered successfully!
307
600
 
308
- #### `saac env get [key]`
309
- Get environment variable(s)
601
+ Status: queued
602
+ Deployment ID: dp_abc123def456
603
+ Domain: mysimpleflowershop.startanaicompany.com
310
604
 
311
- ```bash
312
- saac env get
313
- saac env get KEY
605
+ ℹ Follow deployment logs:
606
+ saac logs --deployment
314
607
  ```
315
608
 
316
- #### `saac env list`
317
- List all environment variables
609
+ ### `saac deployments`
318
610
 
319
- ```bash
320
- saac env list
321
- ```
611
+ View deployment history for your application.
322
612
 
323
- ### Domain Management
613
+ ```bash
614
+ # List recent deployments (default: 20)
615
+ saac deployments
616
+ saac deploys # Alias
324
617
 
325
- #### `saac domain set <subdomain>`
326
- Change your application subdomain
618
+ # Show more deployments
619
+ saac deployments --limit 50
327
620
 
328
- ```bash
329
- saac domain set newsubdomain
621
+ # Pagination
622
+ saac deployments --limit 20 --offset 20
330
623
  ```
331
624
 
332
- #### `saac domain show`
333
- Show current domain
334
-
335
- ```bash
336
- saac domain show
625
+ **Options:**
626
+ - `-l, --limit <number>` - Number of deployments to show (default: 20)
627
+ - `-o, --offset <number>` - Offset for pagination (default: 0)
628
+
629
+ **Shows:**
630
+ - Deployment ID
631
+ - Status (finished, failed, running, queued)
632
+ - Started/finished timestamps
633
+ - Duration
634
+ - Commit hash and message
635
+ - Branch
636
+
637
+ **Example output:**
638
+ ```
639
+ Deployment History: mysimpleflowershop
640
+ ─────────────────────────────────────
641
+
642
+ ┌──────────────────┬──────────┬─────────────┬──────────┬──────────────┐
643
+ │ ID │ Status │ Started │ Duration │ Commit │
644
+ ├──────────────────┼──────────┼─────────────┼──────────┼──────────────┤
645
+ │ dp_abc123... │ finished │ 10:30 AM │ 45s │ a1b2c3d Fix │
646
+ │ dp_def456... │ failed │ 9:15 AM │ 12s │ e4f5g6h Add │
647
+ │ dp_ghi789... │ finished │ Yesterday │ 52s │ i7j8k9l Upd │
648
+ └──────────────────┴──────────┴─────────────┴──────────┴──────────────┘
649
+
650
+ Total: 3 deployments
337
651
  ```
338
652
 
339
- ### Information
653
+ ### `saac list`
340
654
 
341
- #### `saac list`
342
- List all your applications
655
+ List all your applications.
343
656
 
344
657
  ```bash
345
658
  saac list
346
- saac ls
659
+ saac ls # Alias
660
+ ```
661
+
662
+ **Shows:**
663
+ - Application name
664
+ - Domain
665
+ - Status (running, stopped, error, etc.)
666
+ - Git branch
667
+ - Creation date
668
+
669
+ **Example output:**
347
670
  ```
671
+ Your Applications (3)
672
+ ─────────────────────
673
+
674
+ ┌──────────────────────┬──────────────────────────────────┬─────────────┬────────┬──────────────┐
675
+ │ Name │ Domain │ Status │ Branch │ Created │
676
+ ├──────────────────────┼──────────────────────────────────┼─────────────┼────────┼──────────────┤
677
+ │ mysimpleflowershop │ shop.startanaicompany.com │ Running ✓ │ master │ Jan 26, 2026 │
678
+ │ api-server │ api.startanaicompany.com │ Running ✓ │ main │ Jan 20, 2026 │
679
+ │ landing-page │ landing.startanaicompany.com │ Stopped │ master │ Jan 15, 2026 │
680
+ └──────────────────────┴──────────────────────────────────┴─────────────┴────────┴──────────────┘
681
+
682
+ Total: 3 applications
683
+ ```
684
+
685
+ ### `saac status`
348
686
 
349
- #### `saac status`
350
- Show current application status
687
+ Show current application status and configuration.
351
688
 
352
689
  ```bash
353
690
  saac status
354
691
  ```
355
692
 
356
- #### `saac whoami`
357
- Show current user information
693
+ **Shows:**
694
+ - Application details (name, UUID, domain)
695
+ - Git repository and branch
696
+ - Current status (running/stopped/error)
697
+ - Resource usage (CPU, memory)
698
+ - Health check status
699
+ - Environment variables count
700
+ - Recent deployments
358
701
 
359
- ```bash
360
- saac whoami
702
+ **Example output:**
703
+ ```
704
+ Application Status
705
+ ──────────────────
706
+
707
+ Name: mysimpleflowershop
708
+ UUID: abc123def456
709
+ Domain: shop.startanaicompany.com
710
+ Status: Running ✓
711
+ Branch: master
712
+ Repository: git@git.startanaicompany.com:user/repo.git
713
+
714
+ Resources
715
+ ─────────
716
+ CPU: 0.5 / 1.0 vCPU
717
+ Memory: 256M / 1024M
718
+ Health: Healthy ✓
719
+
720
+ Configuration
721
+ ─────────────
722
+ Build Pack: nixpacks
723
+ Port: 3000
724
+ Env Variables: 5 / 50
725
+
726
+ Recent Deployments
727
+ ──────────────────
728
+ Last Deploy: Jan 29, 2026, 10:30 AM (finished)
729
+ Duration: 45 seconds
730
+ Commit: a1b2c3d Fix bug in auth
361
731
  ```
362
732
 
363
- ### Deletion
733
+ ### `saac delete`
364
734
 
365
- #### `saac delete`
366
- Delete current application
735
+ Delete current application.
367
736
 
368
737
  ```bash
738
+ # With confirmation prompt
369
739
  saac delete
370
- saac delete --yes # Skip confirmation
371
- saac rm # Alias
740
+
741
+ # Skip confirmation
742
+ saac delete --yes
743
+ saac delete -y
744
+
745
+ # Alias
746
+ saac rm
372
747
  ```
373
748
 
374
- ## Configuration
749
+ **⚠️ Warning:** This action is **irreversible**! All data will be deleted.
375
750
 
376
- ### Global Configuration
751
+ **What gets deleted:**
752
+ - Application container
753
+ - Environment variables
754
+ - Deployment history
755
+ - Logs
756
+ - Domain configuration
377
757
 
378
- Stored in `~/.config/startanaicompany/config.json`:
758
+ **What stays:**
759
+ - Git repository (not affected)
760
+ - Local `.saac/config.json` (you can delete manually)
379
761
 
380
- ```json
381
- {
382
- "apiUrl": "https://apps.startanaicompany.com/api/v1",
383
- "user": {
384
- "email": "user@example.com",
385
- "userId": "...",
386
- "apiKey": "cw_...",
387
- "verified": true
388
- }
389
- }
762
+ ### `saac manual`
763
+
764
+ Display full documentation from GitHub README.
765
+
766
+ ```bash
767
+ saac manual
390
768
  ```
391
769
 
392
- ### Project Configuration
770
+ Fetches and displays the latest README.md from the GitHub repository.
393
771
 
394
- Stored in `.saac/config.json` in your project:
772
+ ---
395
773
 
396
- ```json
397
- {
398
- "applicationUuid": "...",
399
- "applicationName": "my-site",
400
- "subdomain": "mysite",
401
- "domainSuffix": "startanaicompany.com",
402
- "gitRepository": "git@git.startanaicompany.com:user/repo.git"
403
- }
404
- ```
774
+ ## Environment Variables
775
+
776
+ Manage environment variables for your application. Changes require redeployment to take effect.
405
777
 
406
- ## Workflow Example
778
+ ### `saac env set <vars...>`
779
+
780
+ Set or update environment variables.
407
781
 
408
782
  ```bash
409
- # Step 1: Register and verify
410
- saac register -e dev@company.com
411
- # Check MailHog for code
412
- saac verify 123456
783
+ # Set single variable
784
+ saac env set NODE_ENV=production
413
785
 
414
- # Step 2: Login
415
- saac login -e dev@company.com -k cw_your_api_key
786
+ # Set multiple variables
787
+ saac env set NODE_ENV=production LOG_LEVEL=debug API_URL=https://api.example.com
416
788
 
417
- # Step 3: Connect your Git account (OAuth)
418
- saac git connect
789
+ # Set variable with special characters
790
+ saac env set DATABASE_URL="postgresql://user:p@ss!word@host:5432/db"
419
791
 
420
- # Step 4: Clone or create your project
421
- git clone git@git.startanaicompany.com:user/mysite.git
422
- cd mysite
792
+ # Set variable with spaces (must quote the entire KEY=VALUE)
793
+ saac env set "WELCOME_MESSAGE=Hello World"
794
+ ```
423
795
 
424
- # Step 5: Create application
425
- saac create mysite -s mysite -r git@git.startanaicompany.com:user/mysite.git
796
+ **Rules:**
797
+ - **Key format:** `^[A-Z_][A-Z0-9_]*$` (uppercase, alphanumeric, underscores)
798
+ - **Valid keys:** `NODE_ENV`, `DATABASE_URL`, `API_KEY`, `LOG_LEVEL`
799
+ - **Invalid keys:** `node-env` (hyphen), `2KEY` (starts with number), `key!` (special char)
800
+ - **Value length:** 0-10,000 characters
801
+ - **Maximum variables:** 50 per application
426
802
 
427
- # Step 6: Deploy
428
- saac deploy
803
+ **Example output:**
804
+ ```
805
+ Updating Environment Variables
806
+ ──────────────────────────────
429
807
 
430
- # Step 7: View logs
431
- saac logs --follow
808
+ Variables to set:
809
+ NODE_ENV: production
810
+ DATABASE_URL: postgresql://use***@32/db
811
+ API_KEY: sk_t***123
812
+
813
+ ⏳ Updating environment variables...
814
+
815
+ ✔ Environment variables updated successfully!
816
+
817
+ ✓ Set 3 variable(s)
432
818
 
433
- # Step 8: Update environment variables
434
- saac env set COMPANY_NAME="My Company"
435
- saac deploy # Redeploy to apply changes
819
+ Changes require redeployment to take effect
820
+ Run:
821
+ saac deploy
436
822
  ```
437
823
 
438
- ## Environment Variables
824
+ **Important:** Environment variable values with sensitive patterns are automatically masked in output:
825
+ - `PASSWORD`, `SECRET`, `KEY`, `TOKEN`
826
+ - `DATABASE_URL`, `DB_URL`, `PRIVATE`, `AUTH`
827
+
828
+ ### `saac env get [key]`
439
829
 
440
- The CLI sets these automatically:
441
- - `DOMAIN` - Your application domain
442
- - `COOLIFY_*` - Coolify API configuration (managed by wrapper)
830
+ Get environment variable(s).
443
831
 
444
- You can set custom variables:
445
832
  ```bash
446
- saac env set COMPANY_NAME="Acme Corp"
447
- saac env set PRIMARY_COLOR="#2563EB"
448
- saac env set CONTACT_EMAIL="contact@acme.com"
833
+ # Get all variables
834
+ saac env get
835
+
836
+ # Get specific variable
837
+ saac env get NODE_ENV
449
838
  ```
450
839
 
451
- ## Troubleshooting
840
+ **Example output (all variables):**
841
+ ```
842
+ Environment Variables: mysimpleflowershop
843
+
844
+ ┌───────────────────┬─────────────────────────────────────┐
845
+ │ Key │ Value │
846
+ ├───────────────────┼─────────────────────────────────────┤
847
+ │ NODE_ENV │ production │
848
+ │ LOG_LEVEL │ debug │
849
+ │ DATABASE_URL │ post***@32/db │
850
+ │ API_KEY │ sk_t***123 │
851
+ │ PORT │ 3000 │
852
+ └───────────────────┴─────────────────────────────────────┘
853
+
854
+ Total: 5 / 50 variables
855
+ ```
856
+
857
+ **Example output (specific variable):**
858
+ ```
859
+ Environment Variable: NODE_ENV
860
+
861
+ Key: NODE_ENV
862
+ Value: production
863
+ ```
864
+
865
+ ### `saac env list`
866
+
867
+ List all environment variables (alias for `saac env get`).
452
868
 
453
- ### "Not logged in"
454
869
  ```bash
455
- saac login -e your@email.com -k cw_your_api_key
870
+ saac env list
871
+ saac env ls # Alias
456
872
  ```
457
873
 
458
- ### "Git account not connected"
459
- You must connect your Git account before creating applications:
874
+ **Note:** This is exactly the same as `saac env get` with no arguments.
875
+
876
+ ### Environment Variables Workflow
877
+
460
878
  ```bash
461
- saac git connect
879
+ # 1. Set your environment variables
880
+ saac env set NODE_ENV=production \
881
+ DATABASE_URL=postgresql://user:pass@host:5432/db \
882
+ API_KEY=sk_test_123 \
883
+ LOG_LEVEL=info
884
+
885
+ # 2. Verify what you set
886
+ saac env list
887
+
888
+ # 3. Deploy to apply changes
889
+ saac deploy
890
+
891
+ # 4. Check if application started correctly
892
+ saac logs
893
+
894
+ # 5. Verify specific variable (if needed)
895
+ saac env get DATABASE_URL
462
896
  ```
463
897
 
464
- ### "No application found"
898
+ **Common Variables:**
465
899
  ```bash
466
- saac init
467
- # or
468
- saac create
900
+ # Node.js applications
901
+ saac env set NODE_ENV=production \
902
+ PORT=3000 \
903
+ LOG_LEVEL=info
904
+
905
+ # Database connections
906
+ saac env set DATABASE_URL=postgresql://user:pass@db.internal:5432/myapp \
907
+ REDIS_URL=redis://redis:6379
908
+
909
+ # API keys and secrets
910
+ saac env set API_KEY=sk_live_... \
911
+ JWT_SECRET=your-secret-key \
912
+ STRIPE_SECRET_KEY=sk_live_...
913
+
914
+ # Application-specific
915
+ saac env set COMPANY_NAME="Acme Corp" \
916
+ PRIMARY_COLOR="#2563EB" \
917
+ CONTACT_EMAIL=contact@acme.com
469
918
  ```
470
919
 
471
- ### "Email not verified"
472
- Check MailHog at https://mailhog.goryan.io and run:
920
+ ---
921
+
922
+ ## Remote Access
923
+
924
+ Access and execute commands inside your deployed container.
925
+
926
+ ### Remote Shell
927
+
928
+ **Project Aurora** - TRUE remote shell access via WebSocket.
929
+
930
+ #### `saac shell`
931
+
932
+ Open an interactive remote shell session inside your container.
933
+
473
934
  ```bash
474
- saac verify <code>
935
+ saac shell
475
936
  ```
476
937
 
477
- ### Deployment fails
938
+ **What happens:**
939
+ 1. Connects to container via WebSocket
940
+ 2. Creates or attaches to tmux session
941
+ 3. Gives you a bash prompt inside the container
942
+ 4. Session persists even if you disconnect
943
+
944
+ **Features:**
945
+ - ✅ Real bash prompt from container
946
+ - ✅ Working directory changes persist
947
+ - ✅ Access to all remote files and tools
948
+ - ✅ All environment variables available
949
+ - ✅ Interactive tools work (vim, nano, htop, etc.)
950
+ - ✅ Session persistence (up to 1 hour idle)
951
+ - ✅ Auto-reconnection on network interruption
952
+
953
+ **Example session:**
478
954
  ```bash
479
- # View logs to see what went wrong
480
- saac logs
955
+ $ saac shell
481
956
 
482
- # Try force deploy
483
- saac deploy --force
484
- ```
957
+ ═══════════════════════════════════════════════════════════════
958
+ Remote Shell: mysimpleflowershop
959
+ ═══════════════════════════════════════════════════════════════
485
960
 
486
- ## Development
961
+ Connecting to container...
962
+ ℹ This may take up to 30 seconds for container creation.
487
963
 
488
- ```bash
489
- # Clone repository
490
- git clone https://github.com/startanaicompany/cli.git
491
- cd cli
964
+ ✓ Connected to remote container
965
+ Container is ready!
966
+ Type commands below. Press Ctrl+D or type "exit" to quit.
492
967
 
493
- # Install dependencies
494
- npm install
968
+ root@container-abc123:/app# ls -la
969
+ total 128
970
+ drwxr-xr-x 8 root root 4096 Jan 29 09:00 .
971
+ drwxr-xr-x 18 root root 4096 Jan 29 09:00 ..
972
+ -rw-r--r-- 1 root root 1245 Jan 29 09:00 package.json
973
+ drwxr-xr-x 2 root root 4096 Jan 29 09:00 node_modules
974
+ -rw-r--r-- 1 root root 543 Jan 29 09:00 server.js
495
975
 
496
- # Link for local development
497
- npm link
976
+ root@container-abc123:/app# npm run test
977
+ > mysimpleflowershop@1.0.0 test
978
+ > jest
498
979
 
499
- # Now you can use `saac` command
500
- saac --help
980
+ PASS tests/auth.test.js
981
+ PASS tests/api.test.js
982
+
983
+ Test Suites: 2 passed, 2 total
984
+ Tests: 15 passed, 15 total
985
+
986
+ root@container-abc123:/app# echo $NODE_ENV
987
+ production
988
+
989
+ root@container-abc123:/app# exit
990
+
991
+ ℹ Disconnecting from remote shell...
501
992
  ```
502
993
 
503
- ## Support
994
+ **Exit shell:**
995
+ - Type `exit` or `quit`
996
+ - Press `Ctrl+D`
504
997
 
505
- - 📧 Email: support@startanaicompany.com
506
- - 🐛 Issues: https://github.com/startanaicompany/cli/issues
507
- - 📚 Docs: https://startanaicompany.com/docs
998
+ **Session Persistence:**
999
+ If you close your terminal and reconnect within 1 hour, you'll resume the same session:
508
1000
 
509
- ## License
1001
+ ```bash
1002
+ # Terminal 1 (close after cd command)
1003
+ $ saac shell
1004
+ root@container:/app# cd src
1005
+ root@container:/app/src# [close terminal]
1006
+
1007
+ # Terminal 2 (5 minutes later, same machine)
1008
+ $ saac shell
1009
+ root@container:/app/src# pwd
1010
+ /app/src ← Same session, same directory!
1011
+ ```
510
1012
 
511
- MIT © StartAnAiCompany
1013
+ **Use Cases:**
1014
+ - Debug production issues
1015
+ - Run database migrations manually
1016
+ - Check file contents
1017
+ - Install packages temporarily
1018
+ - Monitor processes
1019
+ - Test commands before adding to build scripts
1020
+
1021
+ ### Remote Execution
1022
+
1023
+ Run one-off commands inside your container without opening an interactive shell.
1024
+
1025
+ #### `saac exec <command>`
1026
+
1027
+ Execute a single command in the remote container.
1028
+
1029
+ ```bash
1030
+ # Run command
1031
+ saac exec "npm run db:migrate"
1032
+
1033
+ # Check Node.js version
1034
+ saac exec "node --version"
1035
+
1036
+ # View environment variables
1037
+ saac exec "printenv | grep NODE"
1038
+
1039
+ # Check running processes
1040
+ saac exec "ps aux"
1041
+
1042
+ # Custom working directory
1043
+ saac exec "npm test" --workdir /app/src
1044
+
1045
+ # Set timeout
1046
+ saac exec "npm run build" --timeout 300
1047
+ ```
1048
+
1049
+ **Options:**
1050
+ - `--workdir <path>` - Working directory (default: `/app`)
1051
+ - `--timeout <seconds>` - Timeout in seconds (default: 30, max: 300)
1052
+
1053
+ **Example output:**
1054
+ ```bash
1055
+ $ saac exec "npm run db:migrate"
1056
+
1057
+ Executing Command: npm run db:migrate
1058
+ ─────────────────────────────────────
1059
+
1060
+ ⏳ Executing remotely...
1061
+
1062
+ Output:
1063
+ ───────
1064
+ > mysimpleflowershop@1.0.0 db:migrate
1065
+ > knex migrate:latest
1066
+
1067
+ Batch 1 run: 3 migrations
1068
+ ✓ create_users_table
1069
+ ✓ create_posts_table
1070
+ ✓ create_comments_table
1071
+
1072
+ ✓ Command executed successfully
1073
+
1074
+ Exit Code: 0
1075
+ Duration: 2.5s
1076
+ Workdir: /app
1077
+ ```
1078
+
1079
+ #### `saac exec --history`
1080
+
1081
+ View execution history.
1082
+
1083
+ ```bash
1084
+ # View recent executions
1085
+ saac exec --history
1086
+
1087
+ # Show more history
1088
+ saac exec --history --limit 50
1089
+
1090
+ # Pagination
1091
+ saac exec --history --limit 20 --offset 20
1092
+ ```
1093
+
1094
+ **Options:**
1095
+ - `--limit <number>` - Limit for history (default: 20, max: 100)
1096
+ - `--offset <number>` - Offset for pagination (default: 0)
1097
+
1098
+ **Shows:**
1099
+ - Command executed
1100
+ - Exit code (success/failure)
1101
+ - Duration
1102
+ - Timestamp
1103
+ - Working directory
1104
+
1105
+ ### Local Development
1106
+
1107
+ Run local commands with remote environment variables.
1108
+
1109
+ #### `saac run <command>`
1110
+
1111
+ Execute a command locally with environment variables from your remote application.
1112
+
1113
+ ```bash
1114
+ # Run local dev server with remote env vars
1115
+ saac run npm run dev
1116
+
1117
+ # Run tests with remote database
1118
+ saac run npm test
1119
+
1120
+ # Run migrations locally
1121
+ saac run npm run migrate
1122
+
1123
+ # Force refresh env vars (skip cache)
1124
+ saac run npm start --sync
1125
+
1126
+ # Quiet mode (suppress warnings)
1127
+ saac run "node script.js" --quiet
1128
+ ```
1129
+
1130
+ **What happens:**
1131
+ 1. Fetches environment variables from remote application
1132
+ 2. Caches them locally for 1 hour
1133
+ 3. Spawns your command with those env vars
1134
+ 4. Command runs on your local machine (not in container)
1135
+
1136
+ **Options:**
1137
+ - `--sync` - Force refresh environment variables (skip cache)
1138
+ - `-q, --quiet` - Quiet mode (suppress warnings)
1139
+
1140
+ **Use Cases:**
1141
+ - Local development with production database
1142
+ - Running migrations before deployment
1143
+ - Testing with production API keys
1144
+ - Debugging with real environment
1145
+
1146
+ **Example:**
1147
+ ```bash
1148
+ $ saac run "node -e 'console.log(process.env.DATABASE_URL)'"
1149
+
1150
+ 🚀 Running command with remote environment variables
1151
+
1152
+ Application: mysimpleflowershop
1153
+ Variables: 5 loaded
1154
+ Cache: Fresh (expires in 58m)
1155
+
1156
+ ──────────────────────────────────────────────────────────────
1157
+
1158
+ postgresql://user:pass@db.internal:5432/myapp
1159
+
1160
+ ✓ Command completed successfully
1161
+ ```
1162
+
1163
+ **⚠️ Security Warning:** Remote secrets are exposed on your local machine. Only use this on trusted machines.
1164
+
1165
+ ---
1166
+
1167
+ ## Logs & Monitoring
1168
+
1169
+ View runtime logs and deployment logs for your application.
1170
+
1171
+ ### `saac logs`
1172
+
1173
+ View runtime logs (container stdout/stderr).
1174
+
1175
+ ```bash
1176
+ # View recent logs
1177
+ saac logs
1178
+
1179
+ # Show more lines
1180
+ saac logs --tail 200
1181
+
1182
+ # Follow logs in real-time (not yet implemented)
1183
+ saac logs --follow
1184
+
1185
+ # Show logs since timestamp
1186
+ saac logs --since "2026-01-29T10:00:00Z"
1187
+ ```
1188
+
1189
+ **Options:**
1190
+ - `-t, --tail <lines>` - Number of lines to show (default: 100)
1191
+ - `-f, --follow` - Follow log output (live streaming - not yet implemented)
1192
+ - `--since <time>` - Show logs since timestamp
1193
+
1194
+ **Example output:**
1195
+ ```
1196
+ Runtime Logs: mysimpleflowershop
1197
+ ───────────────────────────────
1198
+
1199
+ > mysimpleflowershop@1.0.0 start
1200
+ > node server.js
1201
+
1202
+ Server running on port 3000
1203
+ [2026-01-29T10:30:00.000Z] INFO: Database connected
1204
+ [2026-01-29T10:30:01.123Z] INFO: Application started successfully
1205
+ [2026-01-29T10:30:15.456Z] INFO: GET /api/users 200 25ms
1206
+ [2026-01-29T10:30:16.789Z] INFO: GET /api/posts 200 15ms
1207
+ [2026-01-29T10:31:00.000Z] WARN: Slow query detected (1.2s)
1208
+ ```
1209
+
1210
+ ### `saac logs --deployment [uuid]`
1211
+
1212
+ View deployment logs (build logs).
1213
+
1214
+ ```bash
1215
+ # View latest deployment logs
1216
+ saac logs --deployment
1217
+
1218
+ # View specific deployment logs
1219
+ saac logs --deployment dp_abc123def456
1220
+
1221
+ # Raw log format (no coloring)
1222
+ saac logs --deployment --raw
1223
+
1224
+ # Include hidden lines (debug output)
1225
+ saac logs --deployment --include-hidden
1226
+
1227
+ # Short form
1228
+ saac logs -d
1229
+ saac logs -d dp_abc123def456
1230
+ ```
1231
+
1232
+ **Options:**
1233
+ - `-d, --deployment [uuid]` - View deployment logs (if UUID omitted, shows latest)
1234
+ - `--raw` - Show raw log output (deployment logs only)
1235
+ - `--include-hidden` - Include hidden log lines (deployment logs only)
1236
+
1237
+ **Example output:**
1238
+ ```
1239
+ Deployment Logs: mysimpleflowershop
1240
+ ───────────────────────────────────
1241
+
1242
+ Deployment UUID: dp_abc123def456
1243
+ Application: mysimpleflowershop
1244
+ Status: finished
1245
+ Commit: a1b2c3d
1246
+ Message: Fix authentication bug
1247
+ Started: Jan 29, 2026, 10:30:00 AM
1248
+ Finished: Jan 29, 2026, 10:30:45 AM
1249
+ Duration: 45s
1250
+
1251
+ Log Output (234 lines):
1252
+ ────────────────────────────────────────────────────────────
1253
+
1254
+ [00:00:01] Cloning repository...
1255
+ [00:00:03] Checking out branch: master
1256
+ [00:00:05] Detecting language: Node.js
1257
+ [00:00:06] Installing dependencies...
1258
+ [00:00:15] Running npm install...
1259
+ [00:00:25] Building application...
1260
+ [00:00:30] Running npm run build...
1261
+ [00:00:40] Build completed successfully
1262
+ [00:00:42] Creating container image...
1263
+ [00:00:44] Pushing image to registry...
1264
+ [00:00:45] ✓ Deployment completed
1265
+ ```
1266
+
1267
+ ### Log Monitoring Workflow
1268
+
1269
+ ```bash
1270
+ # 1. Deploy application
1271
+ saac deploy
1272
+
1273
+ # 2. Watch deployment progress
1274
+ saac logs --deployment
1275
+
1276
+ # 3. If deployment succeeds, check runtime logs
1277
+ saac logs --tail 100
1278
+
1279
+ # 4. Monitor for errors
1280
+ saac logs | grep ERROR
1281
+
1282
+ # 5. Follow logs (when implemented)
1283
+ saac logs --follow
1284
+ ```
1285
+
1286
+ ---
1287
+
1288
+ ## Domain Management
1289
+
1290
+ Manage your application's domain and subdomain.
1291
+
1292
+ ### `saac domain show`
1293
+
1294
+ Show current domain configuration.
1295
+
1296
+ ```bash
1297
+ saac domain show
1298
+ ```
1299
+
1300
+ **Shows:**
1301
+ - Current domain
1302
+ - Subdomain
1303
+ - Domain suffix
1304
+ - SSL status (if applicable)
1305
+
1306
+ **Example output:**
1307
+ ```
1308
+ Domain Configuration
1309
+ ────────────────────
1310
+
1311
+ Domain: mysimpleflowershop.startanaicompany.com
1312
+ Subdomain: mysimpleflowershop
1313
+ Suffix: startanaicompany.com
1314
+ SSL: Enabled ✓
1315
+ ```
1316
+
1317
+ ### `saac domain set <subdomain>`
1318
+
1319
+ Change your application's subdomain.
1320
+
1321
+ ```bash
1322
+ # Change subdomain
1323
+ saac domain set newsubdomain
1324
+
1325
+ # With custom domain suffix
1326
+ saac domain set myapp --domain-suffix customdomain.com
1327
+ saac domain set myapp -d customdomain.com
1328
+ ```
1329
+
1330
+ **Options:**
1331
+ - `-d, --domain-suffix <suffix>` - Domain suffix (default: startanaicompany.com)
1332
+
1333
+ **What happens:**
1334
+ 1. Updates domain configuration
1335
+ 2. Reconfigures routing
1336
+ 3. Issues new SSL certificate (if applicable)
1337
+ 4. Old domain redirects to new domain
1338
+
1339
+ **Important:** You may need to redeploy for changes to take full effect:
1340
+ ```bash
1341
+ saac deploy
1342
+ ```
1343
+
1344
+ ---
1345
+
1346
+ ## Complete Workflows
1347
+
1348
+ ### First-Time Setup (From Scratch)
1349
+
1350
+ ```bash
1351
+ # 1. Register account
1352
+ saac register -e developer@company.com
1353
+
1354
+ # 2. Check email for verification code
1355
+ # Visit: https://mailhog.goryan.io
1356
+
1357
+ # 3. Verify email (save API key shown after verification!)
1358
+ saac verify 123456
1359
+
1360
+ # 4. Login with API key
1361
+ saac login -e developer@company.com -k cw_abc123...
1362
+
1363
+ # 5. Connect Git account (required for creating apps)
1364
+ saac git connect git.startanaicompany.com
1365
+
1366
+ # 6. Clone or create your project
1367
+ git clone git@git.startanaicompany.com:company/myapp.git
1368
+ cd myapp
1369
+
1370
+ # 7. Create SAAC application
1371
+ saac create myapp \
1372
+ -s myapp \
1373
+ -r git@git.startanaicompany.com:company/myapp.git \
1374
+ -b main \
1375
+ --env NODE_ENV=production
1376
+
1377
+ # 8. Deploy
1378
+ saac deploy
1379
+
1380
+ # 9. View logs
1381
+ saac logs --deployment
1382
+
1383
+ # 10. Check application
1384
+ saac status
1385
+
1386
+ # 11. Access shell if needed
1387
+ saac shell
1388
+ ```
1389
+
1390
+ ### Existing Application (Link to Directory)
1391
+
1392
+ ```bash
1393
+ # 1. Login (if not already logged in)
1394
+ saac login -e developer@company.com -k cw_abc123...
1395
+
1396
+ # 2. Clone the repository
1397
+ git clone git@git.startanaicompany.com:company/existing-app.git
1398
+ cd existing-app
1399
+
1400
+ # 3. Link to existing SAAC application
1401
+ saac init
1402
+ # Select "existing-app" from the list
1403
+
1404
+ # 4. Now you can manage it
1405
+ saac deploy
1406
+ saac logs
1407
+ saac status
1408
+ ```
1409
+
1410
+ ### Environment Variables Management
1411
+
1412
+ ```bash
1413
+ # 1. View current environment variables
1414
+ saac env list
1415
+
1416
+ # 2. Set new variables
1417
+ saac env set NODE_ENV=production \
1418
+ DATABASE_URL=postgresql://user:pass@host:5432/db \
1419
+ API_KEY=sk_live_123 \
1420
+ LOG_LEVEL=info
1421
+
1422
+ # 3. Verify they were set
1423
+ saac env list
1424
+
1425
+ # 4. Deploy to apply changes
1426
+ saac deploy
1427
+
1428
+ # 5. Check if application started correctly
1429
+ saac logs
1430
+
1431
+ # 6. Test specific variable (if needed)
1432
+ saac env get DATABASE_URL
1433
+ ```
1434
+
1435
+ ### Debugging Production Issues
1436
+
1437
+ ```bash
1438
+ # 1. Check application status
1439
+ saac status
1440
+
1441
+ # 2. View runtime logs
1442
+ saac logs --tail 200
1443
+
1444
+ # 3. Look for errors
1445
+ saac logs | grep ERROR
1446
+
1447
+ # 4. Access container shell
1448
+ saac shell
1449
+
1450
+ # Inside container:
1451
+ root@container:/app# ps aux
1452
+ root@container:/app# df -h
1453
+ root@container:/app# cat /app/logs/error.log
1454
+ root@container:/app# npm run db:status
1455
+ root@container:/app# exit
1456
+
1457
+ # 5. Run one-off diagnostic command
1458
+ saac exec "node scripts/health-check.js"
1459
+
1460
+ # 6. Check environment variables
1461
+ saac env list
1462
+
1463
+ # 7. View recent deployments
1464
+ saac deployments
1465
+
1466
+ # 8. Check specific deployment logs
1467
+ saac logs --deployment dp_abc123
1468
+ ```
1469
+
1470
+ ### Local Development with Remote Env
1471
+
1472
+ ```bash
1473
+ # 1. Ensure you're in project directory
1474
+ cd ~/myapp
1475
+
1476
+ # 2. Link to SAAC application (if not already)
1477
+ saac init
1478
+
1479
+ # 3. Run local development server with remote env vars
1480
+ saac run npm run dev
1481
+
1482
+ # 4. Run tests with remote database
1483
+ saac run npm test
1484
+
1485
+ # 5. Run migrations locally (against remote database)
1486
+ saac run npm run migrate
1487
+
1488
+ # 6. Run custom scripts
1489
+ saac run "node scripts/seed-data.js"
1490
+ ```
1491
+
1492
+ ### Multi-Environment Setup
1493
+
1494
+ ```bash
1495
+ # Development environment
1496
+ saac create myapp-dev \
1497
+ -s myapp-dev \
1498
+ -r git@git.startanaicompany.com:company/myapp.git \
1499
+ -b develop \
1500
+ --env NODE_ENV=development \
1501
+ --env LOG_LEVEL=debug
1502
+
1503
+ # Staging environment
1504
+ saac create myapp-staging \
1505
+ -s myapp-staging \
1506
+ -r git@git.startanaicompany.com:company/myapp.git \
1507
+ -b staging \
1508
+ --env NODE_ENV=staging \
1509
+ --env LOG_LEVEL=info
1510
+
1511
+ # Production environment
1512
+ saac create myapp-prod \
1513
+ -s myapp \
1514
+ -r git@git.startanaicompany.com:company/myapp.git \
1515
+ -b main \
1516
+ --env NODE_ENV=production \
1517
+ --env LOG_LEVEL=warn \
1518
+ --health-check \
1519
+ --health-path /api/health \
1520
+ --cpu-limit 2 \
1521
+ --memory-limit 2G
1522
+
1523
+ # Switch between environments using different directories
1524
+ mkdir -p ~/projects/myapp-dev ~/projects/myapp-staging ~/projects/myapp-prod
1525
+
1526
+ cd ~/projects/myapp-dev
1527
+ saac init # Select myapp-dev
1528
+ saac deploy
1529
+
1530
+ cd ~/projects/myapp-staging
1531
+ saac init # Select myapp-staging
1532
+ saac deploy
1533
+
1534
+ cd ~/projects/myapp-prod
1535
+ saac init # Select myapp-prod
1536
+ saac deploy
1537
+ ```
1538
+
1539
+ ---
1540
+
1541
+ ## Troubleshooting
1542
+
1543
+ ### Authentication Issues
1544
+
1545
+ #### "Not logged in"
1546
+
1547
+ **Problem:** Session token expired or not found.
1548
+
1549
+ **Solution:**
1550
+ ```bash
1551
+ saac login -e your@email.com -k cw_your_api_key
1552
+ ```
1553
+
1554
+ **If you lost your API key:**
1555
+ ```bash
1556
+ # You need to have a valid session first (via OTP)
1557
+ # Contact support or check MailHog for OTP login
1558
+
1559
+ # Then regenerate API key
1560
+ saac keys regenerate
1561
+ ```
1562
+
1563
+ #### "Invalid or expired session token"
1564
+
1565
+ **Problem:** Session token expired (valid for 1 year).
1566
+
1567
+ **Solution:**
1568
+ ```bash
1569
+ saac logout
1570
+ saac login -e your@email.com -k cw_your_api_key
1571
+ ```
1572
+
1573
+ #### "Email not verified"
1574
+
1575
+ **Problem:** You registered but didn't verify your email.
1576
+
1577
+ **Solution:**
1578
+ ```bash
1579
+ # Check MailHog for verification code
1580
+ # Visit: https://mailhog.goryan.io
1581
+
1582
+ # Verify with code
1583
+ saac verify 123456
1584
+ ```
1585
+
1586
+ ### Git OAuth Issues
1587
+
1588
+ #### "Git account not connected"
1589
+
1590
+ **Problem:** You must connect your Git account before creating applications.
1591
+
1592
+ **Solution:**
1593
+ ```bash
1594
+ saac git connect
1595
+
1596
+ # Or specify host directly
1597
+ saac git connect git.startanaicompany.com
1598
+ ```
1599
+
1600
+ #### "OAuth authorization failed"
1601
+
1602
+ **Problem:** Browser OAuth flow was cancelled or failed.
1603
+
1604
+ **Solution:**
1605
+ ```bash
1606
+ # Try again with specific host
1607
+ saac git connect git.startanaicompany.com
1608
+
1609
+ # If browser doesn't open automatically, copy the URL from the terminal
1610
+ ```
1611
+
1612
+ #### "OAuth connection expired"
1613
+
1614
+ **Problem:** OAuth token expired or was revoked.
1615
+
1616
+ **Solution:**
1617
+ ```bash
1618
+ # Disconnect and reconnect
1619
+ saac git disconnect git.startanaicompany.com
1620
+ saac git connect git.startanaicompany.com
1621
+ ```
1622
+
1623
+ ### Application Issues
1624
+
1625
+ #### "No application found in current directory"
1626
+
1627
+ **Problem:** No `.saac/config.json` file in current directory.
1628
+
1629
+ **Solution:**
1630
+ ```bash
1631
+ # Link to existing application
1632
+ saac init
1633
+
1634
+ # Or create new application
1635
+ saac create myapp -s myapp -r git@git...
1636
+ ```
1637
+
1638
+ #### "Application not found" (404)
1639
+
1640
+ **Problem:** Application UUID is incorrect or application was deleted.
1641
+
1642
+ **Solution:**
1643
+ ```bash
1644
+ # List all your applications
1645
+ saac list
1646
+
1647
+ # Re-initialize with correct application
1648
+ saac init
1649
+ ```
1650
+
1651
+ ### Deployment Issues
1652
+
1653
+ #### Deployment fails
1654
+
1655
+ **Problem:** Various reasons - check logs.
1656
+
1657
+ **Solution:**
1658
+ ```bash
1659
+ # View deployment logs to see what went wrong
1660
+ saac logs --deployment
1661
+
1662
+ # Common issues:
1663
+ # - Build errors: Check your package.json, Dockerfile, etc.
1664
+ # - Missing dependencies: Ensure all dependencies are in package.json
1665
+ # - Port conflicts: Check --port setting
1666
+ # - Resource limits: Free tier is limited to 1 vCPU, 1GB RAM
1667
+
1668
+ # Try force deploy (rebuild from scratch)
1669
+ saac deploy --force
1670
+ ```
1671
+
1672
+ #### "Health check failed"
1673
+
1674
+ **Problem:** Health check endpoint not responding or returning errors.
1675
+
1676
+ **Solution:**
1677
+ ```bash
1678
+ # 1. Check if health endpoint exists
1679
+ saac shell
1680
+ root@container:/app# curl localhost:3000/health
1681
+
1682
+ # 2. View logs for errors
1683
+ saac logs
1684
+
1685
+ # 3. Temporarily disable health checks
1686
+ saac update --no-health-check
1687
+ saac deploy
1688
+
1689
+ # 4. Fix your health endpoint, re-enable health checks
1690
+ saac update --health-check --health-path /api/health
1691
+ saac deploy
1692
+ ```
1693
+
1694
+ ### Environment Variables Issues
1695
+
1696
+ #### "Failed to fetch environment variables" (500 error)
1697
+
1698
+ **Problem:** Backend database schema issue (known bug as of Jan 29, 2026).
1699
+
1700
+ **Reported to backend team:** Column name mismatch in database query.
1701
+
1702
+ **Workaround:** Setting variables works fine:
1703
+ ```bash
1704
+ # Setting works
1705
+ saac env set KEY=value
1706
+
1707
+ # Listing fails (backend issue)
1708
+ saac env list # Returns 500
1709
+
1710
+ # Wait for backend team to fix database schema
1711
+ ```
1712
+
1713
+ #### Changes not taking effect
1714
+
1715
+ **Problem:** Environment variable changes require redeployment.
1716
+
1717
+ **Solution:**
1718
+ ```bash
1719
+ # After setting env vars, always redeploy
1720
+ saac env set NODE_ENV=production
1721
+ saac deploy
1722
+ ```
1723
+
1724
+ ### Logs Issues
1725
+
1726
+ #### "No logs available"
1727
+
1728
+ **Problem:** Application not deployed yet or container not running.
1729
+
1730
+ **Solution:**
1731
+ ```bash
1732
+ # Check application status
1733
+ saac status
1734
+
1735
+ # Deploy if not deployed
1736
+ saac deploy
1737
+
1738
+ # Wait a moment for container to start
1739
+ sleep 10
1740
+
1741
+ # Try logs again
1742
+ saac logs
1743
+ ```
1744
+
1745
+ #### "result.logs.forEach is not a function"
1746
+
1747
+ **Problem:** Fixed in version 1.4.20. Update your CLI.
1748
+
1749
+ **Solution:**
1750
+ ```bash
1751
+ npm update -g @startanaicompany/cli
1752
+ ```
1753
+
1754
+ ### Shell Issues
1755
+
1756
+ #### "Connection timeout"
1757
+
1758
+ **Problem:** Container taking too long to start or network issues.
1759
+
1760
+ **Solution:**
1761
+ ```bash
1762
+ # Check application status
1763
+ saac status
1764
+
1765
+ # Ensure application is running
1766
+ saac deploy
1767
+
1768
+ # Wait for deployment to complete
1769
+ saac logs --deployment
1770
+
1771
+ # Try shell again
1772
+ saac shell
1773
+ ```
1774
+
1775
+ #### "WebSocket connection failed"
1776
+
1777
+ **Problem:** Backend WebSocket server not available (Project Aurora not deployed yet).
1778
+
1779
+ **Status:** As of Jan 29, 2026, Project Aurora WebSocket infrastructure awaiting backend deployment.
1780
+
1781
+ **Workaround:** Use `saac exec` for one-off commands:
1782
+ ```bash
1783
+ saac exec "npm run migrate"
1784
+ saac exec "ps aux"
1785
+ ```
1786
+
1787
+ ### General Debugging
1788
+
1789
+ ```bash
1790
+ # Check CLI version
1791
+ saac --version
1792
+
1793
+ # Show help
1794
+ saac --help
1795
+
1796
+ # Check what command does
1797
+ saac logs --help
1798
+ saac deploy --help
1799
+
1800
+ # View user information
1801
+ saac whoami
1802
+
1803
+ # List all applications
1804
+ saac list
1805
+
1806
+ # Check application status
1807
+ saac status
1808
+
1809
+ # View session information
1810
+ saac sessions
1811
+
1812
+ # Test API connectivity (manual command from GitHub)
1813
+ saac manual
1814
+ ```
1815
+
1816
+ ---
1817
+
1818
+ ## Configuration Files
1819
+
1820
+ ### Global Configuration
1821
+
1822
+ **Location:** `~/.config/startanaicompany/config.json`
1823
+
1824
+ **Contains:**
1825
+ - API URL
1826
+ - User credentials (email, userId, sessionToken)
1827
+ - Session expiration timestamp
1828
+ - Verification status
1829
+
1830
+ **Example:**
1831
+ ```json
1832
+ {
1833
+ "apiUrl": "https://apps.startanaicompany.com/api/v1",
1834
+ "user": {
1835
+ "email": "developer@company.com",
1836
+ "userId": "a2c37076-1b0e-4b9a-80f8-31ef39766096",
1837
+ "sessionToken": "st_kgzfNByNNrtrDsAW07h6ORwTtP3POK6O98klH9Rm8jTt9ByHojeH7zDmGwaF",
1838
+ "expiresAt": "2027-01-29T09:00:00.000Z",
1839
+ "verified": true
1840
+ }
1841
+ }
1842
+ ```
1843
+
1844
+ **Note:** Managed by the CLI. Do not edit manually unless troubleshooting.
1845
+
1846
+ ### Project Configuration
1847
+
1848
+ **Location:** `.saac/config.json` (in your project directory)
1849
+
1850
+ **Contains:**
1851
+ - Application UUID
1852
+ - Application name
1853
+ - Subdomain
1854
+ - Domain suffix
1855
+ - Git repository
1856
+
1857
+ **Example:**
1858
+ ```json
1859
+ {
1860
+ "applicationUuid": "h884go4s4080kwk4808sw0wc",
1861
+ "applicationName": "mysimpleflowershop",
1862
+ "subdomain": "shop",
1863
+ "domainSuffix": "startanaicompany.com",
1864
+ "gitRepository": "git@git.startanaicompany.com:company/myapp.git"
1865
+ }
1866
+ ```
1867
+
1868
+ **Note:** Created automatically by `saac create` or `saac init`.
1869
+
1870
+ ### .gitignore
1871
+
1872
+ Add to your `.gitignore`:
1873
+ ```gitignore
1874
+ # SAAC CLI config (can be project-specific, commit if shared)
1875
+ .saac/config.json
1876
+
1877
+ # Or keep it if your team shares the same SAAC application
1878
+ # .saac/config.json
1879
+ ```
1880
+
1881
+ ---
1882
+
1883
+ ## For LLMs: How to Use This Tool
1884
+
1885
+ ### Quick Reference
1886
+
1887
+ **Authentication Flow:**
1888
+ 1. `saac register -e email@example.com` → Register
1889
+ 2. Check email for code → Get verification code
1890
+ 3. `saac verify 123456` → Verify (save API key!)
1891
+ 4. `saac login -e email@example.com -k cw_...` → Login (gets session token)
1892
+
1893
+ **Git OAuth (Required for App Creation):**
1894
+ 1. `saac git connect` → Connect Git account
1895
+ 2. Browser opens → Authorize
1896
+ 3. Now you can create apps
1897
+
1898
+ **Application Management:**
1899
+ 1. `saac create name -s subdomain -r git@git...` → Create
1900
+ 2. `saac deploy` → Deploy
1901
+ 3. `saac logs` → View logs
1902
+ 4. `saac shell` → Access container
1903
+
1904
+ **Environment Variables:**
1905
+ 1. `saac env set KEY=value KEY2=value2` → Set
1906
+ 2. `saac env list` → List
1907
+ 3. `saac deploy` → Deploy to apply changes
1908
+
1909
+ **Common Commands:**
1910
+ - `saac list` → List all applications
1911
+ - `saac status` → Show application status
1912
+ - `saac logs` → Runtime logs
1913
+ - `saac logs --deployment` → Build logs
1914
+ - `saac shell` → Interactive shell in container
1915
+ - `saac exec "command"` → Run command in container
1916
+ - `saac run npm start` → Run local command with remote env vars
1917
+
1918
+ ### Key Concepts for LLMs
1919
+
1920
+ 1. **Session Tokens:** Login with API key to get session token (valid 1 year). CLI handles this automatically.
1921
+
1922
+ 2. **Git OAuth Required:** You MUST connect Git account (`saac git connect`) before creating applications.
1923
+
1924
+ 3. **Project Context:** Most commands require `.saac/config.json` in current directory (created by `create` or `init`).
1925
+
1926
+ 4. **Environment Variables:** Changes require redeployment (`saac deploy`) to take effect.
1927
+
1928
+ 5. **Two Types of Logs:**
1929
+ - Runtime logs: `saac logs` (container stdout/stderr)
1930
+ - Deployment logs: `saac logs --deployment` (build output)
1931
+
1932
+ 6. **Remote Access:**
1933
+ - `saac shell` - Interactive shell (like SSH)
1934
+ - `saac exec` - One-off command execution
1935
+ - `saac run` - Local command with remote env vars
1936
+
1937
+ 7. **Project Aurora:** WebSocket-based remote shell providing TRUE container access (not local shell with env vars).
1938
+
1939
+ ### Common Patterns
1940
+
1941
+ **Create and Deploy:**
1942
+ ```bash
1943
+ saac create myapp -s myapp -r git@git.startanaicompany.com:user/repo.git --env NODE_ENV=production
1944
+ saac deploy
1945
+ saac logs --deployment
1946
+ saac logs
1947
+ ```
1948
+
1949
+ **Update Configuration:**
1950
+ ```bash
1951
+ saac update --port 8080 --health-check
1952
+ saac deploy
1953
+ ```
1954
+
1955
+ **Debug Issues:**
1956
+ ```bash
1957
+ saac status
1958
+ saac logs
1959
+ saac shell
1960
+ # Inside: check files, processes, etc.
1961
+ saac exec "npm run health-check"
1962
+ ```
1963
+
1964
+ **Manage Environment:**
1965
+ ```bash
1966
+ saac env set KEY=value
1967
+ saac env list
1968
+ saac deploy
1969
+ ```
1970
+
1971
+ ---
1972
+
1973
+ ## API Endpoints Reference
1974
+
1975
+ For developers integrating with the wrapper API:
1976
+
1977
+ **Base URL:** `https://apps.startanaicompany.com/api/v1`
1978
+
1979
+ **Authentication:**
1980
+ - Header: `X-Session-Token: st_...` (recommended)
1981
+ - Header: `X-API-Key: cw_...` (alternative)
1982
+
1983
+ **Key Endpoints:**
1984
+ - `POST /users/register` - Register user
1985
+ - `POST /users/verify` - Verify email
1986
+ - `POST /auth/login` - Login with API key
1987
+ - `GET /oauth/authorize` - OAuth authorization
1988
+ - `GET /oauth/poll/:session_id` - Poll OAuth status
1989
+ - `GET /users/me/oauth` - List OAuth connections
1990
+ - `DELETE /users/me/oauth/:host` - Revoke OAuth connection
1991
+ - `POST /applications` - Create application
1992
+ - `GET /applications` - List applications
1993
+ - `PATCH /applications/:uuid` - Update application
1994
+ - `POST /applications/:uuid/deploy` - Deploy
1995
+ - `GET /applications/:uuid/logs` - Runtime logs
1996
+ - `GET /applications/:uuid/deployment-logs` - Deployment logs
1997
+ - `GET /applications/:uuid/env` - Get environment variables
1998
+ - `PATCH /applications/:uuid/env` - Set environment variables
1999
+ - `GET /shell/connect` - WebSocket endpoint for remote shell
2000
+ - `POST /applications/:uuid/exec` - Execute remote command
2001
+
2002
+ ---
2003
+
2004
+ ## Development
2005
+
2006
+ ```bash
2007
+ # Clone repository
2008
+ git clone https://github.com/startanaicompany/cli.git
2009
+ cd cli
2010
+
2011
+ # Install dependencies
2012
+ npm install
2013
+
2014
+ # Link for local development
2015
+ npm link
2016
+
2017
+ # Now you can use `saac` command globally
2018
+ saac --help
2019
+
2020
+ # Run linter
2021
+ npm run lint
2022
+
2023
+ # Test locally
2024
+ npm run dev
2025
+ ```
2026
+
2027
+ ### Contributing
2028
+
2029
+ Pull requests are welcome! Please:
2030
+ 1. Fork the repository
2031
+ 2. Create a feature branch
2032
+ 3. Make your changes
2033
+ 4. Add tests if applicable
2034
+ 5. Submit pull request
2035
+
2036
+ ### Architecture
2037
+
2038
+ - **Entry Point:** `bin/saac.js` (Commander.js definitions)
2039
+ - **Commands:** `src/commands/*.js` (command implementations)
2040
+ - **API Client:** `src/lib/api.js` (axios-based HTTP client)
2041
+ - **Logger:** `src/lib/logger.js` (chalk, ora, boxen)
2042
+ - **Config:** `src/lib/config.js` (conf package for global config)
2043
+ - **OAuth:** `src/lib/oauth.js` (Git OAuth helpers)
2044
+
2045
+ ---
2046
+
2047
+ ## Support
2048
+
2049
+ - 📧 **Email:** support@startanaicompany.com
2050
+ - 🐛 **Issues:** https://github.com/startanaicompany/cli/issues
2051
+ - 📚 **Docs:** https://startanaicompany.com/docs
2052
+ - 💬 **MailHog (Dev):** https://mailhog.goryan.io
2053
+
2054
+ ---
2055
+
2056
+ ## License
2057
+
2058
+ MIT © StartAnAiCompany
2059
+
2060
+ ---
2061
+
2062
+ ## Changelog
2063
+
2064
+ ### Version 1.4.20 (Latest)
2065
+ - Fixed logs command - handle logs as string instead of array
2066
+ - Backend returns `result.logs` as string, not array
2067
+
2068
+ ### Version 1.4.19
2069
+ - Version bump
512
2070
 
513
- ## Contributing
2071
+ ### Version 1.4.18
2072
+ - Implemented Project Aurora - TRUE remote shell via WebSocket (Phase 3.5)
2073
+ - Added WebSocket-based remote shell access (`saac shell`)
2074
+ - Fixed env set command - removed spread operator causing array-in-array bug
2075
+ - Environment variable setting now works correctly
514
2076
 
515
- Pull requests are welcome! Please read our contributing guidelines first.
2077
+ ### Version 1.4.14
2078
+ - OAuth-only authentication for Git
2079
+ - Removed manual `--git-token` option
2080
+ - Added `saac git connect`, `saac git list`, `saac git disconnect`
2081
+ - Improved documentation
516
2082
 
517
2083
  ---
518
2084