Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit 4166af3

Browse files
committed
refactor: simplify implementation
1 parent ab620dd commit 4166af3

File tree

13 files changed

+347
-245
lines changed

13 files changed

+347
-245
lines changed

AGENTS.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,27 @@
44

55
- `./install.sh` - Initialize workstation with development tools (bootstrap)
66
- `./install.sh --install-path /custom/path` - Install to custom directory
7-
- `./revenue init` - Initialize workstation (alternative method)
7+
- `./revenue init` - Initialize workstation (delegates to install.sh)
88
- `./revenue init --install-path /custom/path` - Initialize with custom installation path
99
- `./revenue update` - Update existing tools and packages
1010
- `./revenue help` - Show usage help
11-
- `revenue init|update|demo` - Global command after setup
11+
- `revenue init|update|demo|help` - Available global commands after setup
1212

1313
## Demo Management Commands
1414

1515
- `revenue demo start <language> <framework>` - Start a demo application
1616
- `revenue demo start all` - Start all demo applications
1717
- `revenue demo stop <language> <framework>` - Stop a specific demo
1818
- `revenue demo stop all` - Stop all running demos
19+
- `revenue demo restart <language> <framework>` - Restart a demo application
20+
- `revenue demo restart all` - Restart all running demo applications
1921
- `revenue demo logs <language> <framework>` - View logs from a running demo
2022
- `revenue demo connect <language> <framework>` - Connect to a running demo session
21-
- `revenue demo list` - List all available demos
23+
- `revenue demo list` - List all available demos and their status
2224
- `revenue demo running` - List currently running demos
23-
- `revenue demo clean --confirm` - Reset demo directory
25+
- `revenue demo clean --confirm` - Force cleanup all processes and sockets
26+
- `revenue demo reset --confirm` - Reset to clean git state
27+
- `revenue demo help` - Show demo usage help
2428
- Direct usage: `cd amp_demos && ./demo <command>`
2529

2630
## Architecture
@@ -39,30 +43,40 @@ The demo system manages multiple language/framework combinations using an Overmi
3943

4044
- **Discovery**: Scans `amp_demos/` for directories containing `Procfile` configuration files
4145
- **Process Management**: Uses Overmind with tmux sessions to manage demo processes
42-
- **Tool Management**: Integrates with `mise` for per-demo tool installation
46+
- **Tool Management**: Integrates with `mise` for per-demo tool installation and automatic trusting
4347
- **Directory Structure**: `amp_demos/<language>/<framework>/Procfile`
4448

4549
Each demo application must have:
50+
4651
- `Procfile` - Standard Heroku-style process definition file
4752
- `.env` - Environment variables (PORT, LANGUAGE, FRAMEWORK)
4853
- Optional: `.mise.toml` or `.tool-versions` for tool requirements
4954

55+
The system automatically:
56+
57+
- Trusts mise configurations silently
58+
- Installs tools and dependencies before starting demos
59+
- Cleans up socket files when starting/stopping
60+
- Provides URL information based on PORT from .env file
61+
5062
#### Demo Configuration Format
5163

5264
##### Procfile (standard Procfile format)
65+
5366
```Procfile
5467
setup: pnpm install --silent # Optional: dependency installation command
5568
web: pnpm start # Required: command to start the web process
5669
```
5770

5871
##### .env (environment variables)
72+
5973
```env
6074
PORT=3000
6175
LANGUAGE=javascript
6276
FRAMEWORK=react
6377
```
6478

65-
Demo sessions are named as `<language>-<framework>` and managed by Overmind using tmux for process isolation.
79+
Demo processes are managed individually (not as named sessions) with Overmind handling the tmux session management automatically.
6680

6781
## Code Style
6882

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,19 @@ needed for demos and development.
2323
Once setup is complete, you can use the `revenue` command:
2424

2525
```bash
26-
revenue demo list # See available demo apps
27-
revenue demo start python flask # Start a specific demo
28-
revenue update # Update tools to latest versions
26+
revenue demo list # See available demo apps
27+
revenue demo running # See only running demos
28+
revenue demo start python flask # Start a specific demo
29+
revenue demo start all # Start all demos
30+
revenue demo stop python flask # Stop a specific demo
31+
revenue demo stop all # Stop all demos
32+
revenue demo restart python flask # Restart a specific demo
33+
revenue demo restart all # Restart all running demos
34+
revenue demo logs python flask # View logs from a running demo
35+
revenue demo connect python flask # Connect to a running demo session
36+
revenue demo clean --confirm # Force cleanup all processes and sockets
37+
revenue demo reset --confirm # Reset to clean git state
38+
revenue update # Update tools to latest versions
2939
revenue init --install-path /custom/path # Reinstall to custom location
3040
```
3141

