resources

GitHub

管理Windmill外部服务凭证和配置的资源文件,支持JSON格式及变量引用。涵盖数据库、消息队列等常见类型定义与结构规范。

system_prompts/auto-generated/skills/resources/SKILL.md windmill-labs/windmill

Trigger Scenarios

需要配置外部服务连接信息 管理应用凭据或环境变量

Install

npx skills add windmill-labs/windmill --skill resources -g -y
More Options

Non-standard path

npx skills add https://github.com/windmill-labs/windmill/tree/main/system_prompts/auto-generated/skills/resources -g -y

Use without installing

npx skills use windmill-labs/windmill@resources

指定 Agent (Claude Code)

npx skills add windmill-labs/windmill --skill resources -a claude-code -g -y

安装 repo 全部 skill

npx skills add windmill-labs/windmill --all -g -y

预览 repo 内 skill

npx skills add windmill-labs/windmill --list

SKILL.md

Frontmatter
{
    "name": "resources",
    "description": "MUST use when managing resources."
}

Windmill Resources

Resources store credentials and configuration for external services.

File Format

Resource files use the pattern: {path}.resource.json

Example: f/databases/postgres_prod.resource.json

Resource Structure

{
  "value": {
    "host": "db.example.com",
    "port": 5432,
    "user": "admin",
    "password": "$var:g/all/db_password",
    "dbname": "production"
  },
  "description": "Production PostgreSQL database",
  "resource_type": "postgresql"
}

Required Fields

  • value - Object containing the resource configuration
  • resource_type - Name of the resource type (e.g., "postgresql", "slack")

Variable References

Reference variables in resource values:

{
  "value": {
    "api_key": "$var:g/all/api_key",
    "secret": "$var:u/admin/secret"
  }
}

Reference formats:

  • $var:g/all/name - Global variable
  • $var:u/username/name - User variable
  • $var:f/folder/name - Folder variable

Resource References

Reference other resources:

{
  "value": {
    "database": "$res:f/databases/postgres"
  }
}

Common Resource Types

PostgreSQL

{
  "resource_type": "postgresql",
  "value": {
    "host": "localhost",
    "port": 5432,
    "user": "postgres",
    "password": "$var:g/all/pg_password",
    "dbname": "windmill",
    "sslmode": "prefer"
  }
}

MySQL

{
  "resource_type": "mysql",
  "value": {
    "host": "localhost",
    "port": 3306,
    "user": "root",
    "password": "$var:g/all/mysql_password",
    "database": "myapp"
  }
}

Slack

{
  "resource_type": "slack",
  "value": {
    "token": "$var:g/all/slack_token"
  }
}

AWS S3

{
  "resource_type": "s3",
  "value": {
    "bucket": "my-bucket",
    "region": "us-east-1",
    "accessKeyId": "$var:g/all/aws_access_key",
    "secretAccessKey": "$var:g/all/aws_secret_key"
  }
}

HTTP/API

{
  "resource_type": "http",
  "value": {
    "baseUrl": "https://api.example.com",
    "headers": {
      "Authorization": "Bearer $var:g/all/api_token"
    }
  }
}

Kafka

{
  "resource_type": "kafka",
  "value": {
    "brokers": "broker1:9092,broker2:9092",
    "sasl_mechanism": "PLAIN",
    "security_protocol": "SASL_SSL",
    "username": "$var:g/all/kafka_user",
    "password": "$var:g/all/kafka_password"
  }
}

NATS

{
  "resource_type": "nats",
  "value": {
    "servers": ["nats://localhost:4222"],
    "user": "$var:g/all/nats_user",
    "password": "$var:g/all/nats_password"
  }
}

MQTT

{
  "resource_type": "mqtt",
  "value": {
    "host": "mqtt.example.com",
    "port": 8883,
    "username": "$var:g/all/mqtt_user",
    "password": "$var:g/all/mqtt_password",
    "tls": true
  }
}

Custom Resource Types

Create custom resource types with JSON Schema:

{
  "name": "custom_api",
  "schema": {
    "type": "object",
    "properties": {
      "base_url": {"type": "string", "format": "uri"},
      "api_key": {"type": "string"},
      "timeout": {"type": "integer", "default": 30}
    },
    "required": ["base_url", "api_key"]
  },
  "description": "Custom API connection"
}

