You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package is a library for building CLI tools. Once you've defined your command, you can run it from the command line using Deno or Node.js. For example, save the script below as `mycli.ts` and execute it with `deno run mycli.ts [args]` or `node mycli.js [args]`.
44
43
45
-
const cli =newCommand()
46
-
.name('my-cli')
47
-
.description('Does something awesome')
48
-
.version('2.0.0')
49
-
.option('--dry-run', {
50
-
kind: 'flag',
51
-
shortFlag: '-n',
52
-
description: 'Don’t execute, just simulate',
53
-
})
44
+
Example command execution:
45
+
46
+
```bash
47
+
deno run mycli.ts input.txt --output output.txt
48
+
```
49
+
50
+
### API 🧩
51
+
52
+
Use the `Command` class to build and configure your CLI. Here's a basic example:
Copy file name to clipboardExpand all lines: jsr.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
{
2
2
"name": "@dep/command",
3
-
"version": "1.0.0",
4
-
"description": "A lightweight, type-safe CLI command builder for Deno, Node.js, and browsers.",
3
+
"version": "2.0.0",
4
+
"description": "A type-safe CLI command builder for Deno and Node.js, enabling easy creation of commands with arguments, options, subcommands, and handlers.",
0 commit comments