@flowscripter/example-cli 1.0.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.
@@ -0,0 +1,9 @@
1
+ name: check-bun-dependencies
2
+ on:
3
+ workflow_dispatch:
4
+ schedule:
5
+ - cron: "0 0 * * *"
6
+ jobs:
7
+ call-check-bun-dependencies:
8
+ uses: flowscripter/.github/.github/workflows/check-bun-dependencies.yml@v1
9
+ secrets: inherit
@@ -0,0 +1,11 @@
1
+ name: lint-pr-message
2
+ on:
3
+ pull_request_target:
4
+ types:
5
+ - opened
6
+ - edited
7
+ - synchronize
8
+ jobs:
9
+ call-lint-pr-message:
10
+ uses: flowscripter/.github/.github/workflows/lint-pr-message.yml@v1
11
+ secrets: inherit
@@ -0,0 +1,10 @@
1
+ name: release-bun-executable
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ jobs:
6
+ call-release-bun-executable:
7
+ uses: flowscripter/.github/.github/workflows/release-bun-executable.yml@v1
8
+ secrets: inherit
9
+ with:
10
+ executable-name: "example-cli"
@@ -0,0 +1,8 @@
1
+ name: validate-bun-executable-pr
2
+ on:
3
+ pull_request:
4
+ branches: [main]
5
+ jobs:
6
+ call-validate-bun-executable-pr:
7
+ uses: flowscripter/.github/.github/workflows/validate-bun-executable-pr.yml@v1
8
+ secrets: inherit
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Flowscripter
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,101 @@
1
+ # example-cli
2
+
3
+ [![version](https://img.shields.io/github/v/release/flowscripter/example-cli?sort=semver)](https://github.com/flowscripter/example-cli/releases)
4
+ [![build](https://img.shields.io/github/actions/workflow/status/flowscripter/example-cli/release-bun-executable.yml)](https://github.com/flowscripter/example-cli/actions/workflows/release-bun-executable.yml)
5
+ [![coverage](https://codecov.io/gh/flowscripter/example-cli/branch/main/graph/badge.svg?token=EMFT2938ZF)](https://codecov.io/gh/flowscripter/example-cli)
6
+ [![docs](https://img.shields.io/badge/docs-API-blue)](https://flowscripter.github.io/example-cli/index.html)
7
+ [![license: MIT](https://img.shields.io/github/license/flowscripter/example-cli)](https://github.com/flowscripter/example-cli/blob/main/LICENSE)
8
+
9
+ > Simple example CLI using
10
+ > [dynamic-cli-framework](https://github.com/flowscripter/dynamic-cli-framework).
11
+
12
+ <img width="600" src="./demo.svg" alt="example-cli demo screen recording">
13
+
14
+ ## Binary Executable Usage
15
+
16
+ **NOTE**: The binaries are 10's of megabytes in size as the entire Bun runtime
17
+ is included.
18
+
19
+ #### MacOS
20
+
21
+ Via [Homebrew](https://brew.sh/):
22
+
23
+ `brew install flowscripter/tap/example-cli`
24
+
25
+ #### Linux
26
+
27
+ In a terminal:
28
+
29
+ `curl -fsSL https://raw.githubusercontent.com/flowscripter/example-cli/main/script/install.sh | sh`
30
+
31
+ #### Windows
32
+
33
+ In PowerShell:
34
+
35
+ `curl -fsSL https://raw.githubusercontent.com/flowscripter/example-cli/main/script/install.ps1 | powershell`
36
+
37
+ #### Manual Install
38
+
39
+ You can download and extract the binary zip files from the
40
+ [releases](https://github.com/flowscripter/example-cli/releases) page.
41
+
42
+ ## Functional Tests
43
+
44
+ Refer to [functional_tests/README.md](functional_tests/README.md)
45
+
46
+ ## Development
47
+
48
+ Install dependencies:
49
+
50
+ `bun install`
51
+
52
+ Test:
53
+
54
+ `bun test`
55
+
56
+ Run:
57
+
58
+ `bun run index.ts`
59
+
60
+ > During development this can be used to validate command definitions:
61
+ >
62
+ > `CLI_VALIDATE_ALL=1 bun run index.ts`
63
+
64
+ > During development this can be used to enable framework logging:
65
+ >
66
+ > `CLI_DEBUG=1 bun run index.ts`
67
+
68
+ Compile binary:
69
+
70
+ `bun build index.ts --compile --outfile /tmp/example-cli`
71
+
72
+ **NOTE**: The following tasks use Deno as it excels at these and Bun does not
73
+ currently provide such functionality:
74
+
75
+ Format:
76
+
77
+ `deno fmt`
78
+
79
+ Lint:
80
+
81
+ `deno lint index.ts src/ tests/`
82
+
83
+ Generate HTML API Documentation:
84
+
85
+ `deno doc --html --name=example-cli index.ts`
86
+
87
+ ## Documentation
88
+
89
+ Refer to the
90
+ [dynamic-cli-framework](https://github.com/flowscripter/dynamic-cli-framework)
91
+ documentation.
92
+
93
+ ### API
94
+
95
+ Link to auto-generated API docs:
96
+
97
+ [API Documentation](https://flowscripter.github.io/example-cli/index.html)
98
+
99
+ ## License
100
+
101
+ MIT © Flowscripter
package/bun.lock ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "lockfileVersion": 1,
3
+ "workspaces": {
4
+ "": {
5
+ "name": "@flowscripter/example-cli",
6
+ "dependencies": {
7
+ "@flowscripter/dynamic-cli-framework": "^1.0.3",
8
+ },
9
+ "devDependencies": {
10
+ "@types/bun": "^1.2.4",
11
+ },
12
+ "peerDependencies": {
13
+ "typescript": "^5.8.2",
14
+ },
15
+ },
16
+ },
17
+ "packages": {
18
+ "@flowscripter/dynamic-cli-framework": ["@flowscripter/dynamic-cli-framework@1.0.3", "", { "dependencies": { "emphasize": "^7.0.0", "fastest-levenshtein": "^1.0.16", "figlet": "^1.8.0", "highlight.js": "^11.11.1", "supports-color": "^10.0.0", "ts-log": "^2.2.7" }, "peerDependencies": { "typescript": "^5.8.2" } }, "sha512-VjQeGRRVVzOsm3d0G7chwkDblS0ec0HbO8AasQNwvy21XFmdigvQ+fVn6BLd7HboWMtp0MFXSxoslRgDGtiGsw=="],
19
+
20
+ "@types/bun": ["@types/bun@1.2.4", "", { "dependencies": { "bun-types": "1.2.4" } }, "sha512-QtuV5OMR8/rdKJs213iwXDpfVvnskPXY/S0ZiFbsTjQZycuqPbMW8Gf/XhLfwE5njW8sxI2WjISURXPlHypMFA=="],
21
+
22
+ "@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ=="],
23
+
24
+ "@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="],
25
+
26
+ "@types/unist": ["@types/unist@3.0.3", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],
27
+
28
+ "@types/ws": ["@types/ws@8.5.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw=="],
29
+
30
+ "bun-types": ["bun-types@1.2.4", "", { "dependencies": { "@types/node": "*", "@types/ws": "~8.5.10" } }, "sha512-nDPymR207ZZEoWD4AavvEaa/KZe/qlrbMSchqpQwovPZCKc7pwMoENjEtHgMKaAjJhy+x6vfqSBA1QU3bJgs0Q=="],
31
+
32
+ "chalk": ["chalk@5.4.1", "", {}, "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w=="],
33
+
34
+ "dequal": ["dequal@2.0.3", "", {}, "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="],
35
+
36
+ "devlop": ["devlop@1.1.0", "", { "dependencies": { "dequal": "^2.0.0" } }, "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA=="],
37
+
38
+ "emphasize": ["emphasize@7.0.0", "", { "dependencies": { "@types/hast": "^3.0.0", "chalk": "^5.0.0", "highlight.js": "~11.9.0", "lowlight": "~3.1.0" } }, "sha512-jdFCDyt+YetBXO12VwK4AiLsMCvkZ3IBxMVIJddB+25EwIL0VETBgpvPkJl63+JyAgaQ5Wja10qWMoXXC95JNg=="],
39
+
40
+ "fastest-levenshtein": ["fastest-levenshtein@1.0.16", "", {}, "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg=="],
41
+
42
+ "figlet": ["figlet@1.8.0", "", { "bin": { "figlet": "bin/index.js" } }, "sha512-chzvGjd+Sp7KUvPHZv6EXV5Ir3Q7kYNpCr4aHrRW79qFtTefmQZNny+W1pW9kf5zeE6dikku2W50W/wAH2xWgw=="],
43
+
44
+ "highlight.js": ["highlight.js@11.11.1", "", {}, "sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w=="],
45
+
46
+ "lowlight": ["lowlight@3.1.0", "", { "dependencies": { "@types/hast": "^3.0.0", "devlop": "^1.0.0", "highlight.js": "~11.9.0" } }, "sha512-CEbNVoSikAxwDMDPjXlqlFYiZLkDJHwyGu/MfOsJnF3d7f3tds5J3z8s/l9TMXhzfsJCCJEAsD78842mwmg0PQ=="],
47
+
48
+ "supports-color": ["supports-color@10.0.0", "", {}, "sha512-HRVVSbCCMbj7/kdWF9Q+bbckjBHLtHMEoJWlkmYzzdwhYMkjkOwubLM6t7NbWKjgKamGDrWL1++KrjUO1t9oAQ=="],
49
+
50
+ "ts-log": ["ts-log@2.2.7", "", {}, "sha512-320x5Ggei84AxzlXp91QkIGSw5wgaLT6GeAH0KsqDmRZdVWW2OiSeVvElVoatk3f7nicwXlElXsoFkARiGE2yg=="],
51
+
52
+ "typescript": ["typescript@5.8.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ=="],
53
+
54
+ "undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="],
55
+
56
+ "emphasize/highlight.js": ["highlight.js@11.9.0", "", {}, "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw=="],
57
+
58
+ "lowlight/highlight.js": ["highlight.js@11.9.0", "", {}, "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw=="],
59
+ }
60
+ }