@hkgdevx/logcoz 0.1.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 CHANGED
@@ -1,24 +1,24 @@
1
- This is free and unencumbered software released into the public domain.
2
-
3
- Anyone is free to copy, modify, publish, use, compile, sell, or
4
- distribute this software, either in source code form or as a compiled
5
- binary, for any purpose, commercial or non-commercial, and by any
6
- means.
7
-
8
- In jurisdictions that recognize copyright laws, the author or authors
9
- of this software dedicate any and all copyright interest in the
10
- software to the public domain. We make this dedication for the benefit
11
- of the public at large and to the detriment of our heirs and
12
- successors. We intend this dedication to be an overt act of
13
- relinquishment in perpetuity of all present and future rights to this
14
- software under copyright law.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
23
-
24
- For more information, please refer to <https://unlicense.org>
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <https://unlicense.org>
package/README.md CHANGED
@@ -64,16 +64,18 @@ After installation, use either:
64
64
 
65
65
  ## Quick Start
66
66
 
67
- Analyze a log file:
67
+ Analyze a realistic Redis connection failure:
68
68
 
69
- ```bash
70
- logcozcli explain ./app.log
69
+ ```text
70
+ 2026-03-19T10:10:00Z ERROR Error: connect ECONNREFUSED 127.0.0.1:6379
71
+ [ioredis] Unhandled error event
72
+ service=api requestId=redis-123
71
73
  ```
72
74
 
73
- Use the compatibility alias:
75
+ Run:
74
76
 
75
77
  ```bash
76
- logcoz explain ./app.log
78
+ logcozcli explain ./app.log
77
79
  ```
78
80
 
79
81
  Analyze with context and confidence reasoning:
@@ -82,10 +84,10 @@ Analyze with context and confidence reasoning:
82
84
  logcozcli explain ./app.log --context .env,docker-compose.yml,k8s.yaml --include-reasoning
83
85
  ```
84
86
 
85
- Enable mock LLM enhancement:
87
+ Emit structured JSON:
86
88
 
87
89
  ```bash
88
- logcozcli explain ./app.log --llm --llm-provider mock
90
+ logcozcli explain ./app.log --json
89
91
  ```
90
92
 
91
93
  Enable the OpenAI provider:
@@ -94,20 +96,8 @@ Enable the OpenAI provider:
94
96
  OPENAI_API_KEY=YOUR_API_KEY logcozcli explain ./app.log --llm --llm-provider openai --llm-model gpt-5-mini
95
97
  ```
96
98
 
97
- Emit structured JSON:
98
-
99
- ```bash
100
- logcozcli explain ./app.log --json
101
- ```
102
-
103
99
  Correlate multiple logs:
104
100
 
105
- ```bash
106
- logcozcli correlate ./api.log ./worker.log ./nginx.log
107
- ```
108
-
109
- Correlate as JSON:
110
-
111
101
  ```bash
112
102
  logcozcli correlate ./api.log ./worker.log ./nginx.log --json
113
103
  ```
@@ -191,11 +181,32 @@ OpenAI configuration:
191
181
 
192
182
  If the OpenAI provider is misconfigured or returns unusable output, LogCoz CLI falls back to the deterministic explanation and appends a warning instead of failing the command.
193
183
 
184
+ ## Troubleshooting
185
+
186
+ ### `OPENAI_API_KEY` is missing
187
+
188
+ If you select `--llm-provider openai` without a valid API key, the command still succeeds and returns the base explanation with a warning.
189
+
190
+ ### Provider fallback behavior
191
+
192
+ LLM providers are optional enhancements. The rule-based explanation path remains the default and fallback behavior.
193
+
194
+ ### Empty correlation results
195
+
196
+ `correlate --json` returns a success envelope with `count: 0` and an empty `incidents` array if no shared identifiers are found.
197
+
198
+ ### `logcozcli` vs `logcoz`
199
+
200
+ Both commands work. `logcozcli` is the primary documented binary, and `logcoz` is kept as a compatibility alias.
201
+
194
202
  ## Publishing
195
203
 
196
204
  The package is intended for public npm publishing.
197
205
 
198
- Release notes and versioning are managed with Changesets, and the primary release workflow publishes from GitHub Actions using an npm token secret.
206
+ Release notes and versioning are managed with Changesets, and the primary release workflow publishes from GitHub Actions using:
207
+
208
+ - `GITHUB_TOKEN`
209
+ - `NPM_TOKEN`
199
210
 
200
211
  Before the first public release, verify the target version is still free on npm:
201
212
 
@@ -205,6 +216,15 @@ npm view @hkgdevx/logcoz version --registry https://registry.npmjs.org
205
216
 
206
217
  At the time of this repo update, the public registry returned `404` for `@hkgdevx/logcoz`, so `0.1.0` is available unless something is published later.
207
218
 
219
+ Pre-publish smoke check:
220
+
221
+ ```bash
222
+ pnpm check
223
+ pnpm build
224
+ npm pack --dry-run
225
+ pnpm publish --dry-run --no-git-checks --access public --registry https://registry.npmjs.org
226
+ ```
227
+
208
228
  ## Cross-Platform Notes
209
229
 
210
230
  LogCoz CLI targets Node.js 20+ and supports Linux and Windows.
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import { Command } from "commander";
4
4
  // package.json
5
5
  var package_default = {
6
6
  name: "@hkgdevx/logcoz",
7
- version: "0.1.0",
7
+ version: "0.1.1",
8
8
  description: "LogCoz is an intelligent CLI for analyzing application and infrastructure logs. It extracts meaningful signals, detects common failure patterns, and provides root-cause explanations with actionable debugging steps \u2014 enhanced by optional context from your environment and configuration.",
9
9
  license: "MIT",
10
10
  author: {
@@ -31,6 +31,8 @@ var package_default = {
31
31
  scripts: {
32
32
  dev: "tsx src/cli.ts",
33
33
  build: "tsup",
34
+ prepack: "pnpm build",
35
+ "release:publish": "node ./scripts/release-publish.mjs",
34
36
  typecheck: "tsc --noEmit",
35
37
  lint: "eslint .",
36
38
  "lint:fix": "eslint . --fix",