Save as: custom_api.resource-type.json

OAuth Resources

OAuth resources are managed through the Windmill UI and marked:

{
  "is_oauth": true,
  "account": 123
}

OAuth tokens are automatically refreshed by Windmill.

Using Resources in Scripts

TypeScript (Bun/Deno)

export async function main(db: RT.Postgresql) {
  // db contains the resource values
  const { host, port, user, password, dbname } = db;
}

Python

class postgresql(TypedDict):
    host: str
    port: int
    user: str
    password: str
    dbname: str

def main(db: postgresql):
    # db contains the resource values
    pass

CLI Commands

# List resources
wmill resource list

# List resource types with schemas
wmill resource-type list --schema

# Get specific resource type schema
wmill resource-type get postgresql

# Deploy resources to the workspace — destructive to remote state, so only run when
# the user explicitly asks to deploy/publish/push. Depending on how the repo is wired,
# deploy via `git push` or `wmill sync push` (see the Deploying section in AGENTS.wmill.md).
wmill sync push

Version History

  • 574775d Current 2026-08-20 17:33

Same Skill Collection

.agents/skills/adding-a-trigger/SKILL.md
.agents/skills/ai-chat/SKILL.md
.agents/skills/ai-evals/SKILL.md
.agents/skills/codebase-design/SKILL.md
.agents/skills/commit/SKILL.md
.agents/skills/domain-modeling/SKILL.md
.agents/skills/grilling/SKILL.md
.agents/skills/improve-codebase-architecture/SKILL.md
.agents/skills/local-review-codex/SKILL.md
.agents/skills/local-review/SKILL.md
.agents/skills/native-trigger/SKILL.md
.agents/skills/pr/SKILL.md
.agents/skills/refine/SKILL.md
.agents/skills/rust-backend/SKILL.md
.agents/skills/svelte-frontend/SKILL.md
.agents/skills/update-sqlx/SKILL.md
.claude/skills/adding-a-trigger/SKILL.md
.claude/skills/ai-chat/SKILL.md
.claude/skills/ai-evals/SKILL.md
.claude/skills/codebase-design/SKILL.md
.claude/skills/commit/SKILL.md
.claude/skills/domain-modeling/SKILL.md
.claude/skills/grilling/SKILL.md
.claude/skills/improve-codebase-architecture/SKILL.md
.claude/skills/local-review-codex/SKILL.md
.claude/skills/local-review/SKILL.md
.claude/skills/native-trigger/SKILL.md
.claude/skills/pr/SKILL.md
.claude/skills/refine/SKILL.md
.claude/skills/rust-backend/SKILL.md
.claude/skills/svelte-frontend/SKILL.md
.claude/skills/update-sqlx/SKILL.md
system_prompts/auto-generated/skills/cli-commands/SKILL.md
system_prompts/auto-generated/skills/preview/SKILL.md
system_prompts/auto-generated/skills/write-script-bun/SKILL.md
system_prompts/auto-generated/skills/write-script-bunnative/SKILL.md
system_prompts/auto-generated/skills/write-script-deno/SKILL.md
system_prompts/auto-generated/skills/write-workflow-as-code/SKILL.md
system_prompts/auto-generated/skills/raw-app/SKILL.md
system_prompts/auto-generated/skills/schedules/SKILL.md
system_prompts/auto-generated/skills/triggers/SKILL.md
system_prompts/auto-generated/skills/write-flow/SKILL.md
system_prompts/auto-generated/skills/write-script-ansible/SKILL.md
system_prompts/auto-generated/skills/write-script-bash/SKILL.md
system_prompts/auto-generated/skills/write-script-bigquery/SKILL.md
system_prompts/auto-generated/skills/write-script-csharp/SKILL.md
system_prompts/auto-generated/skills/write-script-duckdb/SKILL.md
system_prompts/auto-generated/skills/write-script-go/SKILL.md
system_prompts/auto-generated/skills/write-script-graphql/SKILL.md

Metadata

Files
0
Version
7a0c81d
Hash
7e0c3cce
Indexed
2026-08-20 17:33

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-01 06:52
浙ICP备14020137号-1 $Carte des visiteurs$