amp_demos/AGENTS.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# AGENTS.md
2+
3+
## Build/Test/Lint Commands
4+
5+
Demo management:
6+
7+
- `./demo start <language> <framework>` - Start a specific demo (e.g., `./demo start python flask`)
8+
- `./demo stop <language> <framework>` - Stop a demo
9+
- `./demo start all` / `./demo stop all` - Start/stop all demos
10+
- `./demo list` - List available demos and status
11+
- `./demo logs <language> <framework>` - View logs from running demo
12+
- `./demo connect <language> <framework>` - Connect to running demo session
13+
14+
Framework-specific commands:
15+
16+
- JavaScript/React: `pnpm install` (setup), `pnpm start` (dev server), `pnpm build` (production build)
17+
- Python/Flask: `mise run dev` (runs Flask dev server), pytest tests via dev dependencies
18+
- Java/Spring Boot & Ktor: `./gradlew bootRun` (start), `./gradlew build` (build)
19+
20+
## Architecture
21+
22+
Multi-language demo collection using Overmind process manager:
23+
24+
- `amp_demos/` - Root demo directory containing language-specific subdirectories
25+
- `<language>/<framework>/` - Individual demo applications (react, flask, spring-boot, ktor, svelte)
26+
- Each demo requires: `Procfile` (process definition), `.env` (PORT, LANGUAGE, FRAMEWORK variables)
27+
- Tool management via mise (`.mise.toml` files for Node, Python, Java toolchains)
28+
- Process orchestration: Overmind with tmux sessions named `<language>-<framework>`
29+
30+
## Code Style
31+
32+
- Shell scripts: bash with `set -e`, colored output helpers (`print_success`, `print_error`)
33+
- Function naming: snake_case for bash functions
34+
- Error handling: fail fast with clear error messages, graceful degradation where appropriate
35+
- Configuration: Standard formats (Procfile, .env, package.json, pyproject.toml, build.gradle)

amp_demos/README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ You can use the demo manager directly or through the main setup script:
4949
### Via revenue command (recommended)
5050

5151
```bash
52-
# From anywhere (after running ./setup.sh init)
52+
# From anywhere (after running ./install.sh)
5353
revenue demo start <language> <framework>
5454
revenue demo stop <language> <framework>
5555
revenue demo list
@@ -86,10 +86,17 @@ cd amp_demos
8686
./demo stop all # Stop all running demos
8787
```
8888

89+
### Restart a Demo
90+
91+
```bash
92+
./demo restart <language> <framework> # Restart a specific demo
93+
./demo restart all # Restart all running demos
94+
```
95+
8996
### View and Interact with Demos
9097

9198
```bash
92-
./demo logs <language> <framework> # View logs from a running demo
99+
./demo logs <language> <framework> # View logs from a running demo (Ctrl+C to exit)
93100
./demo connect <language> <framework> # Connect to a running demo session
94101
```
95102

@@ -103,7 +110,9 @@ cd amp_demos
103110
### Clean Environment
104111

105112
```bash
106-
./demo clean --confirm # Reset git state and stop all demos
113+
./demo clean --confirm # Force cleanup all processes and sockets
114+
./demo reset --confirm # Reset to clean git state (clean + git restore)
115+
./demo help # Show usage help
107116
```
108117

109118
## How It Works
@@ -124,6 +133,12 @@ named `<language>-<framework>`
124133
# Start all available demos
125134
./demo start all
126135

136+
# Restart a specific demo
137+
./demo restart python flask
138+
139+
# Restart all running demos
140+
./demo restart all
141+
127142
# View logs from a running demo
128143
./demo logs python flask
129144

@@ -135,6 +150,15 @@ named `<language>-<framework>`
135150

136151
# List available demos
137152
./demo list
153+
154+
# Show only running demos
155+
./demo running
156+
157+
# Force cleanup all processes
158+
./demo clean --confirm
159+
160+
# Reset to clean git state
161+
./demo reset --confirm
138162
```
139163

140164
## Process Management

0 commit comments

Comments
 (0)