openboot 0.1.0
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/LICENSE +110 -0
- package/README.md +273 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +132 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/clean.d.ts +7 -0
- package/dist/commands/clean.d.ts.map +1 -0
- package/dist/commands/clean.js +173 -0
- package/dist/commands/clean.js.map +1 -0
- package/dist/commands/dev.d.ts +7 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +92 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/down.d.ts +5 -0
- package/dist/commands/down.d.ts.map +1 -0
- package/dist/commands/down.js +33 -0
- package/dist/commands/down.js.map +1 -0
- package/dist/commands/init.d.ts +5 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +560 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/logs.d.ts +14 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +243 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/reboot.d.ts +5 -0
- package/dist/commands/reboot.d.ts.map +1 -0
- package/dist/commands/reboot.js +15 -0
- package/dist/commands/reboot.js.map +1 -0
- package/dist/commands/setup.d.ts +5 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +200 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/status.d.ts +5 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +200 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/up.d.ts +7 -0
- package/dist/commands/up.d.ts.map +1 -0
- package/dist/commands/up.js +325 -0
- package/dist/commands/up.js.map +1 -0
- package/dist/lib/config.d.ts +18 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +95 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/docker.d.ts +19 -0
- package/dist/lib/docker.d.ts.map +1 -0
- package/dist/lib/docker.js +511 -0
- package/dist/lib/docker.js.map +1 -0
- package/dist/lib/health.d.ts +5 -0
- package/dist/lib/health.d.ts.map +1 -0
- package/dist/lib/health.js +80 -0
- package/dist/lib/health.js.map +1 -0
- package/dist/lib/log.d.ts +11 -0
- package/dist/lib/log.d.ts.map +1 -0
- package/dist/lib/log.js +51 -0
- package/dist/lib/log.js.map +1 -0
- package/dist/lib/ports.d.ts +13 -0
- package/dist/lib/ports.d.ts.map +1 -0
- package/dist/lib/ports.js +45 -0
- package/dist/lib/ports.js.map +1 -0
- package/dist/lib/prereqs.d.ts +8 -0
- package/dist/lib/prereqs.d.ts.map +1 -0
- package/dist/lib/prereqs.js +78 -0
- package/dist/lib/prereqs.js.map +1 -0
- package/dist/lib/process.d.ts +38 -0
- package/dist/lib/process.d.ts.map +1 -0
- package/dist/lib/process.js +285 -0
- package/dist/lib/process.js.map +1 -0
- package/dist/lib/tail.d.ts +12 -0
- package/dist/lib/tail.d.ts.map +1 -0
- package/dist/lib/tail.js +136 -0
- package/dist/lib/tail.js.map +1 -0
- package/dist/types.d.ts +71 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +29 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-MIT
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2025 Treadie, Inc
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the MIT license that is effective on the second anniversary of the date we make
|
|
91
|
+
the Software available. On or after that date, you may use the Software under
|
|
92
|
+
the MIT license, in which case the following will apply:
|
|
93
|
+
|
|
94
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
95
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
96
|
+
the Software without restriction, including without limitation the rights to
|
|
97
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
98
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
99
|
+
so, subject to the following conditions:
|
|
100
|
+
|
|
101
|
+
The above copyright notice and this permission notice shall be included in all
|
|
102
|
+
copies or substantial portions of the Software.
|
|
103
|
+
|
|
104
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
105
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
106
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
107
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
108
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
109
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
110
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# Boot
|
|
2
|
+
|
|
3
|
+
Dev stack lifecycle manager. One command to setup, start, stop, and reboot your projects.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
boot init → creates boot.yaml (auto-detects your stack)
|
|
7
|
+
boot setup → one-time setup (deps, DB, migrations)
|
|
8
|
+
boot up → start everything (Docker + apps) in the background
|
|
9
|
+
boot up -a → start everything + stream logs (Ctrl+C detaches)
|
|
10
|
+
boot dev → interactive dev mode with live logs (Ctrl+C stops all)
|
|
11
|
+
boot down → stop everything
|
|
12
|
+
boot reboot → restart everything
|
|
13
|
+
boot status → show what's running
|
|
14
|
+
boot logs → view service logs (boot logs api -f)
|
|
15
|
+
boot clean → nuke deps, caches, build outputs for a fresh start
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g openboot
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Or use without installing:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx openboot init
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Quick Start
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# In any project
|
|
34
|
+
boot init # creates boot.yaml by auto-detecting your stack
|
|
35
|
+
boot setup # one-time: install deps, start DB, run migrations
|
|
36
|
+
boot up # start Docker + all app processes
|
|
37
|
+
boot dev # or: start + stream live logs (Ctrl+C stops all)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
That's it. `boot init` detects your Docker setup, apps, package manager, env requirements, and generates the config.
|
|
41
|
+
|
|
42
|
+
## Config
|
|
43
|
+
|
|
44
|
+
`boot init` creates a `boot.yaml` in your project root:
|
|
45
|
+
|
|
46
|
+
```yaml
|
|
47
|
+
name: my-project
|
|
48
|
+
|
|
49
|
+
env:
|
|
50
|
+
file: .env
|
|
51
|
+
required:
|
|
52
|
+
- DATABASE_URL
|
|
53
|
+
- JWT_SECRET
|
|
54
|
+
reject:
|
|
55
|
+
JWT_SECRET:
|
|
56
|
+
- your-super-secret-jwt-key-change-this
|
|
57
|
+
|
|
58
|
+
setup:
|
|
59
|
+
- pnpm install
|
|
60
|
+
- pnpm db:generate
|
|
61
|
+
- pnpm db:push
|
|
62
|
+
|
|
63
|
+
docker:
|
|
64
|
+
# Option A: Docker Compose
|
|
65
|
+
composeFile: docker-compose.yml
|
|
66
|
+
services:
|
|
67
|
+
- name: postgres
|
|
68
|
+
container: my-project-postgres
|
|
69
|
+
readyCheck: pg_isready -U postgres
|
|
70
|
+
timeout: 30
|
|
71
|
+
|
|
72
|
+
# Option B: Standalone containers (no compose needed)
|
|
73
|
+
containers:
|
|
74
|
+
- name: my-db
|
|
75
|
+
image: postgres:15
|
|
76
|
+
ports:
|
|
77
|
+
- "5433:5432"
|
|
78
|
+
env:
|
|
79
|
+
POSTGRES_DB: myapp
|
|
80
|
+
POSTGRES_PASSWORD: secret
|
|
81
|
+
readyCheck: pg_isready -U postgres
|
|
82
|
+
timeout: 30
|
|
83
|
+
|
|
84
|
+
apps:
|
|
85
|
+
- name: api
|
|
86
|
+
path: apps/api
|
|
87
|
+
command: pnpm dev
|
|
88
|
+
port: 3001
|
|
89
|
+
health: http://localhost:3001/health
|
|
90
|
+
- name: web
|
|
91
|
+
path: apps/web
|
|
92
|
+
command: pnpm dev
|
|
93
|
+
port: 3000
|
|
94
|
+
health: http://localhost:3000
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Config Reference
|
|
98
|
+
|
|
99
|
+
| Field | Description |
|
|
100
|
+
|-------|-------------|
|
|
101
|
+
| `name` | Project name (display only) |
|
|
102
|
+
| `packageManager` | `pnpm`, `npm`, or `yarn` (auto-detected if omitted) |
|
|
103
|
+
| **env** | |
|
|
104
|
+
| `env.file` | Path to `.env` file (default: `.env`) |
|
|
105
|
+
| `env.required` | Env vars that must be set — `boot up` fails if missing |
|
|
106
|
+
| `env.reject` | Values to reject per key (blocks example/default secrets) |
|
|
107
|
+
| **setup** | |
|
|
108
|
+
| `setup` | Commands to run on `boot setup` |
|
|
109
|
+
| **docker** | |
|
|
110
|
+
| `docker.composeFile` | Path to compose file (default: `docker-compose.yml`) |
|
|
111
|
+
| `docker.services[].name` | Compose service name |
|
|
112
|
+
| `docker.services[].container` | Container name for `docker exec` |
|
|
113
|
+
| `docker.services[].readyCheck` | Command to check if service is ready |
|
|
114
|
+
| `docker.services[].timeout` | Seconds to wait for readiness (default: 30) |
|
|
115
|
+
| `docker.containers[].name` | Standalone container name |
|
|
116
|
+
| `docker.containers[].image` | Docker image (e.g. `postgres:15`) |
|
|
117
|
+
| `docker.containers[].ports` | Port mappings (e.g. `"5433:5432"`) |
|
|
118
|
+
| `docker.containers[].env` | Environment variables for the container |
|
|
119
|
+
| `docker.containers[].volumes` | Volume mounts |
|
|
120
|
+
| `docker.containers[].readyCheck` | Readiness check command |
|
|
121
|
+
| `docker.containers[].timeout` | Seconds to wait (default: 30) |
|
|
122
|
+
| **apps** | |
|
|
123
|
+
| `apps[].name` | App name (used for logs and PID tracking) |
|
|
124
|
+
| `apps[].path` | Working directory relative to project root |
|
|
125
|
+
| `apps[].command` | Command to start the app |
|
|
126
|
+
| `apps[].port` | Port the app listens on |
|
|
127
|
+
| `apps[].health` | URL to poll for health check |
|
|
128
|
+
| `apps[].env` | Extra environment variables |
|
|
129
|
+
|
|
130
|
+
## What `boot init` Auto-Detects
|
|
131
|
+
|
|
132
|
+
- **Package manager** — from lockfiles (`pnpm-lock.yaml`, `yarn.lock`, `package-lock.json`)
|
|
133
|
+
- **Docker Compose** — `docker-compose.yml` / `compose.yml`
|
|
134
|
+
- **Raw Docker containers** — scans `scripts/*.sh` for `docker start` / `docker run` patterns
|
|
135
|
+
- **Database services** — Postgres, MySQL, Redis (with appropriate readiness checks)
|
|
136
|
+
- **Monorepo apps** — scans `apps/*/package.json` for dev scripts
|
|
137
|
+
- **Sub-directory apps** — detects `dashboard/`, `frontend/`, `backend/`, `server/`, etc.
|
|
138
|
+
- **Single-app projects** — detects `dev` or `start` scripts in root `package.json`
|
|
139
|
+
- **Prisma** — detects `prisma/` directory and adds generate/push to setup
|
|
140
|
+
- **Ports** — guesses 3000 for web/frontend, 3001 for api/server
|
|
141
|
+
- **`.env` requirements** — parses `env.example` / `.env.example` for required and sensitive vars
|
|
142
|
+
|
|
143
|
+
## What Each Command Does
|
|
144
|
+
|
|
145
|
+
### `boot up`
|
|
146
|
+
|
|
147
|
+
1. Checks prerequisites (Node.js 18+, Docker if needed)
|
|
148
|
+
2. Auto-creates `.env` from template (`env.example` / `.env.example`) if missing
|
|
149
|
+
3. Validates `.env` file (required vars, rejects default secrets)
|
|
150
|
+
4. Ensures package manager is available (auto-enables pnpm/yarn via corepack)
|
|
151
|
+
5. Auto-installs root deps if `node_modules` is missing
|
|
152
|
+
6. Auto-installs per-app deps in monorepo sub-apps
|
|
153
|
+
7. Smart Prisma check — generates client only if `.prisma` is missing
|
|
154
|
+
8. Starts Docker (compose services and/or standalone containers)
|
|
155
|
+
9. Waits for each service's readiness check
|
|
156
|
+
10. Starts each app in the background
|
|
157
|
+
11. Polls health URLs until ready
|
|
158
|
+
12. Prints summary with URLs
|
|
159
|
+
|
|
160
|
+
#### `boot up --attach` / `boot up -a`
|
|
161
|
+
|
|
162
|
+
Same as `boot up` but after starting, streams all app logs to your terminal (color-coded by service). Press Ctrl+C to detach — services keep running in the background.
|
|
163
|
+
|
|
164
|
+
### `boot dev`
|
|
165
|
+
|
|
166
|
+
Interactive development mode — the closest replacement for your old `start.sh` scripts:
|
|
167
|
+
|
|
168
|
+
1. Starts Docker services
|
|
169
|
+
2. Starts all apps
|
|
170
|
+
3. Streams live, color-coded logs for every service
|
|
171
|
+
4. **Ctrl+C gracefully stops everything** (apps + Docker)
|
|
172
|
+
|
|
173
|
+
This is the "one terminal" experience. No separate tabs needed.
|
|
174
|
+
|
|
175
|
+
### `boot down`
|
|
176
|
+
|
|
177
|
+
1. Stops all tracked app processes (SIGTERM → SIGKILL)
|
|
178
|
+
2. Falls back to `pkill -f` if PID file is stale (catches orphan processes)
|
|
179
|
+
3. Force-kills anything still holding app ports
|
|
180
|
+
4. Stops standalone Docker containers
|
|
181
|
+
5. Stops Docker Compose services
|
|
182
|
+
|
|
183
|
+
### `boot status`
|
|
184
|
+
|
|
185
|
+
Shows a table of all services with:
|
|
186
|
+
- Status (running / stopped / port in use)
|
|
187
|
+
- Port numbers
|
|
188
|
+
- PIDs (with mismatch warnings if PID file ≠ port owner)
|
|
189
|
+
- Process name (what binary is actually running, e.g. `node`, `nuxt`)
|
|
190
|
+
- Live health checks (curl for apps, `pg_isready` / `redis-cli ping` for DBs)
|
|
191
|
+
- Log file paths
|
|
192
|
+
|
|
193
|
+
### `boot clean`
|
|
194
|
+
|
|
195
|
+
Nukes everything for a fresh start:
|
|
196
|
+
1. Removes `node_modules` in root and all sub-apps
|
|
197
|
+
2. Removes lockfiles (`package-lock.json`, `yarn.lock`)
|
|
198
|
+
3. Removes caches (`.nuxt`, `.next`, `.turbo`, `.vite`, `.parcel-cache`)
|
|
199
|
+
4. Removes build outputs (`dist/`, `build/`)
|
|
200
|
+
5. Removes `.boot/` runtime data (PIDs, logs)
|
|
201
|
+
6. Pass `--all` to also remove `pnpm-lock.yaml`
|
|
202
|
+
|
|
203
|
+
### `boot logs`
|
|
204
|
+
|
|
205
|
+
View logs for any service:
|
|
206
|
+
```bash
|
|
207
|
+
boot logs # show recent logs for all services
|
|
208
|
+
boot logs api # show logs for a specific service
|
|
209
|
+
boot logs api -f # follow mode (like tail -f)
|
|
210
|
+
boot logs api -n 100 # last 100 lines
|
|
211
|
+
boot logs postgres # Docker container logs too
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### `boot setup`
|
|
215
|
+
|
|
216
|
+
One-time setup with smart Prisma handling:
|
|
217
|
+
1. Checks prerequisites (Node.js, Docker)
|
|
218
|
+
2. Auto-creates `.env` from template
|
|
219
|
+
3. Starts Docker services (DB needs to be up for migrations)
|
|
220
|
+
4. Runs configured setup commands
|
|
221
|
+
5. Smart Prisma: generate client + migrations with fallback (`migrate deploy` → `db push`)
|
|
222
|
+
6. Non-fatal seed failures (skips gracefully)
|
|
223
|
+
|
|
224
|
+
### `boot reboot`
|
|
225
|
+
|
|
226
|
+
Runs `down` then `up`.
|
|
227
|
+
|
|
228
|
+
## Development Workflow
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Option 1: Background (CI-friendly, scriptable)
|
|
232
|
+
boot up # starts everything, exits immediately
|
|
233
|
+
boot logs api -f # follow one service's logs in another terminal
|
|
234
|
+
boot down # stop when done
|
|
235
|
+
|
|
236
|
+
# Option 2: Attach (start background + watch logs)
|
|
237
|
+
boot up --attach # starts everything, streams logs; Ctrl+C detaches (services stay up)
|
|
238
|
+
boot down # stop when done
|
|
239
|
+
|
|
240
|
+
# Option 3: Interactive (replaces start.sh)
|
|
241
|
+
boot dev # starts everything + live logs; Ctrl+C stops everything
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Docker Support
|
|
245
|
+
|
|
246
|
+
Boot handles two styles of Docker usage:
|
|
247
|
+
|
|
248
|
+
### Docker Compose
|
|
249
|
+
For projects with a `docker-compose.yml`:
|
|
250
|
+
- `boot up` runs `docker compose up -d`
|
|
251
|
+
- Detects port conflicts and auto-remaps to free ports
|
|
252
|
+
- Reuses existing containers when possible
|
|
253
|
+
|
|
254
|
+
### Standalone Containers
|
|
255
|
+
For projects that use raw `docker run` (no compose):
|
|
256
|
+
- Starts existing stopped containers with `docker start`
|
|
257
|
+
- Creates new containers with `docker run -d` if needed
|
|
258
|
+
- Port conflict detection + auto-remap
|
|
259
|
+
|
|
260
|
+
## Process Management
|
|
261
|
+
|
|
262
|
+
- App processes run in the background (detached)
|
|
263
|
+
- PIDs are stored in `.boot/pids/`
|
|
264
|
+
- Logs are written to `.boot/logs/`
|
|
265
|
+
- `boot down` kills the full process tree (not just the parent)
|
|
266
|
+
- Falls back to `pkill -f` for orphan process cleanup
|
|
267
|
+
- Ports are freed before starting if occupied
|
|
268
|
+
|
|
269
|
+
Add `.boot/` to your `.gitignore`.
|
|
270
|
+
|
|
271
|
+
## License
|
|
272
|
+
|
|
273
|
+
[FSL-1.1-MIT](LICENSE)
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const init_1 = require("./commands/init");
|
|
6
|
+
const setup_1 = require("./commands/setup");
|
|
7
|
+
const up_1 = require("./commands/up");
|
|
8
|
+
const down_1 = require("./commands/down");
|
|
9
|
+
const reboot_1 = require("./commands/reboot");
|
|
10
|
+
const status_1 = require("./commands/status");
|
|
11
|
+
const clean_1 = require("./commands/clean");
|
|
12
|
+
const logs_1 = require("./commands/logs");
|
|
13
|
+
const dev_1 = require("./commands/dev");
|
|
14
|
+
const program = new commander_1.Command();
|
|
15
|
+
program
|
|
16
|
+
.name("boot")
|
|
17
|
+
.description("Dev stack lifecycle manager. One command to setup, start, stop, and reboot your projects.")
|
|
18
|
+
.version("0.1.0");
|
|
19
|
+
program
|
|
20
|
+
.command("init")
|
|
21
|
+
.description("Auto-detect project structure and create boot.yaml")
|
|
22
|
+
.action(async () => {
|
|
23
|
+
try {
|
|
24
|
+
await (0, init_1.init)();
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
console.error(err.message);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
program
|
|
32
|
+
.command("setup")
|
|
33
|
+
.description("Run one-time setup (install deps, start DB, run migrations)")
|
|
34
|
+
.action(async () => {
|
|
35
|
+
try {
|
|
36
|
+
await (0, setup_1.setup)();
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
console.error(err.message);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
program
|
|
44
|
+
.command("up")
|
|
45
|
+
.description("Start all services (Docker + apps)")
|
|
46
|
+
.option("-a, --attach", "Attach to logs after starting (Ctrl+C detaches, services keep running)")
|
|
47
|
+
.action(async (opts) => {
|
|
48
|
+
try {
|
|
49
|
+
await (0, up_1.up)(opts);
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
console.error(err.message);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
program
|
|
57
|
+
.command("dev")
|
|
58
|
+
.description("Start all services with live logs (Ctrl+C stops everything)")
|
|
59
|
+
.action(async () => {
|
|
60
|
+
try {
|
|
61
|
+
await (0, dev_1.dev)();
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
console.error(err.message);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
program
|
|
69
|
+
.command("down")
|
|
70
|
+
.description("Stop all services")
|
|
71
|
+
.action(async () => {
|
|
72
|
+
try {
|
|
73
|
+
await (0, down_1.down)();
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
console.error(err.message);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
program
|
|
81
|
+
.command("reboot")
|
|
82
|
+
.description("Restart all services (down + up)")
|
|
83
|
+
.action(async () => {
|
|
84
|
+
try {
|
|
85
|
+
await (0, reboot_1.reboot)();
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
console.error(err.message);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
program
|
|
93
|
+
.command("status")
|
|
94
|
+
.description("Show status of all services")
|
|
95
|
+
.action(async () => {
|
|
96
|
+
try {
|
|
97
|
+
await (0, status_1.status)();
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
console.error(err.message);
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
program
|
|
105
|
+
.command("logs [service]")
|
|
106
|
+
.description("View logs for services (boot logs api -f)")
|
|
107
|
+
.option("-f, --follow", "Follow log output (like tail -f)")
|
|
108
|
+
.option("-n, --lines <count>", "Number of lines to show (default: 40)")
|
|
109
|
+
.action(async (service, opts) => {
|
|
110
|
+
try {
|
|
111
|
+
await (0, logs_1.logs)(service, opts);
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
console.error(err.message);
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
program
|
|
119
|
+
.command("clean")
|
|
120
|
+
.description("Remove node_modules, caches, and build outputs for a fresh start")
|
|
121
|
+
.option("--all", "Also remove pnpm-lock.yaml")
|
|
122
|
+
.action(async (opts) => {
|
|
123
|
+
try {
|
|
124
|
+
await (0, clean_1.clean)(opts);
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
console.error(err.message);
|
|
128
|
+
process.exit(1);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
program.parse();
|
|
132
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAAuC;AACvC,4CAAyC;AACzC,sCAAmC;AACnC,0CAAuC;AACvC,8CAA2C;AAC3C,8CAA2C;AAC3C,4CAAyC;AACzC,0CAAuC;AACvC,wCAAqC;AAErC,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,MAAM,CAAC;KACZ,WAAW,CAAC,2FAA2F,CAAC;KACxG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,oDAAoD,CAAC;KACjE,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,IAAI,CAAC;QACH,MAAM,IAAA,WAAI,GAAE,CAAC;IACf,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,6DAA6D,CAAC;KAC1E,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,IAAI,CAAC;QACH,MAAM,IAAA,aAAK,GAAE,CAAC;IAChB,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAA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