boilerworks 0.1.0__tar.gz

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.
@@ -0,0 +1,2 @@
1
+ .idea/
2
+ backend/backend.iml
@@ -0,0 +1,230 @@
1
+ Metadata-Version: 2.4
2
+ Name: boilerworks
3
+ Version: 0.1.0
4
+ Summary: Production-ready project templates — assembled in seconds.
5
+ Project-URL: Homepage, https://boilerworks.dev
6
+ Project-URL: Repository, https://github.com/ConflictHQ/boilerworks
7
+ Project-URL: Issues, https://github.com/ConflictHQ/boilerworks/issues
8
+ License: MIT
9
+ Keywords: boilerplate,cli,scaffolding,templates
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development :: Code Generators
17
+ Requires-Python: >=3.12
18
+ Requires-Dist: click>=8.1
19
+ Requires-Dist: gitpython>=3.1
20
+ Requires-Dist: jinja2>=3.0
21
+ Requires-Dist: pydantic>=2.0
22
+ Requires-Dist: pyyaml>=6.0
23
+ Requires-Dist: questionary>=2.0
24
+ Requires-Dist: rich>=13.0
25
+ Description-Content-Type: text/markdown
26
+
27
+ # Boilerworks
28
+
29
+ **Production-ready project templates — assembled in seconds.**
30
+
31
+ Boilerworks is a CLI that clones and configures any of 26 opinionated, best-of-breed project templates. Stop re-solving auth, permissions, Docker, CI, and admin panels from scratch. Pick a stack, run `boilerworks init`, and get straight to your business logic.
32
+
33
+ ```bash
34
+ pip install boilerworks
35
+ boilerworks setup # interactive wizard → writes boilerworks.yaml
36
+ boilerworks init # clone + configure the template
37
+ cd my-project
38
+ docker compose up -d # full stack running in seconds
39
+ ```
40
+
41
+ ---
42
+
43
+ ## Installation
44
+
45
+ ```bash
46
+ pip install boilerworks
47
+ # or with uv:
48
+ uv tool install boilerworks
49
+ ```
50
+
51
+ Requires Python 3.12+.
52
+
53
+ ---
54
+
55
+ ## Quick Start
56
+
57
+ ### 1. Run the setup wizard
58
+
59
+ ```bash
60
+ boilerworks setup
61
+ ```
62
+
63
+ Answer 13 questions about your project (name, template, cloud, compliance, etc.) and a `boilerworks.yaml` manifest is written to the current directory.
64
+
65
+ ### 2. Generate the project
66
+
67
+ ```bash
68
+ boilerworks init
69
+ ```
70
+
71
+ Boilerworks clones the selected template, replaces all `boilerworks` references with your project name, and runs `git init` to give you a clean starting commit.
72
+
73
+ ### 3. Start developing
74
+
75
+ ```bash
76
+ cd my-project
77
+ docker compose up -d
78
+ # Visit http://localhost:3000
79
+ ```
80
+
81
+ One command. Full stack. No manual setup.
82
+
83
+ ---
84
+
85
+ ## Template Catalogue
86
+
87
+ 26 templates across three sizes:
88
+
89
+ | Size | Description | Auth | Deploy Target |
90
+ |------|-------------|------|---------------|
91
+ | **Full** | Apps with users | Session auth, permissions, org management | VPS, containers, Kubernetes |
92
+ | **Micro** | API services | API-key auth | VPS, containers |
93
+ | **Edge** | Serverless apps | Flexible | Cloudflare Workers / Pages |
94
+
95
+ ### Full Templates (15)
96
+
97
+ | Name | Backend | Frontend |
98
+ |------|---------|----------|
99
+ | [django-nextjs](https://github.com/ConflictHQ/boilerworks-django-nextjs) | Django 5 | Next.js 16 |
100
+ | [nestjs-nextjs](https://github.com/ConflictHQ/boilerworks-nestjs-nextjs) | NestJS 11 | Next.js 16 |
101
+ | [rails-hotwire](https://github.com/ConflictHQ/boilerworks-rails-hotwire) | Rails 8 | Hotwire + Tailwind |
102
+ | [rails-nextjs](https://github.com/ConflictHQ/boilerworks-rails-nextjs) | Rails 8 | Next.js 16 |
103
+ | [spring-angular](https://github.com/ConflictHQ/boilerworks-spring-angular) | Spring Boot 3 | Angular 19 |
104
+ | [go-nextjs](https://github.com/ConflictHQ/boilerworks-go-nextjs) | Go + Chi | Next.js 16 |
105
+ | [phoenix-liveview](https://github.com/ConflictHQ/boilerworks-phoenix-liveview) | Phoenix 1.7 | LiveView |
106
+ | [laravel-vue](https://github.com/ConflictHQ/boilerworks-laravel-vue) | Laravel 12 | Inertia + Vue 3 |
107
+ | [django-htmx](https://github.com/ConflictHQ/boilerworks-django-htmx) | Django 5 | HTMX + Alpine.js |
108
+ | [fastapi-nextjs](https://github.com/ConflictHQ/boilerworks-fastapi-nextjs) | FastAPI | Next.js 16 |
109
+ | [spring-nextjs](https://github.com/ConflictHQ/boilerworks-spring-nextjs) | Spring Boot 3 | Next.js 16 |
110
+ | [laravel-livewire](https://github.com/ConflictHQ/boilerworks-laravel-livewire) | Laravel 12 | Livewire 3 |
111
+ | [go-htmx](https://github.com/ConflictHQ/boilerworks-go-htmx) | Go + Chi | HTMX + Templ |
112
+ | [fastapi-htmx](https://github.com/ConflictHQ/boilerworks-fastapi-htmx) | FastAPI | HTMX + Alpine.js |
113
+ | [saleor-nextjs](https://github.com/ConflictHQ/boilerworks-saleor-nextjs) | Saleor (Django) | Next.js 16 |
114
+
115
+ ### Micro Templates (6)
116
+
117
+ | Name | Backend |
118
+ |------|---------|
119
+ | [django-micro](https://github.com/ConflictHQ/boilerworks-django-micro) | Django 5 (DRF/Ninja) |
120
+ | [fastapi-micro](https://github.com/ConflictHQ/boilerworks-fastapi-micro) | FastAPI |
121
+ | [nestjs-micro](https://github.com/ConflictHQ/boilerworks-nestjs-micro) | NestJS 11 |
122
+ | [go-micro](https://github.com/ConflictHQ/boilerworks-go-micro) | Go + Chi |
123
+ | [rust-micro](https://github.com/ConflictHQ/boilerworks-rust-micro) | Axum (Rust) |
124
+ | [cherrypy-micro](https://github.com/ConflictHQ/boilerworks-cherrypy-micro) | CherryPy |
125
+
126
+ ### Edge Templates (5)
127
+
128
+ | Name | Framework |
129
+ |------|-----------|
130
+ | [sveltekit-full](https://github.com/ConflictHQ/boilerworks-sveltekit-full) | SvelteKit |
131
+ | [remix-full](https://github.com/ConflictHQ/boilerworks-remix-full) | Remix |
132
+ | [hono-micro](https://github.com/ConflictHQ/boilerworks-hono-micro) | Hono (Cloudflare Workers) |
133
+ | [nuxt-full](https://github.com/ConflictHQ/boilerworks-nuxt-full) | Nuxt 4 |
134
+ | [astro-site](https://github.com/ConflictHQ/boilerworks-astro-site) | Astro |
135
+
136
+ ---
137
+
138
+ ## Commands
139
+
140
+ ```bash
141
+ boilerworks --help # show all commands
142
+ boilerworks list # show all 26 templates
143
+ boilerworks list --size micro # filter by size
144
+ boilerworks list --language python # filter by language
145
+ boilerworks setup # interactive wizard
146
+ boilerworks init # generate project from boilerworks.yaml
147
+ boilerworks init --dry-run # preview what would happen
148
+ boilerworks init --manifest ./path/to/boilerworks.yaml
149
+ boilerworks init --output /path/to/output
150
+ ```
151
+
152
+ ---
153
+
154
+ ## boilerworks.yaml
155
+
156
+ The manifest file describes your project. Generated by `boilerworks setup`, editable by hand.
157
+
158
+ ```yaml
159
+ project: my-app
160
+ family: django-nextjs
161
+ size: full
162
+ topology: standard
163
+ cloud: aws
164
+ ops: true
165
+ region: us-east-1
166
+ domain: myapp.com
167
+ mobile: false
168
+ web_presence: false
169
+ compliance:
170
+ - soc2
171
+ services:
172
+ email: ses
173
+ cache: redis
174
+ data:
175
+ database: postgres
176
+ migrations: true
177
+ seed_data: true
178
+ testing:
179
+ e2e: playwright
180
+ unit: true
181
+ integration: true
182
+ ```
183
+
184
+ See [`boilerworks.yaml.example`](boilerworks.yaml.example) for a fully annotated version.
185
+
186
+ ---
187
+
188
+ ## What Every Template Includes
189
+
190
+ Every Boilerworks Full template ships with:
191
+
192
+ - **Auth** — session-based (httpOnly cookies), bcrypt passwords
193
+ - **Permissions** — group-based, per-operation, checked at every endpoint
194
+ - **Background jobs** — Redis-backed queue, retries, dead-letter handling
195
+ - **Email** — provider-agnostic (SES, SendGrid, Mailgun, Mailpit locally)
196
+ - **Admin** — authenticated management interface with CRUD for all models
197
+ - **Docker Compose** — one command to boot the full stack
198
+ - **CI/CD** — GitHub Actions: lint, test, build, audit
199
+ - **AI agent shims** — CLAUDE.md, AGENTS.md, bootstrap.md
200
+
201
+ ---
202
+
203
+ ## Infrastructure
204
+
205
+ Pair any template with [boilerworks-opscode](https://github.com/ConflictHQ/boilerworks-opscode) for production Terraform:
206
+
207
+ - **AWS** — ECS Fargate, RDS Postgres 16, ElastiCache Redis, ALB, Route53, ACM, S3, Secrets Manager
208
+ - **GCP / Azure** — structured stubs ready for expansion
209
+
210
+ Select a cloud in `boilerworks setup` and `boilerworks init` will clone and configure the ops repo alongside your app.
211
+
212
+ ---
213
+
214
+ ## Contributing
215
+
216
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the development process.
217
+
218
+ Issues and PRs welcome at [github.com/ConflictHQ/boilerworks](https://github.com/ConflictHQ/boilerworks).
219
+
220
+ ---
221
+
222
+ ## Links
223
+
224
+ - Documentation: [boilerworks.dev](https://boilerworks.dev)
225
+ - Product: [boilerworks.ai](https://boilerworks.ai)
226
+ - Templates: [github.com/ConflictHQ](https://github.com/ConflictHQ)
227
+
228
+ ---
229
+
230
+ Boilerworks is a [Conflict](https://weareconflict.com) brand. CONFLICT is a registered trademark of Conflict LLC.
@@ -0,0 +1,204 @@
1
+ # Boilerworks
2
+
3
+ **Production-ready project templates — assembled in seconds.**
4
+
5
+ Boilerworks is a CLI that clones and configures any of 26 opinionated, best-of-breed project templates. Stop re-solving auth, permissions, Docker, CI, and admin panels from scratch. Pick a stack, run `boilerworks init`, and get straight to your business logic.
6
+
7
+ ```bash
8
+ pip install boilerworks
9
+ boilerworks setup # interactive wizard → writes boilerworks.yaml
10
+ boilerworks init # clone + configure the template
11
+ cd my-project
12
+ docker compose up -d # full stack running in seconds
13
+ ```
14
+
15
+ ---
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ pip install boilerworks
21
+ # or with uv:
22
+ uv tool install boilerworks
23
+ ```
24
+
25
+ Requires Python 3.12+.
26
+
27
+ ---
28
+
29
+ ## Quick Start
30
+
31
+ ### 1. Run the setup wizard
32
+
33
+ ```bash
34
+ boilerworks setup
35
+ ```
36
+
37
+ Answer 13 questions about your project (name, template, cloud, compliance, etc.) and a `boilerworks.yaml` manifest is written to the current directory.
38
+
39
+ ### 2. Generate the project
40
+
41
+ ```bash
42
+ boilerworks init
43
+ ```
44
+
45
+ Boilerworks clones the selected template, replaces all `boilerworks` references with your project name, and runs `git init` to give you a clean starting commit.
46
+
47
+ ### 3. Start developing
48
+
49
+ ```bash
50
+ cd my-project
51
+ docker compose up -d
52
+ # Visit http://localhost:3000
53
+ ```
54
+
55
+ One command. Full stack. No manual setup.
56
+
57
+ ---
58
+
59
+ ## Template Catalogue
60
+
61
+ 26 templates across three sizes:
62
+
63
+ | Size | Description | Auth | Deploy Target |
64
+ |------|-------------|------|---------------|
65
+ | **Full** | Apps with users | Session auth, permissions, org management | VPS, containers, Kubernetes |
66
+ | **Micro** | API services | API-key auth | VPS, containers |
67
+ | **Edge** | Serverless apps | Flexible | Cloudflare Workers / Pages |
68
+
69
+ ### Full Templates (15)
70
+
71
+ | Name | Backend | Frontend |
72
+ |------|---------|----------|
73
+ | [django-nextjs](https://github.com/ConflictHQ/boilerworks-django-nextjs) | Django 5 | Next.js 16 |
74
+ | [nestjs-nextjs](https://github.com/ConflictHQ/boilerworks-nestjs-nextjs) | NestJS 11 | Next.js 16 |
75
+ | [rails-hotwire](https://github.com/ConflictHQ/boilerworks-rails-hotwire) | Rails 8 | Hotwire + Tailwind |
76
+ | [rails-nextjs](https://github.com/ConflictHQ/boilerworks-rails-nextjs) | Rails 8 | Next.js 16 |
77
+ | [spring-angular](https://github.com/ConflictHQ/boilerworks-spring-angular) | Spring Boot 3 | Angular 19 |
78
+ | [go-nextjs](https://github.com/ConflictHQ/boilerworks-go-nextjs) | Go + Chi | Next.js 16 |
79
+ | [phoenix-liveview](https://github.com/ConflictHQ/boilerworks-phoenix-liveview) | Phoenix 1.7 | LiveView |
80
+ | [laravel-vue](https://github.com/ConflictHQ/boilerworks-laravel-vue) | Laravel 12 | Inertia + Vue 3 |
81
+ | [django-htmx](https://github.com/ConflictHQ/boilerworks-django-htmx) | Django 5 | HTMX + Alpine.js |
82
+ | [fastapi-nextjs](https://github.com/ConflictHQ/boilerworks-fastapi-nextjs) | FastAPI | Next.js 16 |
83
+ | [spring-nextjs](https://github.com/ConflictHQ/boilerworks-spring-nextjs) | Spring Boot 3 | Next.js 16 |
84
+ | [laravel-livewire](https://github.com/ConflictHQ/boilerworks-laravel-livewire) | Laravel 12 | Livewire 3 |
85
+ | [go-htmx](https://github.com/ConflictHQ/boilerworks-go-htmx) | Go + Chi | HTMX + Templ |
86
+ | [fastapi-htmx](https://github.com/ConflictHQ/boilerworks-fastapi-htmx) | FastAPI | HTMX + Alpine.js |
87
+ | [saleor-nextjs](https://github.com/ConflictHQ/boilerworks-saleor-nextjs) | Saleor (Django) | Next.js 16 |
88
+
89
+ ### Micro Templates (6)
90
+
91
+ | Name | Backend |
92
+ |------|---------|
93
+ | [django-micro](https://github.com/ConflictHQ/boilerworks-django-micro) | Django 5 (DRF/Ninja) |
94
+ | [fastapi-micro](https://github.com/ConflictHQ/boilerworks-fastapi-micro) | FastAPI |
95
+ | [nestjs-micro](https://github.com/ConflictHQ/boilerworks-nestjs-micro) | NestJS 11 |
96
+ | [go-micro](https://github.com/ConflictHQ/boilerworks-go-micro) | Go + Chi |
97
+ | [rust-micro](https://github.com/ConflictHQ/boilerworks-rust-micro) | Axum (Rust) |
98
+ | [cherrypy-micro](https://github.com/ConflictHQ/boilerworks-cherrypy-micro) | CherryPy |
99
+
100
+ ### Edge Templates (5)
101
+
102
+ | Name | Framework |
103
+ |------|-----------|
104
+ | [sveltekit-full](https://github.com/ConflictHQ/boilerworks-sveltekit-full) | SvelteKit |
105
+ | [remix-full](https://github.com/ConflictHQ/boilerworks-remix-full) | Remix |
106
+ | [hono-micro](https://github.com/ConflictHQ/boilerworks-hono-micro) | Hono (Cloudflare Workers) |
107
+ | [nuxt-full](https://github.com/ConflictHQ/boilerworks-nuxt-full) | Nuxt 4 |
108
+ | [astro-site](https://github.com/ConflictHQ/boilerworks-astro-site) | Astro |
109
+
110
+ ---
111
+
112
+ ## Commands
113
+
114
+ ```bash
115
+ boilerworks --help # show all commands
116
+ boilerworks list # show all 26 templates
117
+ boilerworks list --size micro # filter by size
118
+ boilerworks list --language python # filter by language
119
+ boilerworks setup # interactive wizard
120
+ boilerworks init # generate project from boilerworks.yaml
121
+ boilerworks init --dry-run # preview what would happen
122
+ boilerworks init --manifest ./path/to/boilerworks.yaml
123
+ boilerworks init --output /path/to/output
124
+ ```
125
+
126
+ ---
127
+
128
+ ## boilerworks.yaml
129
+
130
+ The manifest file describes your project. Generated by `boilerworks setup`, editable by hand.
131
+
132
+ ```yaml
133
+ project: my-app
134
+ family: django-nextjs
135
+ size: full
136
+ topology: standard
137
+ cloud: aws
138
+ ops: true
139
+ region: us-east-1
140
+ domain: myapp.com
141
+ mobile: false
142
+ web_presence: false
143
+ compliance:
144
+ - soc2
145
+ services:
146
+ email: ses
147
+ cache: redis
148
+ data:
149
+ database: postgres
150
+ migrations: true
151
+ seed_data: true
152
+ testing:
153
+ e2e: playwright
154
+ unit: true
155
+ integration: true
156
+ ```
157
+
158
+ See [`boilerworks.yaml.example`](boilerworks.yaml.example) for a fully annotated version.
159
+
160
+ ---
161
+
162
+ ## What Every Template Includes
163
+
164
+ Every Boilerworks Full template ships with:
165
+
166
+ - **Auth** — session-based (httpOnly cookies), bcrypt passwords
167
+ - **Permissions** — group-based, per-operation, checked at every endpoint
168
+ - **Background jobs** — Redis-backed queue, retries, dead-letter handling
169
+ - **Email** — provider-agnostic (SES, SendGrid, Mailgun, Mailpit locally)
170
+ - **Admin** — authenticated management interface with CRUD for all models
171
+ - **Docker Compose** — one command to boot the full stack
172
+ - **CI/CD** — GitHub Actions: lint, test, build, audit
173
+ - **AI agent shims** — CLAUDE.md, AGENTS.md, bootstrap.md
174
+
175
+ ---
176
+
177
+ ## Infrastructure
178
+
179
+ Pair any template with [boilerworks-opscode](https://github.com/ConflictHQ/boilerworks-opscode) for production Terraform:
180
+
181
+ - **AWS** — ECS Fargate, RDS Postgres 16, ElastiCache Redis, ALB, Route53, ACM, S3, Secrets Manager
182
+ - **GCP / Azure** — structured stubs ready for expansion
183
+
184
+ Select a cloud in `boilerworks setup` and `boilerworks init` will clone and configure the ops repo alongside your app.
185
+
186
+ ---
187
+
188
+ ## Contributing
189
+
190
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the development process.
191
+
192
+ Issues and PRs welcome at [github.com/ConflictHQ/boilerworks](https://github.com/ConflictHQ/boilerworks).
193
+
194
+ ---
195
+
196
+ ## Links
197
+
198
+ - Documentation: [boilerworks.dev](https://boilerworks.dev)
199
+ - Product: [boilerworks.ai](https://boilerworks.ai)
200
+ - Templates: [github.com/ConflictHQ](https://github.com/ConflictHQ)
201
+
202
+ ---
203
+
204
+ Boilerworks is a [Conflict](https://weareconflict.com) brand. CONFLICT is a registered trademark of Conflict LLC.
@@ -0,0 +1,3 @@
1
+ """Boilerworks — production-ready project templates."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,43 @@
1
+ """Bootstrap command — infrastructure layer orchestration (v2 stub)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pathlib import Path
6
+
7
+ from rich.panel import Panel
8
+
9
+ from boilerworks.console import console, print_info, print_warning
10
+
11
+ _LAYERS = [
12
+ ("1", "Foundation", "VPC, subnets, security groups, IAM roles"),
13
+ ("2", "Data", "RDS (Postgres), ElastiCache (Redis), S3 buckets"),
14
+ ("3", "Compute", "ECS/GKE cluster, service definitions, autoscaling"),
15
+ ("4", "Delivery", "Load balancer, TLS certificates, CDN, DNS"),
16
+ ("5", "Observability", "Metrics, logs, alerts, dashboards"),
17
+ ]
18
+
19
+ _V2_NOTICE = (
20
+ "Infrastructure bootstrapping is coming in v2.\n"
21
+ "For now, follow the ops template README to provision infrastructure manually.\n\n"
22
+ "Ops template: [bold]https://github.com/ConflictHQ/boilerworks-opscode[/bold]"
23
+ )
24
+
25
+
26
+ def run_bootstrap(ops_dir: str | None = None, dry_run: bool = True) -> None:
27
+ """Show the infrastructure bootstrap execution plan."""
28
+ if ops_dir:
29
+ ops_path = Path(ops_dir)
30
+ if not ops_path.exists():
31
+ print_warning(f"Ops directory not found: {ops_path}")
32
+ else:
33
+ print_info("No --ops-dir specified; showing generic plan")
34
+
35
+ # Build the plan panel
36
+ plan_lines = ["[bold]Execution plan — 5 layers[/bold]\n"]
37
+ for layer_num, layer_name, layer_desc in _LAYERS:
38
+ plan_lines.append(f" [cyan]{layer_num}.[/cyan] [bold]{layer_name}[/bold]")
39
+ plan_lines.append(f" {layer_desc}")
40
+ plan_lines.append("")
41
+
42
+ console.print(Panel("\n".join(plan_lines).rstrip(), title="[bold]Bootstrap Plan[/bold]", border_style="cyan"))
43
+ console.print(Panel(_V2_NOTICE, title="[bold yellow]v1 — Stub[/bold yellow]", border_style="yellow"))
@@ -0,0 +1,69 @@
1
+ """Boilerworks CLI — main entry point."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import click
6
+
7
+ from boilerworks import __version__
8
+
9
+
10
+ @click.group()
11
+ @click.version_option(__version__, prog_name="boilerworks")
12
+ def main() -> None:
13
+ """Boilerworks — production-ready project templates."""
14
+
15
+
16
+ @main.command()
17
+ def setup() -> None:
18
+ """Interactive wizard → writes boilerworks.yaml."""
19
+ from boilerworks.wizard import run_wizard
20
+
21
+ run_wizard()
22
+
23
+
24
+ @main.command(name="init")
25
+ @click.option("--manifest", "manifest_path", default=None, help="Path to boilerworks.yaml")
26
+ @click.option("--output", "output_dir", default=".", show_default=True, help="Output directory for generated project")
27
+ @click.option("--dry-run", is_flag=True, default=False, help="Print what would happen without doing it")
28
+ def init_command(manifest_path: str | None, output_dir: str, dry_run: bool) -> None:
29
+ """Clone a template and configure it from boilerworks.yaml."""
30
+ from boilerworks.generator import generate_from_manifest
31
+
32
+ generate_from_manifest(manifest_path=manifest_path, output_dir=output_dir, dry_run=dry_run)
33
+
34
+
35
+ @main.command()
36
+ @click.option("--ops-dir", default=None, help="Path to ops directory (default: ../{project}-ops)")
37
+ @click.option("--dry-run", is_flag=True, default=True, help="Show execution plan (v1 only supports dry-run)")
38
+ def bootstrap(ops_dir: str | None, dry_run: bool) -> None:
39
+ """Show infrastructure bootstrap plan (Terraform — v2)."""
40
+ from boilerworks.bootstrap import run_bootstrap
41
+
42
+ run_bootstrap(ops_dir=ops_dir, dry_run=dry_run)
43
+
44
+
45
+ @main.command(name="list")
46
+ @click.option("--size", type=click.Choice(["full", "micro", "edge"]), default=None, help="Filter by template size")
47
+ @click.option(
48
+ "--language",
49
+ type=click.Choice(["python", "typescript", "ruby", "php", "java", "go", "elixir", "rust", "svelte"]),
50
+ default=None,
51
+ help="Filter by primary language",
52
+ )
53
+ @click.option("--status", type=click.Choice(["done", "building", "planned"]), default=None, help="Filter by status")
54
+ def list_command(size: str | None, language: str | None, status: str | None) -> None:
55
+ """List all available templates."""
56
+ from boilerworks.console import print_template_table
57
+ from boilerworks.registry import Registry
58
+
59
+ registry = Registry()
60
+ templates = registry.list_all()
61
+
62
+ if size:
63
+ templates = [t for t in templates if t.size == size]
64
+ if language:
65
+ templates = [t for t in templates if t.language == language]
66
+ if status:
67
+ templates = [t for t in templates if t.status == status]
68
+
69
+ print_template_table(templates)
@@ -0,0 +1,106 @@
1
+ """Rich output helpers for the Boilerworks CLI."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from rich.console import Console
6
+ from rich.panel import Panel
7
+ from rich.table import Table
8
+ from rich.text import Text
9
+
10
+ from boilerworks.registry import TemplateInfo
11
+
12
+ console = Console()
13
+
14
+
15
+ _STATUS_STYLE: dict[str, str] = {
16
+ "done": "bold green",
17
+ "building": "bold yellow",
18
+ "planned": "dim",
19
+ }
20
+
21
+ _SIZE_STYLE: dict[str, str] = {
22
+ "full": "cyan",
23
+ "micro": "magenta",
24
+ "edge": "blue",
25
+ }
26
+
27
+
28
+ def _status_badge(status: str) -> Text:
29
+ style = _STATUS_STYLE.get(status, "")
30
+ labels = {"done": "● done", "building": "◐ building", "planned": "○ planned"}
31
+ return Text(labels.get(status, status), style=style)
32
+
33
+
34
+ def print_template_table(templates: list[TemplateInfo]) -> None:
35
+ """Print a Rich table of templates."""
36
+ if not templates:
37
+ console.print("[yellow]No templates match your filters.[/yellow]")
38
+ return
39
+
40
+ table = Table(
41
+ title=f"Boilerworks Templates ({len(templates)})",
42
+ show_lines=False,
43
+ header_style="bold white",
44
+ border_style="dim",
45
+ expand=False,
46
+ )
47
+
48
+ table.add_column("Name", style="bold", min_width=20)
49
+ table.add_column("Size", min_width=6)
50
+ table.add_column("Language", min_width=11)
51
+ table.add_column("Backend", min_width=16)
52
+ table.add_column("Frontend", min_width=16)
53
+ table.add_column("Status", min_width=13)
54
+ table.add_column("Description", min_width=30)
55
+
56
+ for t in templates:
57
+ size_text = Text(t.size, style=_SIZE_STYLE.get(t.size, ""))
58
+ table.add_row(
59
+ t.name,
60
+ size_text,
61
+ t.language,
62
+ t.backend,
63
+ t.frontend if t.frontend else "—",
64
+ _status_badge(t.status),
65
+ t.description,
66
+ )
67
+
68
+ console.print(table)
69
+
70
+
71
+ def print_template_detail(template: TemplateInfo) -> None:
72
+ """Print a Rich panel with full template details."""
73
+ lines = [
74
+ f"[bold]Name:[/bold] {template.name}",
75
+ f"[bold]Repo:[/bold] {template.repo}",
76
+ f"[bold]Size:[/bold] {template.size}",
77
+ f"[bold]Language:[/bold] {template.language}",
78
+ f"[bold]Backend:[/bold] {template.backend}",
79
+ f"[bold]Frontend:[/bold] {template.frontend or '—'}",
80
+ f"[bold]Status:[/bold] {template.status}",
81
+ f"[bold]Topologies:[/bold] {', '.join(template.topologies)}",
82
+ "",
83
+ f"[bold]Best for:[/bold] {template.best_for}",
84
+ f"[bold]Description:[/bold] {template.description}",
85
+ ]
86
+ console.print(Panel("\n".join(lines), title=f"[bold cyan]{template.name}[/bold cyan]", border_style="cyan"))
87
+
88
+
89
+ def print_success(message: str) -> None:
90
+ """Print a success message."""
91
+ console.print(f"[bold green]✓[/bold green] {message}")
92
+
93
+
94
+ def print_error(message: str) -> None:
95
+ """Print an error message."""
96
+ console.print(f"[bold red]✗[/bold red] {message}")
97
+
98
+
99
+ def print_info(message: str) -> None:
100
+ """Print an informational message."""
101
+ console.print(f"[dim]→[/dim] {message}")
102
+
103
+
104
+ def print_warning(message: str) -> None:
105
+ """Print a warning message."""
106
+ console.print(f"[bold yellow]![/bold yellow] {message}")