Skip to main content
Nargo is the command-line interface for Noir. It handles project scaffolding, compilation, execution, testing, formatting, and integration with language tooling.

Installation

Install Nargo using noirup, the Noir version manager:
Verify your installation:

Global flags

These flags are accepted by every subcommand.

Commands

Create a new Noir project in a new directory.Syntax
ArgumentsOptionsExample
This creates the following structure:
The generated src/main.nr contains a minimal example:
Initialize a Noir project in the current directory. Equivalent to nargo new but targets the working directory.Syntax
OptionsExample
nargo init will not overwrite an existing Nargo.toml. If one already exists in the directory, the command will exit with an error.
Type-check the program and generate Prover.toml and Verifier.toml input templates.Syntax
OptionsExample
Running this inside a project generates a Prover.toml file with placeholder values for each of main’s inputs:
Fill in real values before executing:
nargo check only generates a Prover.toml for binary packages. Library and contract packages are skipped because they do not expose a single main entry point.
Compile the program to ACIR format and write the artifact to ./target/<package_name>.json.Syntax
OptionsAll standard compiler options are accepted (e.g. --deny-warnings, --silence-warnings).Example
The compiled JSON artifact is written to:
This artifact contains the ACIR circuit bytecode, the ABI, and debug information. It is the input consumed by nargo execute, nargo info, and the profiler.
nargo compile can be aliased as nargo build.
Compile (if needed) and execute the program, producing a witness file.Syntax
ArgumentsOptionsExample
Reads inputs from Prover.toml and writes the witness to:
Writes the witness to target/my_witness.gz instead.
nargo execute automatically recompiles the program if sources have changed since the last compilation.
Generate a zero-knowledge proof for the program. Requires a proving backend such as Barretenberg.Syntax
Nargo does not bundle a proving backend. Proof generation is delegated to an external backend (e.g. bb from the Barretenberg package). See the quick start guide for backend setup instructions.
Verify a previously generated proof.Syntax
Like nargo prove, verification is delegated to the installed proving backend.
Compile and run all functions annotated with #[test].Syntax
ArgumentsOptionsExamplesRun all tests:
Run tests whose names contain add:
Run only the test named test_add exactly:
Example output
Format all Noir source files in the workspace according to the standard style.Syntax
OptionsExamplesFormat all files in the workspace:
Check formatting without modifying files (useful in CI):
Display circuit size information: ACIR opcode count and function-level breakdown.Syntax
OptionsExample
Example output
Launch the interactive REPL debugger for the program or a specific test function.Syntax
ArgumentsOptionsExample
See the Debugger page for a full walkthrough of the REPL interface.
Start the Noir Language Server, which provides IDE features to LSP-compatible editors.Syntax
This command is normally launched automatically by editor extensions such as vscode-noir and should not need to be run manually.See the Language Server page for setup instructions.
Compile and export all functions marked with the #[export] attribute from library packages.Syntax
Exported artifacts are written to the export/ directory inside the workspace target directory. This command only processes library packages; binary packages are ignored.Example
Run dedicated fuzzing harnesses — functions marked with #[test] that take arguments — as a standalone fuzzing session with more control than nargo test --only-fuzz.Syntax
ArgumentsOptionsExample
Print the result of macro expansion for the current package. Useful when debugging comptime code or attribute-based macros.Syntax
The expanded source is printed to standard output. No compilation artifacts are written.Example
Generate HTML documentation for the current package from doc comments (///). Output is written to target/docs/.Syntax
OptionsExample
The generated HTML is written to <workspace_target>/docs/. Open index.html in a browser to view the documentation.
nargo doc is in active development. Its output format may change between releases.
Generate a shell completion script for nargo.Syntax
ArgumentsExamples

Project structure

A standard Noir binary project created with nargo new has the following layout:
The target/ directory is created on first compile and holds build artifacts: