> ## Documentation Index
> Fetch the complete documentation index at: https://site.aspect.build/llms.txt
> Use this file to discover all available pages before exploring further.

# Arg

`Arg` is the opaque value returned by the [`args`](/axl/types/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`](/axl/types/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.

```starlark theme={null}
def _impl(ctx: TaskContext):
    mode = ctx.args.get("mode")
    tags = ctx.args.get("tags")

my_task = task(
    implementation = _impl,
    args = {
        "mode": args.string(default = "auto", values = ["auto", "on", "off"]),
        "tags": args.string_list(),
        "verbose": args.boolean(default = False, short = "v"),
    },
)
```

## Related

* [`args`](/axl/types/args) — builders that produce an `Arg`.
* [`Arguments`](/axl/types/arguments) — the parsed args passed to a task
  implementation, including `is_explicit` to detect CLI-supplied values.
* [`Task.alias`](/axl/types/task) — override an existing `Arg`'s default
  without redefining it.
