Skip to main content
Arg is the opaque value returned by the args builders (args.string, args.int, args.boolean, args.string_list, args.trailing_var_args, args.positional, args.custom, and their list variants). An Arg is a declaration — a schema entry that tells a task how to parse, validate, and default a single argument. You do not construct or mutate an Arg directly; you obtain one from an args.* builder and place it in a task’s args map. At invocation time, the parsed value is delivered to your implementation through the Arguments object, keyed by the map’s name.

Usage

Use an Arg as the value in a task’s args dictionary. The dictionary key becomes the argument’s name — that name is derived to kebab-case for the CLI flag (snake_case_name--snake-case-name) unless you pass long = "override-name" on the builder.
  • args — builders that produce an Arg.
  • Arguments — the parsed args passed to a task implementation, including is_explicit to detect CLI-supplied values.
  • Task.alias — override an existing Arg’s default without redefining it.