juk-cli 0.0.0 → 0.1.1
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 +21 -0
- package/README.md +65 -0
- package/dist/index.mjs +25 -0
- package/package.json +37 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Sriman
|
|
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,65 @@
|
|
|
1
|
+
# juk-cli
|
|
2
|
+
|
|
3
|
+
A simple and lightweight command-line interface for the **js-utils-kit** ecosystem, providing useful utilities for environment checks and scripting workflows.
|
|
4
|
+
|
|
5
|
+
The CLI is designed to work well in local development, CI pipelines, and automation scripts.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
### Run without installing
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx juk-cli --help
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Install globally
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add -g juk-cli
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
juk-cli [options]
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Alias:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
juk [options]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
js-utils-kit [options]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
utils [options]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## API
|
|
42
|
+
|
|
43
|
+
### `--help`
|
|
44
|
+
|
|
45
|
+
Show the help message.
|
|
46
|
+
|
|
47
|
+
### `--version`
|
|
48
|
+
|
|
49
|
+
Show the CLI version.
|
|
50
|
+
|
|
51
|
+
### `--is-ci`
|
|
52
|
+
|
|
53
|
+
Detect whether the current process is running in a Continuous Integration (CI) environment.
|
|
54
|
+
|
|
55
|
+
The `--is-ci` flag is designed for scripting and automation.
|
|
56
|
+
|
|
57
|
+
- Exits with **`0`** if running in a CI environment
|
|
58
|
+
- Exits with **`1`** otherwise
|
|
59
|
+
- Produces **no output** (safe for shell usage)
|
|
60
|
+
|
|
61
|
+
Example:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
juk --is-ci && echo "Running in CI"
|
|
65
|
+
```
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*!
|
|
3
|
+
* JS Utils Kit CLI v0.1.1
|
|
4
|
+
* command line interface utilities
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 27-01-2026 Sriman
|
|
7
|
+
* Homepage: https://github.com/teneplaysofficial/js-utils-kit/tree/main/packages/juk-cli#readme
|
|
8
|
+
* Repository: https://github.com/teneplaysofficial/js-utils-kit
|
|
9
|
+
* License: MIT
|
|
10
|
+
*
|
|
11
|
+
* This software is provided "as-is", without any express or implied warranty.
|
|
12
|
+
*/
|
|
13
|
+
import e,{exit as t}from"node:process";import n from"node:path";import{isCI as r}from"@js-utils-kit/env";import i from"figlet";const a=[{flags:`-h, --help`,desc:`Show this help message`},{flags:`-v, --version`,desc:`Show CLI version`},{flags:`--is-ci`,desc:`Detects whether the command is running in a Continuous Integration (CI) environment and exits accordingly`}],o=[``,`-h`,`-v`,`--is-ci`],s=a.flatMap(e=>e.flags.split(`,`).map(e=>e.trim()));var c={name:`juk-cli`,displayName:`JS Utils Kit CLI`,version:`0.1.1`,description:`command line interface utilities`,private:!1,license:`MIT`,author:{name:`Sriman`,email:`136729116+TenEplaysOfficial@users.noreply.github.com`,url:`https://tene.vercel.app`},homepage:`https://github.com/teneplaysofficial/js-utils-kit/tree/main/packages/juk-cli#readme`,repository:{type:`git`,url:`https://github.com/teneplaysofficial/js-utils-kit`,directory:`packages/juk-cli`},bugs:{url:`https://github.com/teneplaysofficial/js-utils-kit/issues`},files:[`dist`],engines:{node:`>=22`},type:`module`,bin:{"juk-cli":`dist/index.mjs`,juk:`dist/index.mjs`,"js-utils-kit":`dist/index.mjs`,utils:`dist/index.mjs`},scripts:{build:`tsdown`},dependencies:{"@js-utils-kit/env":`workspace:*`,figlet:`catalog:`}};const l=Object.keys(c.bin??{}),u=n.basename(process.argv[1]??``),d=l.includes(u)?u:`juk`,f=Math.max(...a.map(e=>e.flags.length));function p(){console.log(`
|
|
14
|
+
Usage: ${d} [options]
|
|
15
|
+
|
|
16
|
+
Options:
|
|
17
|
+
${a.map(e=>` ${e.flags.padEnd(f)} ${e.desc}`).join(`
|
|
18
|
+
`)}
|
|
19
|
+
|
|
20
|
+
Examples:
|
|
21
|
+
${o.map(e=>` ${d} ${e}`).join(`
|
|
22
|
+
`)}
|
|
23
|
+
`)}function m(){try{let e=i.textSync(c.displayName||c.name,{font:`Slant`});if(!e){console.error(`Failed to generate ASCII banner`);return}let t=e.split(`
|
|
24
|
+
`),n=`v${c.version}`,r=t.findLastIndex(e=>e.trim().length>0);r!==-1&&(t[r]+=n),console.log(t.join(`
|
|
25
|
+
`))}catch(e){console.error(`Figlet error:`,e)}}const h=e.argv.slice(2),g=h.filter(e=>!s.includes(e));g.length&&(console.error(`Unknown flag(s): ${g.join(`, `)}\nRun 'juk-cli --help' for usage information.`),t(1));const _=new Set(h);(_.has(`-v`)||_.has(`--version`))&&(console.log(c.version),t(0)),(_.has(`-h`)||_.has(`--help`))&&(p(),t(0)),_.has(`--is-ci`)&&t(r?0:1),m(),p(),t(0);export{};
|
package/package.json
CHANGED
|
@@ -1,8 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "juk-cli",
|
|
3
|
-
"
|
|
3
|
+
"displayName": "JS Utils Kit CLI",
|
|
4
|
+
"version": "0.1.1",
|
|
5
|
+
"description": "command line interface utilities",
|
|
4
6
|
"private": false,
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sriman",
|
|
10
|
+
"email": "136729116+TenEplaysOfficial@users.noreply.github.com",
|
|
11
|
+
"url": "https://tene.vercel.app"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/teneplaysofficial/js-utils-kit/tree/main/packages/juk-cli#readme",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/teneplaysofficial/js-utils-kit",
|
|
17
|
+
"directory": "packages/juk-cli"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/teneplaysofficial/js-utils-kit/issues"
|
|
21
|
+
},
|
|
5
22
|
"files": [
|
|
6
23
|
"dist"
|
|
7
|
-
]
|
|
8
|
-
|
|
24
|
+
],
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=22"
|
|
27
|
+
},
|
|
28
|
+
"type": "module",
|
|
29
|
+
"bin": {
|
|
30
|
+
"juk-cli": "dist/index.mjs",
|
|
31
|
+
"juk": "dist/index.mjs",
|
|
32
|
+
"js-utils-kit": "dist/index.mjs",
|
|
33
|
+
"utils": "dist/index.mjs"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"figlet": "^1.10.0",
|
|
37
|
+
"@js-utils-kit/env": "1.3.0"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsdown"
|
|
41
|
+
}
|
|
42
|
+
}
|