Command-line options

Command-line options

Agda accepts the following options.

General options

--version -V
Show version number
--help[=TOPIC] -?[TOPIC]
Show basically this help, or more help about TOPIC. Current topics available: warning.
--interactive -I
Start in interactive mode (no longer supported)
For use with the Emacs mode (no need to invoke yourself)


See Compilers for backend-specific options.

Do not treat the requested module as the main module of a program when compiling
Set DIR as directory for compiler output (default: the project root)
Disable the forcing optimisation

Generating highlighted source code

Generate Vim highlighting files
Generate LaTeX with highlighted source code (see Generating LaTeX)
Set directory in which LaTeX files are placed to DIR (default: latex)
Count extended grapheme clusters when generating LaTeX code (see Counting Extended Grapheme Clusters)
Generate HTML files with highlighted source code (see Generating HTML)
Set directory in which HTML files are placed to DIR (default: html)
Set URL of the CSS file used by the HTML files to URL (can be relative)
Generate a Dot file FILE with a module dependency graph

Imports and libraries

(see Library Management)

Ignore interface files (re-type check everything)
--include-path=DIR -i=DIR
Look for imports in DIR
--library=DIR -l=LIB
Use library LIB
Use FILE instead of the standard libraries file
Don’t use any library files
Don’t use default library files

Sharing and caching

Enable sharing and call-by-need evaluation (experimental) (default: OFF)
Disable sharing and call-by-need evaluation
Enable caching of typechecking (experimental) (default: OFF)
Disable caching of typechecking
Only scope-check the top-level module, do not type-check it

Command-line and pragma options

The following options can also be given in .agda files in the {-# OPTIONS --{opt₁} --{opt₂} ... #-} form at the top of the file.

Printing and debugging

Show implicit arguments when printing
Show irrelevant arguments when printing
Don’t use unicode characters to print terms
--verbose=N -v=N
Set verbosity level to N

Copatterns and projections

Enable definitions by copattern matching (default; see Copatterns)
Disable definitions by copattern matching
Make postfix projection notation the default

Experimental features

Enable proof irrelevance (experimental feature)
Enable injective type constructors (makes Agda anti-classical and possibly inconsistent)
Treat type constructors as inductive constructors when checking productivity
Enable potentially unsound irrelevance features (irrelevant levels, irrelevant data matching) (see Irrelevance)
Enable declaration and use of REWRITE rules (see Rewriting)
Enable cubical features (see Cubical Type Theory in Agda)

Errors and warnings

Succeed and create interface file regardless of unsolved meta variables (see Metavariables)
Do not warn about not strictly positive data types (see Positivity Checking)
Do not warn about possibly nonterminating code (see Termination Checking)
Set warning group or flag (see Warnings)

Pattern matching and equality

Disables definitions using Streicher’s K axiom (see Without K)
Overrides a global --without-K in a file (see Without K)
Disable pattern matching completely
Require all clauses in a definition to hold as definitional equalities unless marked CATCHALL (see Case trees)
Do not require all clauses in a definition to hold as definitional equalities (default)
Default records to no-eta-equality (see Eta-expansion)

Search depth

Allow termination checker to count decrease/increase upto N (default: 1; see Termination Checking)
Set instance search depth to N (default: 500; see Instance Arguments)
Set maximum depth for pattern match inversion to N (default: 50). Should only be needed in pathological cases.

Other features

Disable postulates, unsafe OPTION pragmas and primTrustMe (see Safe Agda)
Ignore universe levels (this makes Agda inconsistent; see Universe Levels)
Use sized types (default, inconsistent with “musical” coinduction; see Sized Types)
Disable sized types (see Sized Types)
Enable universe polymorphism (default; see Universe Levels)
Disable universe polymorphism (see Universe Levels)
Disable projection of irrelevant record fields (see Irrelevance)


The -W or --warning option can be used to disable or enable different warnings. The flag -W error (or --warning=error) can be used to turn all warnings into errors, while -W noerror turns this off again.

A group of warnings can be enabled by -W {group}, where group is one of the following:

All of the existing warnings
Default warning level
Ignore all warnings

Individual warnings can be turned on and off by -W {Name} and -W {noName} respectively. The flags available are:

Multi-line comments spanning one or more literate text blocks.
Names not declared in the same scope as their syntax or fixity declaration.
Mixfix names without an associated fixity declaration.
Names not declared in the same scope as their polarity pragmas.
Polarity pragmas for non-postulates.
private blocks where they have no effect.
abstract blocks where they have no effect.
instance blocks where they have no effect.
Empty mutual blocks.
Empty abstract blocks.
Empty private blocks.
Empty instance blocks.
Empty macro blocks.
Empty postulate blocks.
Termination checking pragmas before non-function or mutual blocks.
No positivity checking pragmas before non-data`, record or mutual blocks.
CATCHALL pragmas before a non-function clause.
Deprecated BUILTIN pragmas.
Empty REWRITE pragmas.
public blocks where they have no effect.
Unreachable function clauses.
INLINE pragmas where they have no effect.
Feature deprecation.
Inversions of pattern-matching failed due to exhausted inversion depth.
Failed termination checks.
Failed coverage checks.
Failed exact split checks.
Failed strict positivity checks.
Unsolved meta variables.
Unsolved interaction meta variables.
Unsolved constraints.
postulate blocks with the safe flag
Unsafe OPTIONS pragmas with the safe flag.
NON_TERMINATING pragmas with the safe flag.
TERMINATING pragmas with the safe flag.
primTrustMe usages with the safe flag.
NO_POSITIVITY_CHECK pragmas with the safe flag.
POLARITY pragmas with the safe flag.

For example, the following command runs Agda with all warnings enabled, except for warnings about empty abstract blocks:

agda -W all --warning noEmptyAbstract file.agda