mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-10 08:07:03 +00:00
feat(cli): add consistent get/list/new subcommands for all item types (#8047)
* feat(cli): add consistent get/list/new subcommands for all item types Make the CLI consistent so every item type (script, flow, app, resource, resource-type, variable, schedule, folder, trigger) supports get/list/new subcommands, enabling the CLI to be used as a full API client in bash scripts with jq piping. - Add --json flag to all list commands for machine-readable output - Register explicit "list" subcommand alongside default action - Add "get <path> [--json]" subcommand to fetch single items from API - Rename "bootstrap" to "new" for script/flow, keep "bootstrap" as alias - Add "new" subcommand for resource, resource-type, variable, schedule, folder, and trigger to create local template YAML files - Update cli-commands skill documentation for wmill init - Add integration tests for all new commands Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * all * feat: install wmill CLI in Docker images and use it for bash variable/resource access - Install windmill-cli via bun in all Dockerfiles that include bun - DockerfileCli: switch from node:slim to oven/bun:slim - CLI: auto-configure from WM_WORKSPACE/WM_TOKEN/BASE_INTERNAL_URL env vars as last-resort fallback when no workspace is configured - Frontend: replace curl-based bash snippets with wmill variable/resource get - Add backend integration tests for wmill CLI in bash scripts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ci): install windmill-cli in backend test workflow Ensures wmill is available on PATH for bash integration tests that use `wmill variable get` and `wmill resource get`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor(cli): replace @std/* Deno dependencies with Node.js equivalents Replace @std/log with a lightweight custom logger (core/log.ts), @std/path with node:path, and @std/yaml with the yaml npm package. Also fix process hang on exit, add --node option to install_dev.sh, and add missing hasRequiredPermissions to NpmProvider. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * all * all * all * refactor(cli): replace @ayonli/jsext and @std/encoding with lightweight alternatives Replace @ayonli/jsext (8.4MB) with tar-stream (32kB) for tar creation, replace @std/encoding with Node.js Buffer.toString("hex"), and fix @windmill-labs/shared-utils to use direct npm instead of JSR mirror. Also resolve merge conflicts in sync.ts and fix pre-existing type errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(cli): use singleQuote YAML output and pass yamlOptions in gitsync pull The yaml library defaults to double quotes, but the codebase (and tests) expect single-quoted strings. Add singleQuote: true to yamlOptions and pass yamlOptions to gitsync-settings pull writeFile calls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * all * all * fix(cli): address code review feedback - Install CLI from source in backend tests instead of npm - Fix script bootstrap catch block to re-throw "File already exists" - Add type-safe local variable after trigger kind validation - Use created_by instead of policy.on_behalf_of for app get output - Note --kind is recommended for faster trigger lookup in help text - Document node symlink purpose in Dockerfiles Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ci): use /usr/bin for wmill wrapper to ensure it's in PATH Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ci): install wmill to ~/.local/bin to avoid permission issues Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci(backend): switch to Blacksmith runner and add cargo caching - Switch from ubicloud-standard-16 to blacksmith-16vcpu-ubuntu-2404 for faster NVMe-backed builds - Add stickydisk for cargo target directory (persistent NVMe cache across runs) - Add cache for cargo registry and git dependencies - Upgrade DuckDB FFI cache from actions/cache@v3 to useblacksmith/cache@v1 - Enable CARGO_INCREMENTAL=1 to benefit from persistent target cache Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix ci --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
a91c532eca
commit
4fedfdfd11
@@ -4557,9 +4557,16 @@ Current version: 1.624.0
|
||||
|
||||
app related commands
|
||||
|
||||
**Options:**
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
|
||||
**Subcommands:**
|
||||
|
||||
- \`app push <file_path:string> <remote_path:string>\` - push a local app
|
||||
- \`app list\` - list all apps
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`app get <path:string>\` - get an app's details
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`app push <file_path:string> <remote_path:string>\` - push a local app
|
||||
- \`app dev [app_folder:string]\` - Start a development server for building apps with live reload and hot module replacement
|
||||
- \`--port <port:number>\` - Port to run the dev server on (will find next available port if occupied)
|
||||
- \`--host <host:string>\` - Host to bind the dev server to
|
||||
@@ -4596,10 +4603,16 @@ Launch a dev server that will spawn a webserver with HMR
|
||||
flow related commands
|
||||
|
||||
**Options:**
|
||||
- \`--show-archived\` - Enable archived scripts in output
|
||||
- \`--show-archived\` - Enable archived flows in output
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
|
||||
**Subcommands:**
|
||||
|
||||
- \`flow list\` - list all flows
|
||||
- \`--show-archived\` - Enable archived flows in output
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`flow get <path:string>\` - get a flow's details
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`flow push <file_path:string> <remote_path:string>\` - push a local flow spec. This overrides any remote versions.
|
||||
- \`flow run <path:string>\` - run a flow by path.
|
||||
- \`-d --data <data:string>\` - Inputs specified as a JSON string or a file using @<filename> or stdin using @-.
|
||||
@@ -4611,16 +4624,27 @@ flow related commands
|
||||
- \`--yes\` - Skip confirmation prompt
|
||||
- \`-i --includes <patterns:file[]>\` - Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string)
|
||||
- \`-e --excludes <patterns:file[]>\` - Comma separated patterns to specify which file to NOT take into account.
|
||||
- \`flow bootstrap <flow_path:string>\` - create a new empty flow
|
||||
- \`--summary <summary:string>\` - script summary
|
||||
- \`--description <description:string>\` - script description
|
||||
- \`flow new <flow_path:string>\` - create a new empty flow
|
||||
- \`--summary <summary:string>\` - flow summary
|
||||
- \`--description <description:string>\` - flow description
|
||||
- \`flow bootstrap <flow_path:string>\` - create a new empty flow (alias for new)
|
||||
- \`--summary <summary:string>\` - flow summary
|
||||
- \`--description <description:string>\` - flow description
|
||||
|
||||
### folder
|
||||
|
||||
folder related commands
|
||||
|
||||
**Options:**
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
|
||||
**Subcommands:**
|
||||
|
||||
- \`folder list\` - list all folders
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`folder get <name:string>\` - get a folder's details
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`folder new <name:string>\` - create a new folder locally
|
||||
- \`folder push <file_path:string> <remote_path:string>\` - push a local folder spec. This overrides any remote versions.
|
||||
|
||||
### gitsync-settings
|
||||
@@ -4731,18 +4755,33 @@ List all queues with their metrics
|
||||
|
||||
resource related commands
|
||||
|
||||
**Options:**
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
|
||||
**Subcommands:**
|
||||
|
||||
- \`resource list\` - list all resources
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`resource get <path:string>\` - get a resource's details
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`resource new <path:string>\` - create a new resource locally
|
||||
- \`resource push <file_path:string> <remote_path:string>\` - push a local resource spec. This overrides any remote versions.
|
||||
|
||||
### resource-type
|
||||
|
||||
resource type related commands
|
||||
|
||||
**Options:**
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
|
||||
**Subcommands:**
|
||||
|
||||
- \`resource-type list\` - list all resource types
|
||||
- \`--schema\` - Show schema in the output
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`resource-type get <path:string>\` - get a resource type's details
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`resource-type new <name:string>\` - create a new resource type locally
|
||||
- \`resource-type push <file_path:string> <name:string>\` - push a local resource spec. This overrides any remote versions.
|
||||
- \`resource-type generate-namespace\` - Create a TypeScript definition file with the RT namespace generated from the resource types
|
||||
|
||||
@@ -4750,8 +4789,16 @@ resource type related commands
|
||||
|
||||
schedule related commands
|
||||
|
||||
**Options:**
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
|
||||
**Subcommands:**
|
||||
|
||||
- \`schedule list\` - list all schedules
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`schedule get <path:string>\` - get a schedule's details
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`schedule new <path:string>\` - create a new schedule locally
|
||||
- \`schedule push <file_path:string> <remote_path:string>\` - push a local schedule spec. This overrides any remote versions.
|
||||
|
||||
### script
|
||||
@@ -4760,21 +4807,30 @@ script related commands
|
||||
|
||||
**Options:**
|
||||
- \`--show-archived\` - Enable archived scripts in output
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
|
||||
**Subcommands:**
|
||||
|
||||
- \`script push <path:file>\` - push a local script spec. This overrides any remote versions. Use the script file (.ts, .js, .py, .sh
|
||||
- \`script show <path:file>\` - show a scripts content
|
||||
- \`script list\` - list all scripts
|
||||
- \`--show-archived\` - Enable archived scripts in output
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`script get <path:file>\` - get a script's details
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`script show <path:file>\` - show a script's content (alias for get)
|
||||
- \`script push <path:file>\` - push a local script spec. This overrides any remote versions. Use the script file (.ts, .js, .py, .sh)
|
||||
- \`script run <path:file>\` - run a script by path
|
||||
- \`-d --data <data:file>\` - Inputs specified as a JSON string or a file using @<filename> or stdin using @-.
|
||||
- \`-s --silent\` - Do not output anything other then the final output. Useful for scripting.
|
||||
- \`script preview <path:file>\` - preview a local script without deploying it. Supports both regular and codebase scripts.
|
||||
- \`-d --data <data:file>\` - Inputs specified as a JSON string or a file using @<filename> or stdin using @-.
|
||||
- \`-s --silent\` - Do not output anything other than the final output. Useful for scripting.
|
||||
- \`script bootstrap <path:file> <language:string>\` - create a new script
|
||||
- \`script new <path:file> <language:string>\` - create a new script
|
||||
- \`--summary <summary:string>\` - script summary
|
||||
- \`--description <description:string>\` - script description
|
||||
- \`script generate-metadata [script:file]\` - re-generate the metadata file updating the lock and the script schema (for flows, use \`wmill flow generate-locks\`
|
||||
- \`script bootstrap <path:file> <language:string>\` - create a new script (alias for new)
|
||||
- \`--summary <summary:string>\` - script summary
|
||||
- \`--description <description:string>\` - script description
|
||||
- \`script generate-metadata [script:file]\` - re-generate the metadata file updating the lock and the script schema (for flows, use \`wmill flow generate-locks\`)
|
||||
- \`--yes\` - Skip confirmation prompt
|
||||
- \`--dry-run\` - Perform a dry run without making changes
|
||||
- \`--lock-only\` - re-generate only the lock
|
||||
@@ -4852,8 +4908,18 @@ sync local with a remote workspaces or the opposite (push or pull)
|
||||
|
||||
trigger related commands
|
||||
|
||||
**Options:**
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
|
||||
**Subcommands:**
|
||||
|
||||
- \`trigger list\` - list all triggers
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`trigger get <path:string>\` - get a trigger's details
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`--kind <kind:string>\` - Trigger kind (http, websocket, kafka, nats, postgres, mqtt, sqs, gcp, email)
|
||||
- \`trigger new <path:string>\` - create a new trigger locally
|
||||
- \`--kind <kind:string>\` - Trigger kind (required: http, websocket, kafka, nats, postgres, mqtt, sqs, gcp, email)
|
||||
- \`trigger push <file_path:string> <remote_path:string>\` - push a local trigger spec. This overrides any remote versions.
|
||||
|
||||
### user
|
||||
@@ -4875,8 +4941,16 @@ user related commands
|
||||
|
||||
variable related commands
|
||||
|
||||
**Options:**
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
|
||||
**Subcommands:**
|
||||
|
||||
- \`variable list\` - list all variables
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`variable get <path:string>\` - get a variable's details
|
||||
- \`--json\` - Output as JSON (for piping to jq)
|
||||
- \`variable new <path:string>\` - create a new variable locally
|
||||
- \`variable push <file_path:string> <remote_path:string>\` - Push a local variable spec. This overrides any remote versions.
|
||||
- \`--plain-secrets\` - Push secrets as plain text
|
||||
- \`variable add <value:string> <remote_path:string>\` - Create a new variable on the remote. This will update the variable if it already exists.
|
||||
|
||||
Reference in New Issue
Block a user