mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-21 16:02:28 +00:00
docs(skills): decouple safe local commands from destructive sync push (#9467)
* docs(skills): decouple safe local commands from destructive sync push The schedules, triggers, and resources skill templates lumped every CLI command under a blunt "do NOT run them yourself" directive. This conflated two very different risk profiles and forbade the agent from running even read-only/local commands, creating needless friction. Align these three with the nuanced policy flow-cli.md already uses: keep `wmill sync push` defensive (it deploys and can be destructive to remote state — only run when the user explicitly asks to deploy/publish/push), while letting read-only commands (`sync pull`, `schedule`, `resource list`) be run freely. Regenerated auto-generated skills + skills.gen.ts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(cli): warn that sync push is destructive in dry-run output Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(skills): clarify sync pull mutates local files, not read-only Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: centdix <farhadg110@gmail.com>
This commit is contained in:
@@ -3465,6 +3465,14 @@ function removeSuffix(str: string, suffix: string) {
|
||||
return str.slice(0, str.length - suffix.length);
|
||||
}
|
||||
|
||||
// Shown after a `wmill sync push --dry-run` preview that has changes. `sync push`
|
||||
// deploys to the remote workspace and is destructive (it overwrites and prunes
|
||||
// remote items that differ from or are absent locally), so the preview reminds
|
||||
// the caller — especially an AI agent that ran the dry-run to inspect changes —
|
||||
// to get explicit user confirmation before applying it for real.
|
||||
const SYNC_PUSH_DESTRUCTIVE_WARNING =
|
||||
"`wmill sync push` is destructive: applying it deploys these changes to the remote workspace and overwrites or deletes remote items that differ from or are absent locally — this is not automatically reversible. If you are an AI agent, do NOT run `wmill sync push` (without --dry-run) until the user has explicitly confirmed this deploy, unless your custom instructions explicitly allow bypassing that confirmation.";
|
||||
|
||||
export async function push(
|
||||
opts: GlobalOptions & SyncOptions & { repository?: string; branch?: string; acceptOverridingPermissionedAsWithSelf?: boolean },
|
||||
) {
|
||||
@@ -4001,6 +4009,9 @@ export async function push(
|
||||
: {}),
|
||||
})),
|
||||
total: changes.length,
|
||||
...(changes.length > 0
|
||||
? { warning: SYNC_PUSH_DESTRUCTIVE_WARNING }
|
||||
: {}),
|
||||
};
|
||||
console.log(JSON.stringify(result, null, 2));
|
||||
return;
|
||||
@@ -4044,6 +4055,7 @@ export async function push(
|
||||
|
||||
if (opts.dryRun) {
|
||||
log.info(colors.gray(`Dry run complete.`));
|
||||
log.warn(colors.yellow(`\n⚠ ${SYNC_PUSH_DESTRUCTIVE_WARNING}`));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -5266,10 +5266,10 @@ Text/HTML/inline parts are placed inline in \`body\` as strings.
|
||||
|
||||
## CLI Commands
|
||||
|
||||
After writing, tell the user they can run these commands (do NOT run them yourself):
|
||||
\`wmill sync push\` deploys local changes to the workspace and can be destructive to remote state — only suggest/run it when the user explicitly asks to deploy/publish/push, not when they say "run", "try", or "test". \`sync pull\` is safe to run yourself — it never mutates remote state, though it does overwrite local files to match the remote (use \`sync pull --dry-run\` to only preview).
|
||||
|
||||
\`\`\`bash
|
||||
# Push trigger configuration
|
||||
# Push trigger configuration — only when the user explicitly asks to deploy
|
||||
wmill sync push
|
||||
|
||||
# Pull triggers from Windmill
|
||||
@@ -5317,10 +5317,10 @@ Windmill uses 6-field cron expressions (includes seconds):
|
||||
|
||||
## CLI Commands
|
||||
|
||||
After writing, tell the user they can run these commands (do NOT run them yourself):
|
||||
\`wmill sync push\` deploys local changes to the workspace and can be destructive to remote state — only suggest/run it when the user explicitly asks to deploy/publish/push, not when they say "run", "try", or "test". The commands below never mutate remote state, so they're safe to run yourself — note that \`sync pull\` does overwrite local files to match the remote (use \`sync pull --dry-run\` to only preview), while \`schedule\` just lists.
|
||||
|
||||
\`\`\`bash
|
||||
# Push schedules to Windmill
|
||||
# Push schedules to Windmill — only when the user explicitly asks to deploy
|
||||
wmill sync push
|
||||
|
||||
# Pull schedules from Windmill
|
||||
@@ -5574,7 +5574,8 @@ wmill resource-type list --schema
|
||||
# Get specific resource type schema
|
||||
wmill resource-type get postgresql
|
||||
|
||||
# Push resources (tell the user to run this, do NOT run it yourself)
|
||||
# Push resources to Windmill — deploys to the workspace and can be destructive to
|
||||
# remote state, so only run it when the user explicitly asks to deploy/publish/push
|
||||
wmill sync push
|
||||
\`\`\`
|
||||
`,
|
||||
|
||||
@@ -563,7 +563,8 @@ wmill resource-type list --schema
|
||||
# Get specific resource type schema
|
||||
wmill resource-type get postgresql
|
||||
|
||||
# Push resources (tell the user to run this, do NOT run it yourself)
|
||||
# Push resources to Windmill — deploys to the workspace and can be destructive to
|
||||
# remote state, so only run it when the user explicitly asks to deploy/publish/push
|
||||
wmill sync push
|
||||
\`\`\`
|
||||
`;
|
||||
|
||||
@@ -242,6 +242,7 @@ wmill resource-type list --schema
|
||||
# Get specific resource type schema
|
||||
wmill resource-type get postgresql
|
||||
|
||||
# Push resources (tell the user to run this, do NOT run it yourself)
|
||||
# Push resources to Windmill — deploys to the workspace and can be destructive to
|
||||
# remote state, so only run it when the user explicitly asks to deploy/publish/push
|
||||
wmill sync push
|
||||
```
|
||||
|
||||
@@ -39,10 +39,10 @@ Windmill uses 6-field cron expressions (includes seconds):
|
||||
|
||||
## CLI Commands
|
||||
|
||||
After writing, tell the user they can run these commands (do NOT run them yourself):
|
||||
`wmill sync push` deploys local changes to the workspace and can be destructive to remote state — only suggest/run it when the user explicitly asks to deploy/publish/push, not when they say "run", "try", or "test". The commands below never mutate remote state, so they're safe to run yourself — note that `sync pull` does overwrite local files to match the remote (use `sync pull --dry-run` to only preview), while `schedule` just lists.
|
||||
|
||||
```bash
|
||||
# Push schedules to Windmill
|
||||
# Push schedules to Windmill — only when the user explicitly asks to deploy
|
||||
wmill sync push
|
||||
|
||||
# Pull schedules from Windmill
|
||||
|
||||
@@ -61,10 +61,10 @@ Text/HTML/inline parts are placed inline in `body` as strings.
|
||||
|
||||
## CLI Commands
|
||||
|
||||
After writing, tell the user they can run these commands (do NOT run them yourself):
|
||||
`wmill sync push` deploys local changes to the workspace and can be destructive to remote state — only suggest/run it when the user explicitly asks to deploy/publish/push, not when they say "run", "try", or "test". `sync pull` is safe to run yourself — it never mutates remote state, though it does overwrite local files to match the remote (use `sync pull --dry-run` to only preview).
|
||||
|
||||
```bash
|
||||
# Push trigger configuration
|
||||
# Push trigger configuration — only when the user explicitly asks to deploy
|
||||
wmill sync push
|
||||
|
||||
# Pull triggers from Windmill
|
||||
|
||||
@@ -237,6 +237,7 @@ wmill resource-type list --schema
|
||||
# Get specific resource type schema
|
||||
wmill resource-type get postgresql
|
||||
|
||||
# Push resources (tell the user to run this, do NOT run it yourself)
|
||||
# Push resources to Windmill — deploys to the workspace and can be destructive to
|
||||
# remote state, so only run it when the user explicitly asks to deploy/publish/push
|
||||
wmill sync push
|
||||
```
|
||||
|
||||
@@ -34,10 +34,10 @@ Windmill uses 6-field cron expressions (includes seconds):
|
||||
|
||||
## CLI Commands
|
||||
|
||||
After writing, tell the user they can run these commands (do NOT run them yourself):
|
||||
`wmill sync push` deploys local changes to the workspace and can be destructive to remote state — only suggest/run it when the user explicitly asks to deploy/publish/push, not when they say "run", "try", or "test". The commands below never mutate remote state, so they're safe to run yourself — note that `sync pull` does overwrite local files to match the remote (use `sync pull --dry-run` to only preview), while `schedule` just lists.
|
||||
|
||||
```bash
|
||||
# Push schedules to Windmill
|
||||
# Push schedules to Windmill — only when the user explicitly asks to deploy
|
||||
wmill sync push
|
||||
|
||||
# Pull schedules from Windmill
|
||||
|
||||
@@ -56,10 +56,10 @@ Text/HTML/inline parts are placed inline in `body` as strings.
|
||||
|
||||
## CLI Commands
|
||||
|
||||
After writing, tell the user they can run these commands (do NOT run them yourself):
|
||||
`wmill sync push` deploys local changes to the workspace and can be destructive to remote state — only suggest/run it when the user explicitly asks to deploy/publish/push, not when they say "run", "try", or "test". `sync pull` is safe to run yourself — it never mutates remote state, though it does overwrite local files to match the remote (use `sync pull --dry-run` to only preview).
|
||||
|
||||
```bash
|
||||
# Push trigger configuration
|
||||
# Push trigger configuration — only when the user explicitly asks to deploy
|
||||
wmill sync push
|
||||
|
||||
# Pull triggers from Windmill
|
||||
|
||||
Reference in New Issue
Block a user