-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug-run.ts
More file actions
31 lines (25 loc) · 814 Bytes
/
debug-run.ts
File metadata and controls
31 lines (25 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bun
import { $ } from "bun";
console.log("Direct test of Claude command...");
const command = "claude";
const args = ["--print", "--dangerously-skip-permissions", "hello world in python"];
console.log("Command:", command);
console.log("Args:", args);
process.env.ANTHROPIC_MODEL = "claude-3-5-sonnet-20241022";
try {
const result = await $`${command} ${args}`.text();
console.log("✅ Success!");
console.log("Output:", result);
} catch (e: any) {
console.error("❌ Error occurred!");
console.error("Exit code:", e.exitCode);
console.error("Error message:", e.message);
console.error("Full error:", e);
// Try to get more info
if (e.stdout) {
console.error("Stdout:", e.stdout.toString());
}
if (e.stderr) {
console.error("Stderr:", e.stderr.toString());
}
}