write-script-bunnative

Create Bun Native TypeScript scripts for Windmill with a single async main function and fetch-only access.

17.5k|1.1k|Updated May 5, 2022
One-click install
npx skills add https://github.com/windmill-labs/windmill --skill write-script-bunnative
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-script-bunnative
Source: https://github.com/windmill-labs/windmill/tree/main/system_prompts/auto-generated/skills/write-script-bunnative
Command: npx skills add https://github.com/windmill-labs/windmill --skill write-script-bunnative

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Writing Bun Native TypeScript scripts for Windmill can be verbose and error-prone if you must manage runtime constraints manually. This skill standardizes how to create compact, deterministic Bun Native scripts that run inside Windmill with fetch-only network access and no external imports.

Core Features & Use Cases

  • Native TypeScript execution with Bun, limited to fetch for network requests and no external imports.
  • Enforces a single exported async function named main that forms the entry point for Windmill tasks.
  • Use Windmill resources via the RT namespace and integrate scripts into flows or standalone automation.

Quick Start

Place code in a Bun Native script under scripts/ (for example, scripts/main.ts) with an exported main function: export async function main(param1: string, param2: number) { // Your code here return { result: param1, count: param2 }; } Do not call the main function directly. Use Windmill to invoke the script and pass parameters as needed.

Frequently Asked Questions about write-script-bunnative

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

FAQPage Schema
How do I write TypeScript scripts with Bun that run in Windmill?

Export a single async main function in a Bun Native TypeScript script. Windmill executes the main function directly; use fetch for network calls and Windmill resources via the RT namespace. No external imports or dependencies are allowed.

Can I use external packages or libraries in Bun Native scripts?

No. Bun Native scripts in Windmill enforce no external imports. Use only built-in Bun functionality, fetch for HTTP requests, and Windmill resources to accomplish your automation tasks.

What parameters can I pass to a Bun Native script in Windmill?

Define parameters as function arguments in your exported main function signature. Windmill passes them when invoking the script; the function receives them as typed inputs matching your declared parameters.

How do I make HTTP requests in a Bun Native script?

Use the native fetch API, which is available in Bun. Fetch is the only supported method for network calls in Bun Native scripts, ensuring lightweight and predictable external communication.

Can I use Windmill resources in Bun Native TypeScript scripts?

Yes. Access Windmill resources through the RT namespace within your main function. Resources provide configured credentials and connections for integrations without hardcoding sensitive data.

What's the best way to structure a Bun Native script for Windmill flows?

Place scripts under scripts/ with a filename like main.ts. Export a single async main function with typed parameters and return values. Keep logic compact and deterministic, leveraging fetch for external calls and resources for authentication.