Commit Graph
1 Commits
Author SHA1 Message Date
ducoterra 6a70dd2b2b add bash completion, flags mirrored from parse_args
Typing `ai-sandbox --` gave nothing, and a policy surface this wide
(egress modes, mounts, the agents share, the pi bridge, per-subcommand
flags) is not something to retype from memory. Nothing in the script or
install.sh emitted completions, so this adds one as a standalone file
rather than growing the script.

It mirrors parse_args() plus the per-subcommand parsers, and follows the
same rules the script does: a non-flag word that is not a subcommand ends
sandbox parsing, so after it the completer offers nothing rather than
flags that would silently become harness arguments; build, update, doctor
and clean only offer the flags they actually accept, since each dies on
an unknown one; inspect takes the full policy set, so it gets the full
list. Values complete from local state only -- --net and --harness from
their fixed modes, --env from exported host variables, --mount and
--workdir from directories, --allow from the two documented allow files.
Nothing here resolves a name or touches the network. Aliases that point
at the script (alias pi=ai-sandbox) register too, which is why the source
line belongs after the alias in ~/.bashrc.

Verified by driving COMP_WORDS for each case above and diffing the flag
list against parse_args(); bash -n is clean. Note the Makefile lint list
does not yet include contrib/, so shellcheck has not seen this file.

LLM-Generated: true
2026-10-28 00:50:56 +00:00