Skip to content

Instantly share code, notes, and snippets.

@intellectronica
Created November 17, 2025 10:25
Show Gist options
  • Select an option

  • Save intellectronica/b22b805ab82f37295f983a16ccd60483 to your computer and use it in GitHub Desktop.

Select an option

Save intellectronica/b22b805ab82f37295f983a16ccd60483 to your computer and use it in GitHub Desktop.
Script for running the Claude Agent SDK from within Windmill
import * as wmill from "windmill-client"
import { query } from '@anthropic-ai/claude-agent-sdk';
Bun.spawnSync(['bun', 'add', '-g', '@anthropic-ai/claude-code'], {
cwd: '/tmp',
env: { ...process.env, BUN_INSTALL: '/tmp/.bun' }
});
process.env.PATH = `/tmp/.bun/bin:${process.env.PATH}`;
process.env.ANTHROPIC_API_KEY = (await wmill.getResource('u/intellectronica/anthropic')).apiKey;
export async function main() {
const messages = [];
for await (const message of query({
prompt: "Hi There! You are running in Windmill. Awesome, right?",
options: { 'model': 'haiku' },
})) {
messages.push(message);
}
return { 'messages': messages };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment