An umbrella CLI for Network-as-Code workflows, driven by a single nac.yaml
config file.
Every Network-as-Code repository runs the same workflow, regardless of the
architecture: validate the data model, plan, apply and test. Each step uses a
different tool with its own options: terraform or tofu, nac-validate and
nac-test. nac is a single CLI for the whole workflow. The repository is
described once in nac.yaml, and the same commands work on a laptop and in a
CI/CD pipeline:
nac setup # verify prerequisites and report resolved tool versions
nac init # terraform/tofu init
nac validate # nac-validate against the configured data paths
nac plan # terraform/tofu plan -> plan.tfplan
nac apply # apply the saved plan (or interactively, without one)
nac test # nac-test against the configured data/templates/output
nac destroy # destroy the managed infrastructureFull documentation: https://netascode.cisco.com/docs/tools/nac/overview
- One configuration file:
nac.yamldefines where the data model, schema, rules and test templates are located, which Terraform engine to use and which environment variables are required. Every field has a default, so a repository following thedata/andtests/conventions works without anac.yamlat all. - Managed toolchain:
nac-validateandnac-testare used from a local installation if one satisfies the configured version, or run viauvxotherwise. If neitherterraformnortofuis installed,nac setupcan install OpenTofu. - Tested versions: a Network-as-Code Terraform module can declare the
nac-validateandnac-testversions it was tested with innac/manifest.yaml.nacthen uses a compatible version by default and warns about versions outside of the tested range. - Pass-through: arguments not known to
nacare forwarded to the wrapped tool, and the exit code of the wrapped tool is returned.
nac is published on PyPI as nac-cli; the command it installs is nac.
Install it with uv:
uv tool install nac-cliWarning
Don't pip install nac or run uvx nac -- that is a different, unrelated
package.
See the installation docs
for prerequisites, and usage
and configuration
for the full command and nac.yaml reference.