claude-code-log 0.8.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.
- package/README.md +42 -0
- package/bin/cli.js +80 -0
- package/package.json +29 -0
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# claude-code-log
|
|
2
|
+
|
|
3
|
+
Convert Claude Code transcript JSONL files to HTML with interactive TUI.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Open TUI (default)
|
|
9
|
+
npx claude-code-log
|
|
10
|
+
|
|
11
|
+
# Convert specific file
|
|
12
|
+
npx claude-code-log /path/to/transcript.jsonl
|
|
13
|
+
|
|
14
|
+
# Convert all projects
|
|
15
|
+
npx claude-code-log --all-projects
|
|
16
|
+
|
|
17
|
+
# Convert with date filter
|
|
18
|
+
npx claude-code-log --from-date "yesterday"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Requirements
|
|
22
|
+
|
|
23
|
+
Requires Python package runner (`uvx` or `pipx`):
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Install uv (recommended)
|
|
27
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
28
|
+
|
|
29
|
+
# Or install pipx
|
|
30
|
+
pip install pipx
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Features
|
|
34
|
+
|
|
35
|
+
- **Interactive TUI**: Browse sessions, view summaries, quick export
|
|
36
|
+
- **HTML Export**: Clean, readable HTML with syntax highlighting
|
|
37
|
+
- **Date Filtering**: Filter by date range using natural language
|
|
38
|
+
- **Token Tracking**: View token usage per session
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
MIT
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn, execSync } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const REPO_URL = 'git+https://github.com/leovu/claude-code-log.git';
|
|
7
|
+
const PACKAGE_NAME = 'claude-code-log';
|
|
8
|
+
|
|
9
|
+
// Check if a command exists
|
|
10
|
+
function commandExists(cmd) {
|
|
11
|
+
try {
|
|
12
|
+
execSync(`which ${cmd}`, { stdio: 'ignore' });
|
|
13
|
+
return true;
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Get args (skip node and script path)
|
|
20
|
+
const args = process.argv.slice(2);
|
|
21
|
+
|
|
22
|
+
// If no args, default to --tui
|
|
23
|
+
if (args.length === 0) {
|
|
24
|
+
args.push('--tui');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Try to run with uvx first (fastest)
|
|
28
|
+
if (commandExists('uvx')) {
|
|
29
|
+
const child = spawn('uvx', ['--from', REPO_URL, PACKAGE_NAME, ...args], {
|
|
30
|
+
stdio: 'inherit',
|
|
31
|
+
shell: true
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
child.on('close', (code) => {
|
|
35
|
+
process.exit(code);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
child.on('error', (err) => {
|
|
39
|
+
console.error('Error running uvx:', err.message);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
// Try pipx
|
|
44
|
+
else if (commandExists('pipx')) {
|
|
45
|
+
const child = spawn('pipx', ['run', '--spec', REPO_URL, PACKAGE_NAME, ...args], {
|
|
46
|
+
stdio: 'inherit',
|
|
47
|
+
shell: true
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
child.on('close', (code) => {
|
|
51
|
+
process.exit(code);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
child.on('error', (err) => {
|
|
55
|
+
console.error('Error running pipx:', err.message);
|
|
56
|
+
process.exit(1);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
// No Python runner found
|
|
60
|
+
else {
|
|
61
|
+
console.error(`
|
|
62
|
+
╔════════════════════════════════════════════════════════════════╗
|
|
63
|
+
║ Claude Code Log requires Python package runner (uvx or pipx) ║
|
|
64
|
+
╠════════════════════════════════════════════════════════════════╣
|
|
65
|
+
║ ║
|
|
66
|
+
║ Install one of the following: ║
|
|
67
|
+
║ ║
|
|
68
|
+
║ Option 1 - uv (recommended, fastest): ║
|
|
69
|
+
║ curl -LsSf https://astral.sh/uv/install.sh | sh ║
|
|
70
|
+
║ ║
|
|
71
|
+
║ Option 2 - pipx: ║
|
|
72
|
+
║ pip install pipx ║
|
|
73
|
+
║ ║
|
|
74
|
+
║ Then run again: ║
|
|
75
|
+
║ npx claude-code-log ║
|
|
76
|
+
║ ║
|
|
77
|
+
╚════════════════════════════════════════════════════════════════╝
|
|
78
|
+
`);
|
|
79
|
+
process.exit(1);
|
|
80
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "claude-code-log",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Convert Claude Code transcript JSONL files to HTML with interactive TUI",
|
|
5
|
+
"bin": {
|
|
6
|
+
"claude-code-log": "./bin/cli.js"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [
|
|
9
|
+
"claude",
|
|
10
|
+
"anthropic",
|
|
11
|
+
"transcript",
|
|
12
|
+
"jsonl",
|
|
13
|
+
"html",
|
|
14
|
+
"tui",
|
|
15
|
+
"cli"
|
|
16
|
+
],
|
|
17
|
+
"author": "Nhan Nguyen",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/leovu/claude-code-log.git"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=16"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"bin"
|
|
28
|
+
]
|
|
29
|
+
}
|