Skip to content

Commit 3bf3aea

Browse files
committed
Add starhistory + update README.md/AGENTS.md
1 parent eb4deb7 commit 3bf3aea

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

AGENTS.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

6768
5. **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

7477
5.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.
926932
4. **Provider-Agnostic** - Unified interface across clouds and BYOS
927933
5. **Release-Based** - Timestamped releases with blue/green deployment and rollback
928934
6. **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
968975
lightfold domain remove # Remove domain from current directory
969976
lightfold 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
972984
lightfold ssh --target myapp # SSH into server
973985
lightfold 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)

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ That's it! Lightfold will:
5353
- **Deploy Anywhere**: DigitalOcean, Vultr, Hetzner Cloud, or bring your own server
5454
- **Zero Config**: Automatic framework detection and server setup
5555
- **Smart Deploys**: Only deploys what changed, skips everything else
56+
- **Multi-App**: Deploy multiple applications to a single server with automatic port management
5657

5758
## Installation
5859

@@ -93,6 +94,7 @@ For granular control over deployment steps:
9394
### Management Commands
9495

9596
- **`lightfold status`** - View deployment status
97+
- **`lightfold server`** - Manage servers and multi-app deployments
9698
- **`lightfold logs`** - View application logs
9799
- **`lightfold rollback`** - Rollback to previous release
98100
- **`lightfold sync`** - Sync local state with current config
@@ -192,3 +194,7 @@ make test
192194
See [AGENTS.md](AGENTS.md) for architecture details and [docs/RELEASING.md](docs/RELEASING.md) for release instructions.
193195

194196
See <a href="https://lightfold.mintlify.app/" target="_blank">Documentation</a> for complete guides, API reference, and examples.
197+
198+
## Star History
199+
200+
[![Star History Chart](https://api.star-history.com/svg?repos=theognis1002/lightfold-cli&type=Date)](https://www.star-history.com/#theognis1002/lightfold-cli&Date)

0 commit comments

Comments
 (0)