write-script-bun

Write and test Bun/TypeScript scripts for the Windmill platform.

Updated May 28, 2026
One-click install
npx skills add https://github.com/kma-core/windmill --skill write-script-bun-kma-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-script-bun
Source: https://github.com/kma-core/windmill/tree/main/system_prompts/auto-generated/skills/write-script-bun
Command: npx skills add https://github.com/kma-core/windmill --skill write-script-bun-kma-core

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires windmill-client.

What problem does it solve? Writing scripts for Windmill requires knowing the correct function structure, resource type conventions, and the right CLI commands for testing versus deploying. This Skill guides the AI to produce valid Bun/TypeScript scripts and choose the correct wmill CLI command for each intent. ## Core Features & Use Cases - Script Authoring: Produces Bun/TypeScript scripts with the required async main export, npm imports, and the RT namespace for resource types. - CLI Command Selection: Distinguishes between wmill script preview for local iteration, wmill script run for deployed scripts, and wmill sync push only for explicit deploys. - Platform Integration: Covers the windmill-client SDK for resources, variables, state, S3 file operations, flows, and approval workflows. - Use Case: Ask for a script that reads a CSV from S3 and inserts rows into PostgreSQL; the Skill produces the TypeScript code and offers to run wmill script preview with sample arguments. ## Quick Start Write a Windmill Bun script that fetches data from an API and stores the result, then preview it locally.

Frequently Asked Questions about write-script-bun

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a TypeScript script for Windmill?

Export a single async function named main whose parameters become the script's arguments. Libraries from npm are installed automatically, and you should not call the main function yourself since Windmill invokes it.

How do I test a Windmill script locally before deploying?

Use wmill script preview <script_path> to run the local file without deploying it to the workspace. Only use wmill sync push when you explicitly want to publish the changes, and wmill script run only for scripts already deployed.

How do I use credentials or resources in a Windmill Bun script?

Declare a parameter typed with the RT namespace, such as RT.Stripe, and Windmill passes the resource value at runtime. Check the rt.d.ts file generated by wmill resource-type generate-namespace for available resource types.

Can Windmill TypeScript scripts read and write S3 files?

Yes, the windmill-client SDK provides loadS3File, loadS3FileStream, and writeS3File functions that accept wmill.S3Object parameters. If no S3 resource path is given, the workspace default storage is used.

What is the difference between wmill script preview and script run?

script preview executes the local script file without deploying, making it the default for iterating on edits. script run executes the version already deployed in the workspace, so it ignores uncommitted local changes.