windmill-labs/windmill · error
Flags are not supported
Error message
Flags are not supported
What it means
Nushell flags (`--flag` parameters) are named switches/options. Windmill scripts expose positional typed arguments only, so a `def main` parameter starting with `--` is rejected. The signature parser cannot represent named flags in its MainArgSignature.
Source
Thrown at backend/parsers/windmill-parser-nu/src/lib.rs:141
}
};
// Check if it is optional
let optional = {
let Some(element) = name.chars().last() else {
bail!("Internal error, cannot check if argument is optional")
};
element == '?'
};
// Rest parameters are not supported
if matches!(name.get(0..3), Some("...")) {
bail!("Rest (...) parameters are not supported")
}
// Flags are not supported
if matches!(name.get(0..2), Some("--")) {
bail!("Flags are not supported")
}
sig.args.push(Arg {
name: if optional {
name.get(..name.len() - 1).unwrap_or("Error").to_owned()
} else {
name.to_owned()
},
typ: typ.unwrap_or(Typ::Unknown),
otyp: None,
has_default: default.is_some() || optional,
default: default.or_else(|| if optional { Some(json!(null)) } else { None }),
oidx: None,
otyp_inferred: false,
});
}
fn parse_type(content: &str) -> anyhow::Result<Typ> {View on GitHub (pinned to e474e8803c)
Solutions
- Convert each flag to a positional typed parameter, e.g. `--verbose` becomes `verbose: bool = false`.
- Keep the flag inside the script body as a local constant instead of a parameter.
- If callers need optionality, use an optional/nullable parameter (`verbose?: bool`) which Windmill supports.
- Move flag parsing into a wrapper that receives plain positional args and computes the flags internally.
Example fix
// before def main [--verbose, name: string] // after def main [verbose: bool = false, name: string]
Defensive patterns
Strategy: validation
Validate before calling
function validateNoFlags(code) {
const m = code.match(/def\s+main\s*\[([^\]]*)\]/);
if (m && /(^|,\s*)--/.test(m[1])) return 'flags (--flag) are not supported; convert to positional typed params like `verbose: bool = false`';
return null;
} Try / catch
try {
const sig = parseNuSignature(source);
} catch (e) {
if (String(e).includes('Flags are not supported')) {
throw new Error('Convert each --flag to a positional parameter (e.g. verbose: bool = false)');
}
throw e;
} Prevention
- Do not mirror CLI flag syntax in Windmill entrypoints
- Express options as typed parameters with defaults or nullable optionals
- Keep flag computation inside the script body from plain inputs
When it happens
Trigger: Declaring `def main [--verbose, --output: string]` or any flag-style parameter in a Nushell script parsed for a Windmill signature.
Common situations: Converting CLI nushell commands with flags into Windmill scripts; scripts generated from command help that mirror native flag syntax.
Related errors
- Rest (...) parameters are not supported
- Cannot find main function.
- Parsing error `:` should be before `=` it likely means you a
- Internal error, cannot check if argument is optional
- typed records are not supported, use `ident: record`
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/15379c36cde48650.
Report an issue: GitHub.