codeam-cli 1.0.4 → 1.0.6
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/dist/index.js +75 -25
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -106,7 +106,61 @@ var { getConfig, ensurePluginId, addSession, removeSession, setActiveSession, ge
|
|
|
106
106
|
|
|
107
107
|
// src/ui/banner.ts
|
|
108
108
|
var import_picocolors = __toESM(require("picocolors"));
|
|
109
|
-
|
|
109
|
+
|
|
110
|
+
// package.json
|
|
111
|
+
var package_default = {
|
|
112
|
+
name: "codeam-cli",
|
|
113
|
+
version: "1.0.6",
|
|
114
|
+
description: "Remote control Claude Code from your mobile device",
|
|
115
|
+
main: "dist/index.js",
|
|
116
|
+
bin: {
|
|
117
|
+
codeam: "dist/index.js"
|
|
118
|
+
},
|
|
119
|
+
files: [
|
|
120
|
+
"dist",
|
|
121
|
+
"README.md"
|
|
122
|
+
],
|
|
123
|
+
scripts: {
|
|
124
|
+
build: "tsup",
|
|
125
|
+
dev: "tsup --watch",
|
|
126
|
+
test: "vitest run",
|
|
127
|
+
typecheck: "tsc --noEmit",
|
|
128
|
+
postinstall: "node dist/postinstall.js || true",
|
|
129
|
+
prepublishOnly: "npm run build"
|
|
130
|
+
},
|
|
131
|
+
keywords: [
|
|
132
|
+
"claude",
|
|
133
|
+
"claude-code",
|
|
134
|
+
"ai",
|
|
135
|
+
"cli",
|
|
136
|
+
"remote-control",
|
|
137
|
+
"codeagent"
|
|
138
|
+
],
|
|
139
|
+
author: "Edgar Durand",
|
|
140
|
+
repository: {
|
|
141
|
+
type: "git",
|
|
142
|
+
url: "git+https://github.com/edgardurand/codeagent-mobile.git"
|
|
143
|
+
},
|
|
144
|
+
license: "MIT",
|
|
145
|
+
engines: {
|
|
146
|
+
node: ">=18.0.0"
|
|
147
|
+
},
|
|
148
|
+
dependencies: {
|
|
149
|
+
"@clack/prompts": "^0.10.0",
|
|
150
|
+
picocolors: "^1.1.0",
|
|
151
|
+
ws: "^8.18.0"
|
|
152
|
+
},
|
|
153
|
+
devDependencies: {
|
|
154
|
+
"@types/node": "^22.0.0",
|
|
155
|
+
"@types/ws": "^8.5.0",
|
|
156
|
+
tsup: "^8.0.0",
|
|
157
|
+
typescript: "^5.0.0",
|
|
158
|
+
vitest: "^2.1.0"
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// src/ui/banner.ts
|
|
163
|
+
var VERSION = package_default.version;
|
|
110
164
|
function showIntro() {
|
|
111
165
|
console.log("");
|
|
112
166
|
console.log(` ${import_picocolors.default.bold(import_picocolors.default.cyan("codeam"))} ${import_picocolors.default.dim(`v${VERSION}`)}`);
|
|
@@ -454,7 +508,7 @@ var CommandRelayService = class {
|
|
|
454
508
|
};
|
|
455
509
|
|
|
456
510
|
// src/services/claude.service.ts
|
|
457
|
-
var
|
|
511
|
+
var import_child_process = require("child_process");
|
|
458
512
|
var fs2 = __toESM(require("fs"));
|
|
459
513
|
var path2 = __toESM(require("path"));
|
|
460
514
|
var ClaudeService = class {
|
|
@@ -477,55 +531,51 @@ var ClaudeService = class {
|
|
|
477
531
|
}
|
|
478
532
|
const claudeCmd = findInPath("claude") ? "claude" : "claude-code";
|
|
479
533
|
const shell = process.env.SHELL || "/bin/sh";
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
env: process.env
|
|
487
|
-
});
|
|
488
|
-
} catch (err) {
|
|
489
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
534
|
+
this.proc = (0, import_child_process.spawn)(shell, ["-c", `exec ${claudeCmd}`], {
|
|
535
|
+
stdio: ["pipe", "inherit", "inherit"],
|
|
536
|
+
cwd: this.opts.cwd,
|
|
537
|
+
env: process.env
|
|
538
|
+
});
|
|
539
|
+
this.proc.on("error", (err) => {
|
|
490
540
|
console.error(
|
|
491
541
|
`
|
|
492
|
-
\u2717 Failed to launch Claude Code: ${
|
|
542
|
+
\u2717 Failed to launch Claude Code: ${err.message}
|
|
493
543
|
Make sure claude is correctly installed: npm install -g @anthropic-ai/claude-code
|
|
494
|
-
If the issue persists, try: npm rebuild node-pty
|
|
495
544
|
`
|
|
496
545
|
);
|
|
497
546
|
process.exit(1);
|
|
498
|
-
}
|
|
499
|
-
this.proc.onData((data) => {
|
|
500
|
-
process.stdout.write(data);
|
|
501
|
-
this.opts.onData?.(data);
|
|
502
547
|
});
|
|
503
548
|
if (process.stdin.isTTY) process.stdin.setRawMode(true);
|
|
504
549
|
process.stdin.resume();
|
|
505
550
|
process.stdin.on("data", this.stdinHandler);
|
|
506
551
|
process.on("SIGWINCH", this.handleResize);
|
|
507
|
-
this.proc.
|
|
552
|
+
this.proc.on("exit", (code) => {
|
|
508
553
|
this.cleanup();
|
|
509
|
-
this.opts.onExit(
|
|
554
|
+
this.opts.onExit(code ?? 0);
|
|
510
555
|
});
|
|
511
556
|
}
|
|
512
|
-
/** Send a command to Claude's stdin (remote control) */
|
|
557
|
+
/** Send a command to Claude's stdin (remote control from mobile) */
|
|
513
558
|
sendCommand(text) {
|
|
514
|
-
this.proc?.write(text + "\r");
|
|
559
|
+
this.proc?.stdin?.write(text + "\r");
|
|
515
560
|
}
|
|
516
561
|
/** Send Ctrl+C to Claude */
|
|
517
562
|
interrupt() {
|
|
518
|
-
this.proc?.write("");
|
|
563
|
+
this.proc?.stdin?.write("");
|
|
519
564
|
}
|
|
520
565
|
kill() {
|
|
521
566
|
this.proc?.kill();
|
|
522
567
|
this.cleanup();
|
|
523
568
|
}
|
|
524
569
|
stdinHandler = (chunk) => {
|
|
525
|
-
this.proc?.write(chunk
|
|
570
|
+
this.proc?.stdin?.write(chunk);
|
|
526
571
|
};
|
|
527
572
|
handleResize = () => {
|
|
528
|
-
this.proc?.
|
|
573
|
+
if (this.proc?.pid) {
|
|
574
|
+
try {
|
|
575
|
+
process.kill(this.proc.pid, "SIGWINCH");
|
|
576
|
+
} catch {
|
|
577
|
+
}
|
|
578
|
+
}
|
|
529
579
|
};
|
|
530
580
|
cleanup() {
|
|
531
581
|
process.removeListener("SIGWINCH", this.handleResize);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeam-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Remote control Claude Code from your mobile device",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@clack/prompts": "^0.10.0",
|
|
40
|
-
"node-pty": "^1.0.0",
|
|
41
40
|
"picocolors": "^1.1.0",
|
|
42
41
|
"ws": "^8.18.0"
|
|
43
42
|
},
|