Installation
Install Nargo usingnoirup, the Noir version manager:
Global flags
These flags are accepted by every subcommand.Commands
nargo new
nargo new
Create a new Noir project in a new directory.SyntaxArgumentsThis creates the following structure:The generated
Options
Example
src/main.nr contains a minimal example:nargo init
nargo init
Initialize a Noir project in the current directory. Equivalent to Options
nargo new but targets the working directory.SyntaxExample
nargo init will not overwrite an existing Nargo.toml. If one already exists in the directory, the command will exit with an error.nargo check
nargo check
Type-check the program and generate OptionsRunning this inside a project generates a Fill in real values before executing:
Prover.toml and Verifier.toml input templates.SyntaxExample
Prover.toml file with placeholder values for each of main’s inputs: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.nargo compile
nargo compile
Compile the program to ACIR format and write the artifact to OptionsAll standard compiler options are accepted (e.g. 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
./target/<package_name>.json.Syntax--deny-warnings, --silence-warnings).Examplenargo execute, nargo info, and the profiler.nargo execute
nargo execute
Compile (if needed) and execute the program, producing a witness file.SyntaxArgumentsReads inputs from Writes the witness to
Options
Example
Prover.toml and writes the witness to:target/my_witness.gz instead.nargo execute automatically recompiles the program if sources have changed since the last compilation.nargo prove
nargo prove
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.nargo verify
nargo verify
Verify a previously generated proof.Syntax
Like
nargo prove, verification is delegated to the installed proving backend.nargo test
nargo test
Compile and run all functions annotated with ArgumentsRun tests whose names contain Run only the test named Example output
#[test].SyntaxOptions
ExamplesRun all tests:
add:test_add exactly:nargo fmt
nargo fmt
Format all Noir source files in the workspace according to the standard style.SyntaxOptionsCheck formatting without modifying files (useful in CI):
ExamplesFormat all files in the workspace:
nargo info
nargo info
Display circuit size information: ACIR opcode count and function-level breakdown.SyntaxOptionsExample output
Example
nargo debug
nargo debug
Launch the interactive REPL debugger for the program or a specific test function.SyntaxArgumentsSee the Debugger page for a full walkthrough of the REPL interface.
Options
Example
nargo lsp
nargo lsp
Start the Noir Language Server, which provides IDE features to LSP-compatible editors.SyntaxThis 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.
nargo export
nargo export
Compile and export all functions marked with the Exported artifacts are written to the
#[export] attribute from library packages.Syntaxexport/ directory inside the workspace target directory. This command only processes library packages; binary packages are ignored.Examplenargo fuzz
nargo fuzz
Run dedicated fuzzing harnesses — functions marked with Arguments
#[test] that take arguments — as a standalone fuzzing session with more control than nargo test --only-fuzz.SyntaxOptions
Example
nargo expand
nargo expand
Print the result of macro expansion for the current package. Useful when debugging The expanded source is printed to standard output. No compilation artifacts are written.Example
comptime code or attribute-based macros.Syntaxnargo doc
nargo doc
Generate HTML documentation for the current package from doc comments (OptionsThe generated HTML is written to
///). Output is written to target/docs/.SyntaxExample
<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.nargo generate-completion-script
nargo generate-completion-script
Generate a shell completion script for Arguments
nargo.SyntaxExamples
Project structure
A standard Noir binary project created withnargo new has the following layout:
target/ directory is created on first compile and holds build artifacts: