claude-code-reader 0.1.0-beta.4
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 +58 -0
- package/bin/ccr.js +38 -0
- package/package.json +43 -0
- package/scripts/postinstall.js +135 -0
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Claude Code Reader
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
A desktop application for viewing and managing Claude Code session records and settings.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g claude-code-reader
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
After installation, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ccr
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This will launch the Claude Code Reader desktop application.
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- View Claude Code session history
|
|
32
|
+
- Browse projects and conversations
|
|
33
|
+
- Edit session messages
|
|
34
|
+
- Manage environment variables
|
|
35
|
+
- Switch between environment profiles
|
|
36
|
+
- Theme support (light/dark/system)
|
|
37
|
+
|
|
38
|
+
## Requirements
|
|
39
|
+
|
|
40
|
+
- Node.js >= 16.0.0
|
|
41
|
+
- Windows, macOS, or Linux
|
|
42
|
+
|
|
43
|
+
## Manual Download
|
|
44
|
+
|
|
45
|
+
If automatic download fails, you can manually download the application from:
|
|
46
|
+
https://github.com/MoYeRanQianZhi/ClaudeCodeReader/releases
|
|
47
|
+
|
|
48
|
+
## Author
|
|
49
|
+
|
|
50
|
+
墨叶染千枝
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
MIT
|
|
55
|
+
|
|
56
|
+
## Repository
|
|
57
|
+
|
|
58
|
+
https://github.com/MoYeRanQianZhi/ClaudeCodeReader
|
package/bin/ccr.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from 'child_process';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { dirname, join } from 'path';
|
|
6
|
+
import { existsSync } from 'fs';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = dirname(__filename);
|
|
10
|
+
|
|
11
|
+
const platform = process.platform;
|
|
12
|
+
|
|
13
|
+
let binaryPath;
|
|
14
|
+
|
|
15
|
+
if (platform === 'win32') {
|
|
16
|
+
binaryPath = join(__dirname, 'ClaudeCodeReader.exe');
|
|
17
|
+
} else if (platform === 'darwin') {
|
|
18
|
+
binaryPath = join(__dirname, 'ClaudeCodeReader.app', 'Contents', 'MacOS', 'ClaudeCodeReader');
|
|
19
|
+
} else if (platform === 'linux') {
|
|
20
|
+
binaryPath = join(__dirname, 'ClaudeCodeReader.AppImage');
|
|
21
|
+
} else {
|
|
22
|
+
console.error(`Unsupported platform: ${platform}`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (!existsSync(binaryPath)) {
|
|
27
|
+
console.error('Claude Code Reader binary not found.');
|
|
28
|
+
console.error('Please run: npm run postinstall');
|
|
29
|
+
console.error('Or download manually from: https://github.com/MoYeRanQianZhi/ClaudeCodeReader/releases');
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
34
|
+
detached: true,
|
|
35
|
+
stdio: 'ignore'
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
child.unref();
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "claude-code-reader",
|
|
3
|
+
"version": "0.1.0-beta.4",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A desktop application for viewing and managing Claude Code session records and settings",
|
|
6
|
+
"author": "墨叶染千枝",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/MoYeRanQianZhi/ClaudeCodeReader.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/MoYeRanQianZhi/ClaudeCodeReader",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/MoYeRanQianZhi/ClaudeCodeReader/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"claude",
|
|
18
|
+
"claude-code",
|
|
19
|
+
"reader",
|
|
20
|
+
"viewer",
|
|
21
|
+
"session",
|
|
22
|
+
"tauri",
|
|
23
|
+
"desktop"
|
|
24
|
+
],
|
|
25
|
+
"bin": {
|
|
26
|
+
"ccr": "bin/ccr.js"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"postinstall": "node scripts/postinstall.js"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"bin",
|
|
33
|
+
"scripts"
|
|
34
|
+
],
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=16.0.0"
|
|
37
|
+
},
|
|
38
|
+
"os": [
|
|
39
|
+
"win32",
|
|
40
|
+
"darwin",
|
|
41
|
+
"linux"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { createWriteStream, existsSync, mkdirSync, chmodSync, unlinkSync } from 'fs';
|
|
4
|
+
import { get } from 'https';
|
|
5
|
+
import { join, dirname } from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = dirname(__filename);
|
|
10
|
+
|
|
11
|
+
const VERSION = '0.1.0-beta.4';
|
|
12
|
+
const GITHUB_REPO = 'MoYeRanQianZhi/ClaudeCodeReader';
|
|
13
|
+
const BASE_URL = `https://github.com/${GITHUB_REPO}/releases/download/v${VERSION}`;
|
|
14
|
+
|
|
15
|
+
const platform = process.platform;
|
|
16
|
+
const arch = process.arch;
|
|
17
|
+
|
|
18
|
+
function getDownloadInfo() {
|
|
19
|
+
if (platform === 'win32') {
|
|
20
|
+
return {
|
|
21
|
+
url: `${BASE_URL}/ClaudeCodeReader_${VERSION}_x64.exe`,
|
|
22
|
+
filename: 'ClaudeCodeReader.exe'
|
|
23
|
+
};
|
|
24
|
+
} else if (platform === 'darwin') {
|
|
25
|
+
const macArch = arch === 'arm64' ? 'aarch64-apple-darwin' : 'x86_64-apple-darwin';
|
|
26
|
+
return {
|
|
27
|
+
url: `${BASE_URL}/ClaudeCodeReader_${VERSION}_${macArch}.app.tar.gz`,
|
|
28
|
+
filename: `ClaudeCodeReader.app.tar.gz`,
|
|
29
|
+
extract: true
|
|
30
|
+
};
|
|
31
|
+
} else if (platform === 'linux') {
|
|
32
|
+
return {
|
|
33
|
+
url: `${BASE_URL}/ClaudeCodeReader_${VERSION}_amd64.AppImage`,
|
|
34
|
+
filename: 'ClaudeCodeReader.AppImage'
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function download(url, dest) {
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
const file = createWriteStream(dest);
|
|
43
|
+
|
|
44
|
+
const request = (url) => {
|
|
45
|
+
get(url, (response) => {
|
|
46
|
+
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
47
|
+
request(response.headers.location);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (response.statusCode !== 200) {
|
|
52
|
+
reject(new Error(`Download failed with status: ${response.statusCode}`));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const totalSize = parseInt(response.headers['content-length'], 10);
|
|
57
|
+
let downloadedSize = 0;
|
|
58
|
+
|
|
59
|
+
response.on('data', (chunk) => {
|
|
60
|
+
downloadedSize += chunk.length;
|
|
61
|
+
if (totalSize) {
|
|
62
|
+
const percent = ((downloadedSize / totalSize) * 100).toFixed(1);
|
|
63
|
+
process.stdout.write(`\rDownloading... ${percent}%`);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
response.pipe(file);
|
|
68
|
+
|
|
69
|
+
file.on('finish', () => {
|
|
70
|
+
file.close();
|
|
71
|
+
console.log('\nDownload complete!');
|
|
72
|
+
resolve();
|
|
73
|
+
});
|
|
74
|
+
}).on('error', (err) => {
|
|
75
|
+
unlinkSync(dest);
|
|
76
|
+
reject(err);
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
request(url);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async function main() {
|
|
85
|
+
const downloadInfo = getDownloadInfo();
|
|
86
|
+
|
|
87
|
+
if (!downloadInfo) {
|
|
88
|
+
console.error(`Unsupported platform: ${platform} ${arch}`);
|
|
89
|
+
console.error('Please download manually from: https://github.com/MoYeRanQianZhi/ClaudeCodeReader/releases');
|
|
90
|
+
process.exit(1);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const binDir = join(__dirname, '..', 'bin');
|
|
94
|
+
|
|
95
|
+
if (!existsSync(binDir)) {
|
|
96
|
+
mkdirSync(binDir, { recursive: true });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const destPath = join(binDir, downloadInfo.filename);
|
|
100
|
+
|
|
101
|
+
// Check if already downloaded
|
|
102
|
+
if (existsSync(destPath) || (platform === 'darwin' && existsSync(join(binDir, 'ClaudeCodeReader.app')))) {
|
|
103
|
+
console.log('Claude Code Reader is already installed.');
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
console.log(`Downloading Claude Code Reader for ${platform} ${arch}...`);
|
|
108
|
+
console.log(`URL: ${downloadInfo.url}`);
|
|
109
|
+
|
|
110
|
+
try {
|
|
111
|
+
await download(downloadInfo.url, destPath);
|
|
112
|
+
|
|
113
|
+
// Extract tar.gz on macOS
|
|
114
|
+
if (downloadInfo.extract && platform === 'darwin') {
|
|
115
|
+
const { execSync } = await import('child_process');
|
|
116
|
+
console.log('Extracting...');
|
|
117
|
+
execSync(`tar -xzf "${destPath}" -C "${binDir}"`);
|
|
118
|
+
unlinkSync(destPath);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Make executable on Unix systems
|
|
122
|
+
if (platform !== 'win32' && !downloadInfo.extract) {
|
|
123
|
+
chmodSync(destPath, 0o755);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
console.log('Claude Code Reader installed successfully!');
|
|
127
|
+
console.log('Run "ccr" to start the application.');
|
|
128
|
+
} catch (error) {
|
|
129
|
+
console.error('Failed to download Claude Code Reader:', error.message);
|
|
130
|
+
console.error('Please download manually from: https://github.com/MoYeRanQianZhi/ClaudeCodeReader/releases');
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
main();
|