Skip to content

Instantly share code, notes, and snippets.

@zachwill
Created May 2, 2025 15:34
Show Gist options
  • Save zachwill/00c5bc674a4e20203358f0572fc556b1 to your computer and use it in GitHub Desktop.
Save zachwill/00c5bc674a4e20203358f0572fc556b1 to your computer and use it in GitHub Desktop.
Windmill Bun shell script for Repomix
import { $ } from "bun";
export async function main(
github = "windmill-labs/windmill",
path = "**/*.rs"
) {
// Install repomix package globally
await $`bun install -g repomix`;
const random = Math.floor(1000 + Math.random() * 9000);
const OUTPUT = `./shared/repomix-${random}.txt`;
const include = path ?? "*";
// Repomix
await $`/root/.bun/bin/repomix --remote ${github} --style plain --include ${include} --top-files-len 80 --remove-empty-lines --no-file-summary -o ${OUTPUT}`;
// Read the Repomix output and return it
const output = await $`cat ${OUTPUT}`;
return output.stdout.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment