@reliverse/rempts 1.7.50 → 1.7.52
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 +1 -1
- package/README.md +1 -52
- package/dist-npm/bin/mod.d.mts +62 -607
- package/dist-npm/bin/mod.mjs +629 -2071
- package/package.json +3 -41
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) Nazar Kornienko (blefnk), Bleverse, Reliverse
|
|
3
|
+
Copyright (c) 2025 Nazar Kornienko (blefnk), Bleverse, Reliverse
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
- 🏞️ no more hacking together `inquirer`/`citty`/`commander`/`chalk`
|
|
29
29
|
- 🆕 automatic command creation (`bun dler rempts --init cmd1 cmd2`)
|
|
30
30
|
- 🐦🔥 automatic creation of `src/app/cmds.ts` file (`bun dler rempts`)
|
|
31
|
-
- 🔌 tRPC/ORPC router integration - automatically generate CLI commands from your RPC procedures
|
|
32
31
|
|
|
33
32
|
## Installation
|
|
34
33
|
|
|
@@ -367,48 +366,6 @@ See [example/launcher/app/nested](./example/launcher/app/nested/) and [example/l
|
|
|
367
366
|
|
|
368
367
|
When playing with the example, you can run e.g. `bun dev:modern nested foo bar baz` to see the result in action.
|
|
369
368
|
|
|
370
|
-
## RPC Integration
|
|
371
|
-
|
|
372
|
-
Rempts now supports seamless integration with tRPC and ORPC routers, allowing you to automatically generate CLI commands from your RPC procedures. This provides a powerful way to expose your API endpoints as command-line tools.
|
|
373
|
-
|
|
374
|
-
```typescript
|
|
375
|
-
import { z } from "zod";
|
|
376
|
-
import { initTRPC } from "@trpc/server";
|
|
377
|
-
import { createCli } from "@reliverse/rempts";
|
|
378
|
-
|
|
379
|
-
const t = initTRPC.create();
|
|
380
|
-
|
|
381
|
-
const appRouter = t.router({
|
|
382
|
-
hello: t.procedure
|
|
383
|
-
.input(z.object({ name: z.string().optional() }))
|
|
384
|
-
.query(({ input }) => `Hello ${input.name ?? "World"}!`),
|
|
385
|
-
|
|
386
|
-
add: t.procedure
|
|
387
|
-
.input(z.object({ a: z.number(), b: z.number() }))
|
|
388
|
-
.mutation(({ input }) => input.a + input.b)
|
|
389
|
-
});
|
|
390
|
-
|
|
391
|
-
// Automatically generates CLI commands from your tRPC procedures
|
|
392
|
-
await createCli({
|
|
393
|
-
name: "my-cli",
|
|
394
|
-
rpc: { router: appRouter }
|
|
395
|
-
});
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
**Features:**
|
|
399
|
-
|
|
400
|
-
- 🚀 Automatic CLI generation from tRPC procedures
|
|
401
|
-
- 🔄 Support for both tRPC v10 and v11
|
|
402
|
-
- 🏗️ Nested command structures from sub-routers
|
|
403
|
-
- ✅ Input validation from Zod schemas
|
|
404
|
-
- 📖 Automatic help generation from procedure metadata
|
|
405
|
-
- 🎯 Full TypeScript support with type inference
|
|
406
|
-
- 🎨 Interactive prompts for missing arguments
|
|
407
|
-
- ⌨️ Shell completion support
|
|
408
|
-
- 🔧 Customizable logging and error handling
|
|
409
|
-
|
|
410
|
-
See [RPC Integration Guide](./docs/launcher-rpc.md) for detailed documentation and examples.
|
|
411
|
-
|
|
412
369
|
### Playground
|
|
413
370
|
|
|
414
371
|
```bash
|
|
@@ -422,12 +379,6 @@ bun dev
|
|
|
422
379
|
- `bun dev:modern`: This example will show you a modern CLI launcher usage with file-based commands.
|
|
423
380
|
- `bun dev:classic`: This example will show you a classic CLI launcher usage with programmatic commands.
|
|
424
381
|
|
|
425
|
-
### tRPC/oRPC Integration Example Commands
|
|
426
|
-
|
|
427
|
-
```bash
|
|
428
|
-
bun example/trpc-orpc/rempts/effect-primary.ts create-profile --name 'Jane Smith' --age 28 --bio 'Software Engineer' --tags 'developer,typescript'
|
|
429
|
-
```
|
|
430
|
-
|
|
431
382
|
### Launcher Usage Examples
|
|
432
383
|
|
|
433
384
|
#### Minimal Usage Example
|
|
@@ -1458,9 +1409,7 @@ All APIs are fully typed. See [`src/types.ts`](./src/types.ts) for advanced cust
|
|
|
1458
1409
|
|
|
1459
1410
|
## Related
|
|
1460
1411
|
|
|
1461
|
-
- [`@reliverse/
|
|
1462
|
-
- [`@reliverse/reliarg`](https://npmjs.com/package/@reliverse/reliarg) – Tiny, strict, zero-dep argument parser with value validation support (`allowed` property for restricting argument values)
|
|
1463
|
-
- [`@reliverse/reglob`](https://npmjs.com/package/@reliverse/reglob) – Fast, minimal file matcher
|
|
1412
|
+
- [`@reliverse/rse`](https://npmjs.com/package/@reliverse/rse) – CLI-first toolkit for fullstack workflows
|
|
1464
1413
|
- [`@reliverse/relinka`](https://npmjs.com/package/@reliverse/relinka) – Styled CLI logs, steps, and symbols
|
|
1465
1414
|
|
|
1466
1415
|
## Shoutouts
|