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)
For use with other editors such as Atom (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)
Whether to highlight non-Agda code as comments in generated HTML files (default: all; see :ref: generating-html)
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 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)
Enable typing rule Setω : Setω (this makes Agda inconsistent).
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)
Disable automatic compile-time inlining. Only definitions marked INLINE will be inlined.
Always expand Pattern Synonyms during printing. With this option enabled you can use pattern synonyms freely, but Agda will not use any pattern synonyms when printing goal types or error messages, or when generating patterns for case splits.


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:

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

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