Skip to content

Commit cea6c60

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

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
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: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
<strong><a href="https://lightfold.mintlify.app/" target="_blank">Documentation</a></strong>
2525
</p>
2626

27-
Deploy any web app to your cloud provider with a single command. No Docker, no YAML, no hassle.
28-
2927
<p align="center">
3028
<img src="docs/demo.gif" alt="Lightfold CLI Demo" width="800">
3129
</p>
@@ -44,7 +42,7 @@ lightfold deploy
4442

4543
That's it! Lightfold will:
4644
- Auto-detect your framework (Next.js, Django, Rails, etc.)
47-
- Set up a server on your preferred cloud (DigitalOcean, Vultr, Hetzner, etc.)
45+
- Set up a server on your preferred infra (DigitalOcean, Vultr, Hetzner, etc.)
4846
- Deploy your app with zero configuration
4947

5048
## Features
@@ -53,6 +51,7 @@ That's it! Lightfold will:
5351
- **Deploy Anywhere**: DigitalOcean, Vultr, Hetzner Cloud, or bring your own server
5452
- **Zero Config**: Automatic framework detection and server setup
5553
- **Smart Deploys**: Only deploys what changed, skips everything else
54+
- **Multi-App**: Deploy multiple applications to a single server with automatic port management
5655

5756
## Installation
5857

@@ -93,6 +92,7 @@ For granular control over deployment steps:
9392
### Management Commands
9493

9594
- **`lightfold status`** - View deployment status
95+
- **`lightfold server`** - Manage servers and multi-app deployments
9696
- **`lightfold logs`** - View application logs
9797
- **`lightfold rollback`** - Rollback to previous release
9898
- **`lightfold sync`** - Sync local state with current config
@@ -170,15 +170,16 @@ State per target in `~/.lightfold/state/<target>.json`:
170170
- [**DigitalOcean**](https://www.digitalocean.com) - Full provisioning support
171171
- [**Hetzner Cloud**](https://www.hetzner.com/cloud) - Full provisioning support
172172
- [**Vultr**](https://www.vultr.com) - Full provisioning support
173-
- [ ] [**Fly.io**](https://fly.io) - Container-based deployment (infrastructure provisioning complete, deployment in progress)
173+
- [**Fly.io**](https://fly.io) - Container-based deployment only
174174
- **BYOS** (Bring Your Own Server) - Use any existing server
175175

176176
### Coming Soon
177177
- [ ] [Linode](https://www.linode.com)
178178
- [ ] [AWS EC2](https://aws.amazon.com/ec2)
179179
- [ ] [Google Cloud](https://cloud.google.com/compute) (Compute Engine)
180180
- [ ] [Azure](https://azure.microsoft.com/products/virtual-machines) (VMs)
181-
- [ ] [Traefik](https://traefik.io) / [Caddy](https://caddyserver.com)
181+
- [ ] [Caddy](https://caddyserver.com)
182+
- [ ] [Traefik](https://traefik.io)
182183

183184
## Development
184185

@@ -189,6 +190,8 @@ make build && ./lightfold .
189190
make test
190191
```
191192

192-
See [AGENTS.md](AGENTS.md) for architecture details and [docs/RELEASING.md](docs/RELEASING.md) for release instructions.
193-
194193
See <a href="https://lightfold.mintlify.app/" target="_blank">Documentation</a> for complete guides, API reference, and examples.
194+
195+
## Star History
196+
197+
[![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)