Running the Ampersand compiler

If you want to check your script, generate documentation, generate prototypes or use any other feature of Ampersand, you need to run the Ampersand compiler. This page tells you how.


To run the Ampersand compiler presumes you have docker installed on your computer. The following is the base command on linux (bash syntax)

docker run -it -v "$(pwd)":/scripts ampersandtarski/ampersand

On the Windows-10 command-line this looks slightly different (todo: check this!)

docker run -it -v $PWD:/scripts ampersandtarski/ampersand

Runs the Ampersand compiler (from your command prompt)


docker run -it -v "$(pwd)":/scripts ampersandtarski/ampersand COMMAND [OPTIONS] FILE


ampersand takes a file as input. It must contain a valid ampersand script, i.e. a script that complies to the syntax and semantics of ampersand. The compiler will not generate any output unless the script is valid.

When used without any options, it will check if the input is valid. If so, it will do nothing, if not, it will tell you what is wrong.


The list of options contains all compiler options.

The standard behavior of ampersand is affected by the following environment variables.

  • CCdbName Sets the name of the database that is to be generated. Can be overruled by --dbName

  • CCdirOutput Sets the default output directory for generated assets. Can be overruled by --outputDir

  • CCdirPrototype Sets the default directory where functional prototypes are being generated. Can be overruled by --proto


ampersand -fdocx --verbose Hawaii.adl # generates a specification document for Hawaii.adl
ampersand Delivery.adl # just check Delivery.adl for errors
ampersand --proto="D:\htdocs\CvM\" Contracts.adl # generate a prototype from Contracts.adl
ampersand --help
ampersand --help --verbose
ampersand --version


We are happy to receive bug reports at AmpersandTarski . However, please try to help us by first checking that it has not been reported already. You can do so by searching the issues. When in doubt however, don't hesitate to create a new issue.

Exit status

In case the Ampersand compiler is called by software and fails, it is useful to have an exit code to give some information about the nature of the failure. The Ampersand compiler produces the following exit codes:






Compilation has terminated without failures



This is a software error in the Ampersand compiler, that should never have occured in operational use. Please report an issue.



The script is not valid and the compiler has produced error messages to help you diagnose your mistake(s).



The population would violate invariants. The compiler cannot generate a violation-free database.


Invalid SQL

An SQL query gives other results than the semantics of Ampersand prescribes. This should never occur, so please report an issue.


Ampersand violations

There are sanity checks on your script that have produced violations, so the compiler will not generate an application.



The installation of Composer failed, so the front-end application will not work. This is most likely a configuration error.


Wrong arguments

The command-line arguments by which the compiler was called contain errors. Inspect the compiler output for a diagnosis.



The compiler failed to install the prototype framework. This is most likely a configuration error.