@diggerhq/catty 0.5.3 → 0.5.5
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 +15 -0
- package/bin/catty +1 -16
- package/package.json +4 -3
- package/scripts/install.js +85 -0
- package/bin/.gitkeep +0 -0
- package/bin/catty-darwin-amd64 +0 -0
- package/bin/catty-darwin-arm64 +0 -0
- package/bin/catty-linux-amd64 +0 -0
- package/bin/catty-linux-arm64 +0 -0
package/README.md
CHANGED
|
@@ -42,6 +42,21 @@ catty config set server <url>
|
|
|
42
42
|
catty logout
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
## Configuration
|
|
46
|
+
|
|
47
|
+
### Environment Variables
|
|
48
|
+
|
|
49
|
+
| Variable | Description | Default |
|
|
50
|
+
|----------|-------------|---------|
|
|
51
|
+
| `CATTY_API_URL` | Override the API server URL | `https://catty.dev` |
|
|
52
|
+
|
|
53
|
+
Example for self-hosted instances:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
export CATTY_API_URL=https://your-catty-server.com
|
|
57
|
+
catty login
|
|
58
|
+
```
|
|
59
|
+
|
|
45
60
|
## Requirements
|
|
46
61
|
|
|
47
62
|
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) must be installed on your system
|
package/bin/catty
CHANGED
|
@@ -2,23 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const { execFileSync } = require('child_process');
|
|
4
4
|
const path = require('path');
|
|
5
|
-
const os = require('os');
|
|
6
5
|
|
|
7
|
-
const
|
|
8
|
-
const arch = os.arch();
|
|
9
|
-
|
|
10
|
-
const platformMap = { darwin: 'darwin', linux: 'linux' };
|
|
11
|
-
const archMap = { x64: 'amd64', arm64: 'arm64' };
|
|
12
|
-
|
|
13
|
-
const goPlatform = platformMap[platform];
|
|
14
|
-
const goArch = archMap[arch];
|
|
15
|
-
|
|
16
|
-
if (!goPlatform || !goArch) {
|
|
17
|
-
console.error(`Unsupported platform: ${platform}/${arch}`);
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const binary = path.join(__dirname, `catty-${goPlatform}-${goArch}`);
|
|
6
|
+
const binary = path.join(__dirname, 'catty-binary');
|
|
22
7
|
|
|
23
8
|
try {
|
|
24
9
|
execFileSync(binary, process.argv.slice(2), { stdio: 'inherit' });
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diggerhq/catty",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "A Claude Code wrapper with centralized streaming for cross-device access",
|
|
5
5
|
"bin": {
|
|
6
6
|
"catty": "./bin/catty"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
+
"postinstall": "node scripts/install.js",
|
|
9
10
|
"build": "bash scripts/build.sh"
|
|
10
11
|
},
|
|
11
12
|
"keywords": [
|
|
@@ -30,8 +31,8 @@
|
|
|
30
31
|
"arm64"
|
|
31
32
|
],
|
|
32
33
|
"files": [
|
|
33
|
-
"bin/",
|
|
34
|
+
"bin/catty",
|
|
35
|
+
"scripts/install.js",
|
|
34
36
|
"README.md"
|
|
35
37
|
]
|
|
36
38
|
}
|
|
37
|
-
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const https = require('https');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
const { execSync } = require('child_process');
|
|
8
|
+
|
|
9
|
+
const REPO = 'diggerhq/catty-releases';
|
|
10
|
+
const packageJson = require('../package.json');
|
|
11
|
+
const VERSION = packageJson.version;
|
|
12
|
+
|
|
13
|
+
const platformMap = { darwin: 'darwin', linux: 'linux' };
|
|
14
|
+
const archMap = { x64: 'amd64', arm64: 'arm64' };
|
|
15
|
+
|
|
16
|
+
const platform = platformMap[os.platform()];
|
|
17
|
+
const arch = archMap[os.arch()];
|
|
18
|
+
|
|
19
|
+
if (!platform || !arch) {
|
|
20
|
+
console.error(`Unsupported platform: ${os.platform()}/${os.arch()}`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const binaryName = `catty-${platform}-${arch}`;
|
|
25
|
+
const binDir = path.join(__dirname, '..', 'bin');
|
|
26
|
+
const targetPath = path.join(binDir, 'catty-binary');
|
|
27
|
+
|
|
28
|
+
// Ensure bin directory exists
|
|
29
|
+
if (!fs.existsSync(binDir)) {
|
|
30
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Download URL
|
|
34
|
+
const downloadUrl = `https://github.com/${REPO}/releases/download/v${VERSION}/${binaryName}`;
|
|
35
|
+
|
|
36
|
+
console.log(`Downloading catty v${VERSION} for ${platform}/${arch}...`);
|
|
37
|
+
|
|
38
|
+
function download(url, dest) {
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
const file = fs.createWriteStream(dest);
|
|
41
|
+
|
|
42
|
+
https.get(url, (response) => {
|
|
43
|
+
// Handle redirects (GitHub releases use redirects)
|
|
44
|
+
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
45
|
+
file.close();
|
|
46
|
+
fs.unlinkSync(dest);
|
|
47
|
+
return download(response.headers.location, dest).then(resolve).catch(reject);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (response.statusCode !== 200) {
|
|
51
|
+
file.close();
|
|
52
|
+
fs.unlinkSync(dest);
|
|
53
|
+
reject(new Error(`Failed to download: ${response.statusCode} ${response.statusMessage}`));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
response.pipe(file);
|
|
58
|
+
file.on('finish', () => {
|
|
59
|
+
file.close();
|
|
60
|
+
resolve();
|
|
61
|
+
});
|
|
62
|
+
}).on('error', (err) => {
|
|
63
|
+
file.close();
|
|
64
|
+
fs.unlinkSync(dest);
|
|
65
|
+
reject(err);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function main() {
|
|
71
|
+
try {
|
|
72
|
+
await download(downloadUrl, targetPath);
|
|
73
|
+
|
|
74
|
+
// Make executable
|
|
75
|
+
fs.chmodSync(targetPath, 0o755);
|
|
76
|
+
|
|
77
|
+
console.log(`✓ Installed catty v${VERSION} for ${platform}/${arch}`);
|
|
78
|
+
} catch (err) {
|
|
79
|
+
console.error(`Failed to install catty: ${err.message}`);
|
|
80
|
+
console.error(`URL: ${downloadUrl}`);
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
main();
|
package/bin/.gitkeep
DELETED
|
File without changes
|
package/bin/catty-darwin-amd64
DELETED
|
Binary file
|
package/bin/catty-darwin-arm64
DELETED
|
Binary file
|
package/bin/catty-linux-amd64
DELETED
|
Binary file
|
package/bin/catty-linux-arm64
DELETED
|
Binary file
|