@@ -46,16 +46,17 @@ Lightfold CLI is a framework detector and deployment tool with composable, idemp
4646 - ` create ` - Infrastructure creation (BYOS or auto-provision)
4747 - ` configure ` - Server configuration with idempotency checks
4848 - ` push ` - Release deployment with health checks
49- - ` deploy ` - Orchestrator that chains all steps with smart skipping (supports ` --builder ` flag)
50- - ` status ` - View deployment state and server status (supports ` --json ` )
49+ - ` deploy ` - Orchestrator that chains all steps with smart skipping (supports ` --builder ` , ` --server-ip ` flags)
50+ - ` status ` - View deployment state and server status (supports ` --json ` , shows multi-app context)
51+ - ` server ` - Manage servers and multi-app deployments (` list ` , ` show <ip> ` )
5152 - ` logs ` - Fetch and display application logs (supports ` --tail ` and ` --lines ` )
5253 - ` rollback ` - Instant rollback to previous release (with confirmation)
5354 - ` sync ` - Sync local state/config with actual server state (drift recovery)
5455 - ` config ` - Manage targets and API tokens
5556 - ` domain ` - Manage custom domains and SSL (add, remove, show)
5657 - ` keygen ` - Generate SSH keypairs
5758 - ` ssh ` - Interactive SSH sessions to deployment targets
58- - ` destroy ` - Destroy VM and remove local configuration
59+ - ` destroy ` - Destroy VM and remove local configuration (unregisters from server state)
5960 - Target resolution via ` resolveTarget() ` helper in ` cmd/common.go `
6061 - Builder resolution via ` resolveBuilder() ` helper with 3-layer priority (flag > config > auto-detect)
6162 - Clean JSON output with ` --json ` flag (status command)
@@ -65,10 +66,12 @@ Lightfold CLI is a framework detector and deployment tool with composable, idemp
6566 - Builder selection with ` --builder ` flag (native, nixpacks, dockerfile)
6667
67685 . ** State Tracking** (` pkg/state/ ` ):
68- - Local state files per target: ` ~/.lightfold/state/<target>.json `
69+ - ** Target State** : Per-target deployment state ` ~/.lightfold/state/<target>.json `
70+ - ** Server State** : Multi-app tracking ` ~/.lightfold/servers/<server-ip>.json `
6971 - Remote state markers on servers: ` /etc/lightfold/{created,configured} `
7072 - Git commit tracking to skip unchanged deployments
7173 - Tracks: last commit, last deploy time, last release ID, provision ID, builder, SSL status
74+ - Port allocation system (3000-9000 range) with conflict detection
7275 - Enables idempotent operations and intelligent step skipping
7376
74775.5. ** SSL Management** (` pkg/ssl/ ` ):
@@ -114,7 +117,8 @@ lightfold/
114117│ ├── keygen.go # SSH key generation
115118│ ├── ssh.go # Interactive SSH sessions
116119│ ├── destroy.go # VM destruction and cleanup
117- │ ├── common.go # Shared helpers (resolveTarget, createTarget, configureTarget)
120+ │ ├── server.go # Multi-app server management
121+ │ ├── common.go # Shared helpers (resolveTarget, createTarget, configureTarget, multi-app helpers)
118122│ └── ui/ # TUI components
119123│ ├── detection/ # Detection results display
120124│ ├── sequential/ # Token collection flows
@@ -136,7 +140,9 @@ lightfold/
136140│ │ ├── config.go # Target-based config + tokens
137141│ │ └── deployment.go # Deployment options processing
138142│ ├── state/ # State tracking
139- │ │ └── state.go # Local/remote state management
143+ │ │ ├── state.go # Local/remote state management
144+ │ │ ├── server.go # Multi-app server state
145+ │ │ └── ports.go # Port allocation and conflict detection
140146│ ├── deploy/ # Deployment logic
141147│ │ ├── orchestrator.go # Multi-provider orchestration
142148│ │ ├── executor.go # Blue/green deployment executor
@@ -926,6 +932,7 @@ This approach provides better test isolation and easier maintenance.
9269324 . ** Provider-Agnostic** - Unified interface across clouds and BYOS
9279335 . ** Release-Based** - Timestamped releases with blue/green deployment and rollback
9289346 . ** Target-Based** - Named deployment targets, not path-based projects
935+ 7 . ** Multi-App Ready** - Deploy multiple apps to one server with automatic port allocation
929936
930937## Quick Reference
931938
@@ -968,6 +975,11 @@ lightfold domain add --domain app.com --target myapp # Add to named target
968975lightfold domain remove # Remove domain from current directory
969976lightfold domain show --target myapp # Show domain config for target
970977
978+ # Multi-App Server Management
979+ lightfold server list # List all servers and their apps
980+ lightfold server show 192.168.1.100 # Show server details and all deployed apps
981+ lightfold deploy --server-ip 192.168.1.100 # Deploy new app to existing server
982+
971983# Utilities
972984lightfold ssh --target myapp # SSH into server
973985lightfold destroy --target myapp # Destroy VM and cleanup
@@ -977,6 +989,7 @@ lightfold destroy --target myapp # Destroy VM and cleanup
977989- Config: ` ~/.lightfold/config.json ` (targets)
978990- Tokens: ` ~/.lightfold/tokens.json ` (API tokens, 0600)
979991- State: ` ~/.lightfold/state/<target>.json ` (per-target state)
992+ - Server State: ` ~/.lightfold/servers/<server-ip>.json ` (multi-app tracking)
980993- SSH Keys: ` ~/.lightfold/keys/ ` (generated keypairs)
981994- Remote markers: ` /etc/lightfold/{created,configured} ` (on server)
982995- Releases: ` /srv/<app>/releases/<timestamp>/ ` (on server)
0 commit comments