write-script-bunnative_skill

This skill helps you author Bun Native TypeScript scripts with built-in fetch usage and resource parameters for Windmill automation.
  • HTML

15.8k

GitHub Stars

1

Bundled Files

3 weeks ago

Catalog Refreshed

2 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstart where the catalogue uses aiagentskills.

npx veilstart add skill windmill-labs/windmill --skill write-script-bunnative

  • SKILL.md20.4 KB

Overview

This skill teaches how to write and deploy Bun Native TypeScript scripts for the Windmill platform. It focuses on the required file structure, runtime constraints (no imports, global fetch), and how to access Windmill resources and S3 storage. Follow the conventions to make scripts compatible with the platform and deploy them with the CLI. The guidance highlights preprocessor usage and the windmill-client SDK when not in native TypeScript mode.

How this skill works

It inspects and explains the required script shape: export a single async function named main (or preprocessor for event transforms) and never call it directly. It enforces runtime constraints for Bun Native: no imports, only the global fetch is available, and Windmill client helpers are unavailable. It also documents how resources are passed into main via the RT namespace and how to interact with S3 objects using the platform SDK when using the full TypeScript SDK mode.

When to use it

  • When writing Bun Native TypeScript scripts that run inside Windmill.
  • When you must avoid external imports and rely only on fetch and platform-provided globals.
  • When you need to accept configured resources (API keys, DB info) as parameters via RT.* types.
  • When building preprocessor scripts to map external events into script inputs.
  • When reading or writing files in S3-compatible storage via provided helpers (in non-native SDK mode).

Best practices

  • Export a single async function called main; use preprocessor(event) only for preprocessor scripts.
  • Use RT namespace types for resources; pass only the resources your script actually needs.
  • Do not import any modules in Bun Native mode—use global fetch for HTTP calls.
  • Keep functions pure and return plain serializable objects from main.
  • After writing scripts, run wmill script generate-metadata and wmill sync push to deploy.
  • Use wmill resource-type list --schema to discover available resource types before coding.

Example use cases

  • Fetch remote JSON APIs from within a lightweight Bun Native script using fetch and return processed data.
  • Define a preprocessor to convert incoming webhooks into typed parameters for downstream scripts.
  • Accept an RT.Stripe resource to charge a card using the resource credentials passed to main.
  • Load a file from S3, transform its contents, and write back a processed version using the SDK helpers when using the TypeScript client.
  • Schedule or trigger scripts via Windmill flows and use the SDK to run other scripts or flows when full client access is available.

FAQ

No. Bun Native TypeScript execution prohibits imports. Use the global fetch and platform-provided inputs instead.

How do I access secrets or API keys?

Create resources in Windmill and declare them as parameters to main using the RT namespace (for example RT.Stripe). The platform injects credentials at runtime.

When should I use preprocessor instead of main?

Use preprocessor(event) when you need to transform incoming webhooks, HTTP requests, or other event payloads into the parameter shape your main script expects.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational