Slide 7
Slide 7 text
@anthropic-ai/claude-code/sdk.mjs
function query({
prompt,
options: {
// ...
executable = isRunningWithBun() ? "bun" : "node",
// ...
pathToClaudeCodeExecutable = join(__dirname2, "cli.js"), // ← claude
コマンドの実体
} = {},
}) {
// ...
const child = spawn(
executable,
[...executableArgs, pathToClaudeCodeExecutable, ...args],
{
/* spawn options */
},
);
}
TypeScript SDKの内部実装
CLIをサブプロセスとして実行している
7