1- # Configliere
1+ # @ bomb .sh/router
22
33** A statically typed entry-point router for command-line applications.**
44
5- An argument parser tells you what the user typed. Configliere tells you where
6- and how they intend to enter your program. For execution, it marshals a
5+ An argument parser tells you what the user typed. ` @bomb.sh/router ` tells you
6+ where and how they intend to enter your program. For execution, it binds a
77validated, statically typed model for that entry point.
88
9- Configliere matches input to an intent: a method at an application-relative
10- route, such as:
9+ ` @bomb.sh/router ` matches input to an intent: a method at an
10+ application-relative route, such as:
1111
1212``` text
1313HELP /
@@ -20,18 +20,15 @@ EXECUTE /database/clean
2020Every reachable intent appears in the result type. Narrow ` method ` and ` route ` ,
2121and TypeScript knows the exact model available at that entry point.
2222
23- Configliere is not a CLI framework. It does not own handlers, effects, output,
24- or process lifetime. It is not a CLI parser whose product is a bag of flags. Its
25- product is a typed intent; your application decides what that intent does.
26-
27- ``` text
28- input → bind and expand phases → resolve route + method → intent
29- ```
23+ ` @bomb.sh/router ` is not a CLI framework. It does not own handlers, effects,
24+ output, or process lifetime. It is not a CLI parser whose product is a bag of
25+ flags. Its product is a typed intent; your application decides what that intent
26+ does.
3027
3128## Define every way into the program
3229
33- ` route() ` declares an address. ` command() ` declares an executable route . Every
34- route supports help; version and execution exist only where they are explicitly
30+ ` route() ` declares an address, and every ` command() ` is just an address that declares an intent to execute . Every
31+ route supports help, whereas version and execution exist only where they are explicitly
3532added.
3633
3734Definitions are immutable composition pipelines, not handler registrations:
@@ -47,7 +44,7 @@ import {
4744 schema ,
4845 toggle ,
4946 version ,
50- } from " @frontside/configliere " ;
47+ } from " @bomb.sh/router " ;
5148import * as z from " zod" ;
5249
5350export const app = command (
@@ -92,12 +89,7 @@ can stay flat even when the route tree is deep:
9289
9390``` ts
9491import process from " node:process" ;
95- import {
96- parse ,
97- printErrors ,
98- printHelp ,
99- printVersion ,
100- } from " @frontside/configliere" ;
92+ import { parse , printErrors , printHelp , printVersion } from " @bomb.sh/router" ;
10193import { app } from " ./app.ts" ;
10294
10395const result = parse (app , { argv: process .argv .slice (2 ) });
@@ -152,14 +144,14 @@ An execute intent has two views of configuration:
152144| ` simulacrum serve --port nope ` | ` unprocessable-content ` ; invalid data never reaches the application |
153145
154146Command literals are routing tokens, not positional arguments. As route segments
155- become discoverable, Configliere scopes parameter binding to the segment that
156- owns each token. This makes identical option names on parent and child routes
157- unambiguous.
147+ become discoverable, ` @bomb.sh/router ` scopes parameter binding to the segment
148+ that owns each token. This makes identical option names on parent and child
149+ routes unambiguous.
158150
159- ## Marshal configuration into the route
151+ ## Bind route parameters from multiple sources
160152
161- CLI arguments are only one source. Configliere can marshal JavaScript values and
162- flat environment records into the same route-local models:
153+ CLI arguments are only one source. ` @bomb.sh/router ` can bind JavaScript
154+ values and flat environment records onto the same route-local models:
163155
164156``` ts
165157const result = parse (app , {
@@ -190,8 +182,8 @@ CLI → environment → JavaScript values → schema default
190182## Pause without surrendering the type system
191183
192184Sometimes the route cannot be fully configured, or even fully discovered, until
193- the application performs I/O. Configliere can pause at a typed checkpoint and
194- resume with the result.
185+ the application performs I/O. ` @bomb.sh/router ` can pause at a typed checkpoint
186+ and resume with the result.
195187
196188Dynamic phases serve two common cases:
197189
@@ -206,9 +198,9 @@ exact type of what parsing can produce next.
206198### Help and version cross checkpoints
207199
208200` --help ` and ` --version ` request methods; they do not settle an intent or bypass
209- parsing. Configliere cannot produce either intent until it knows the deepest
210- selected route. A dynamic phase may introduce that route, its options, or its
211- version.
201+ parsing. ` @bomb.sh/router ` cannot produce either intent until it knows the
202+ deepest selected route. A dynamic phase may introduce that route, its options,
203+ or its version.
212204
213205The driver must therefore resume every increment until parsing returns an
214206intent—even when the arguments contain ` --help ` or ` --version ` . This applies
@@ -246,7 +238,7 @@ import {
246238 schema ,
247239 type ValueSource ,
248240 version ,
249- } from " @frontside/configliere " ;
241+ } from " @bomb.sh/router " ;
250242import * as z from " zod" ;
251243
252244const app = command (
0 commit comments