@pc360/chlog 0.1.8 → 0.1.9

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/CHANGELOG.md CHANGED
@@ -11,6 +11,12 @@ The format is based on Keep a Changelog, and this project follows Semantic Versi
11
11
  - Removed Ink card border lines so help and status output no longer render inside a box.
12
12
  - Added blank lines before and after help and error output to improve readability.
13
13
 
14
+ ## [0.1.9] - 2026-02-14
15
+
16
+ ### Changed
17
+
18
+ - Update docs with a global installation and add --version option
19
+
14
20
  ## [0.1.8] - 2026-02-14
15
21
 
16
22
  ### Changed
package/README.md CHANGED
@@ -17,16 +17,80 @@ Each entry file is automatically:
17
17
 
18
18
  ---
19
19
 
20
- ## 🚀 Usage
20
+ ## 📦 Install
21
+
22
+ ```bash
23
+ npm i -g @pc360/chlog
24
+ ```
25
+
26
+ ## ✅ After Installation
27
+
28
+ If `chlog` is not recognized after global install, add your npm global `bin` path to `PATH`.
29
+
30
+ 1. Get your npm prefix:
31
+
32
+ ```bash
33
+ npm get prefix
34
+ ```
35
+
36
+ 2. Use the output as `<prefix>`, then add this to your shell config:
37
+
38
+ ```bash
39
+ export PATH="$PATH:<prefix>/bin"
40
+ ```
41
+
42
+ For `zsh`, add it to `~/.zshrc`.
43
+ For `bash`, add it to `~/.bashrc`.
44
+
45
+ 3. Reload your shell config (or open a new terminal):
21
46
 
47
+ ```bash
48
+ source ~/.zshrc
49
+ # or
50
+ source ~/.bashrc
22
51
  ```
52
+
53
+ Then run:
54
+
55
+ ```bash
56
+ # Dry run (preview only)
57
+ chlog --type <added|changed|fixed|removed> \
58
+ --scope <scope> \
59
+ --message "<description>" \
60
+ [--frontend] \
61
+ --dry-run
62
+
63
+ # Dry run short form (preview only)
64
+ chlog -t <added|changed|fixed|removed> -s <scope> -m "<description>" [-f] -d
65
+
66
+ # Create entry
67
+ chlog --type <added|changed|fixed|removed> \
68
+ --scope <scope> \
69
+ --message "<description>" \
70
+ [--frontend]
71
+ ```
72
+
73
+ You can also run it without global install:
74
+
75
+ ```bash
23
76
  npx @pc360/chlog --type <added|changed|fixed|removed> \
24
- --scope <scope> \
25
- --message "<description>" \
26
- [--frontend]
77
+ --scope <scope> \
78
+ --message "<description>" \
79
+ [--frontend]
80
+ ```
81
+
82
+ ---
83
+
84
+ ## 🚀 Usage
85
+
86
+ ```bash
87
+ chlog --type <added|changed|fixed|removed> \
88
+ --scope <scope> \
89
+ --message "<description>" \
90
+ [--frontend]
27
91
 
28
92
  # Short form
29
- npx @pc360/chlog -t <added|changed|fixed|removed> -s <scope> -m "<description>" [-f]
93
+ chlog -t <added|changed|fixed|removed> -s <scope> -m "<description>" [-f]
30
94
  ```
31
95
 
32
96
  ---
@@ -41,6 +105,7 @@ npx @pc360/chlog -t <added|changed|fixed|removed> -s <scope> -m "<description>"
41
105
  | `-f, --frontend` | ❌ | Uses `[Front-End]` instead of `[Back-End]` |
42
106
  | `-d, --dry-run` | ❌ | Preview file creation without writing |
43
107
  | `-h, --help` | ❌ | Show help |
108
+ | `-v, --version` | ❌ | Show CLI version |
44
109
 
45
110
  ---
46
111
 
@@ -49,7 +114,7 @@ npx @pc360/chlog -t <added|changed|fixed|removed> -s <scope> -m "<description>"
49
114
  ### Back-End Change (Default)
50
115
 
51
116
  ```
52
- npx @pc360/chlog --type added --scope JES-33 --message "Add daily consolidated JE job"
117
+ chlog --type added --scope JES-33 --message "Add daily consolidated JE job"
53
118
  ```
54
119
 
55
120
  Creates:
@@ -69,7 +134,7 @@ File content:
69
134
  ### Front-End Change
70
135
 
71
136
  ```
72
- npx @pc360/chlog --type fixed --scope JES-45 --frontend --message "Fix table pagination issue"
137
+ chlog --type fixed --scope JES-45 --frontend --message "Fix table pagination issue"
73
138
  ```
74
139
 
75
140
  File content:
@@ -83,7 +148,7 @@ File content:
83
148
  ### Module-Based Scope
84
149
 
85
150
  ```
86
- npx @pc360/chlog --type changed --scope "Credit Validation" --message "Improve credit limit computation"
151
+ chlog --type changed --scope "Credit Validation" --message "Improve credit limit computation"
87
152
  ```
88
153
 
89
154
  File content:
@@ -153,7 +218,7 @@ Fix FR status blocking issue
153
218
  Preview without creating file:
154
219
 
155
220
  ```
156
- npx @pc360/chlog --type added --scope JES-99 --message "Test entry" --dry-run
221
+ chlog --type added --scope JES-99 --message "Test entry" --dry-run
157
222
  ```
158
223
 
159
224
  ---
package/bin/chlog.js CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  const fs = require("fs/promises");
5
5
  const path = require("path");
6
+ const { version } = require("../package.json");
6
7
 
7
8
  const {
8
9
  parseArgs,
@@ -39,6 +40,7 @@ Options:
39
40
  --tz "<iana>" Timezone (default: Asia/Manila)
40
41
  -d, --dry-run Preview only
41
42
  -h, --help Show help
43
+ -v, --version Show version
42
44
  `.trim();
43
45
  }
44
46
 
@@ -51,6 +53,11 @@ async function main() {
51
53
  process.exit(0);
52
54
  }
53
55
 
56
+ if (args.version) {
57
+ process.stdout.write(`${version}\n`);
58
+ process.exit(0);
59
+ }
60
+
54
61
  validateArgs(args);
55
62
 
56
63
  const timestamp = generateTimestamp(new Date(), args.tz);
package/lib/chlog-lib.js CHANGED
@@ -11,6 +11,7 @@ function parseArgs(argv) {
11
11
  frontend: false,
12
12
  dryRun: false,
13
13
  help: false,
14
+ version: false,
14
15
  };
15
16
 
16
17
  for (let i = 2; i < argv.length; i++) {
@@ -21,6 +22,11 @@ function parseArgs(argv) {
21
22
  break;
22
23
  }
23
24
 
25
+ if (arg === "-v" || arg === "--version") {
26
+ args.version = true;
27
+ break;
28
+ }
29
+
24
30
  if (arg === "--dry-run" || arg === "-d") {
25
31
  args.dryRun = true;
26
32
  continue;
package/lib/chlog-ui.js CHANGED
@@ -136,7 +136,7 @@ async function renderHelp(helpText) {
136
136
 
137
137
  const rendered = await renderInkCard(
138
138
  {
139
- title: "PC360 Changelog CLI - v0.1.8",
139
+ title: "PC360 Changelog CLI",
140
140
  subtitle: "Usage & options",
141
141
  lines: styledLines,
142
142
  tone: "info",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pc360/chlog",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "PC360 Changelog CLI Tool",
5
5
  "author": "aalmazan@pcdsi.ph",
6
6
  "bin": {