Command-Line Interface

The Anteater Command-Line Interface (CLI) module runs recipes from the terminal and provides the core command processor. It is intended for automation and headless environments and can also be used interactively when you want to pick a configuration and recipe at runtime.

What it provides

  • Run a recipe by name (for scripts/CI)
  • Start in interactive mode (choose configuration and recipe)
  • Use the same recipe execution engine as the Anteater Maven Plugin

Quick start

Build and run from the produced JAR:

$ java -jar ae.jar --help

If you use a classpath definition (for example, when loading plugins from a folder), run the main class:

$ java -cp ae.jar;plugins/*.jar com.ganteater.ae.RecipeRunner

Common usage

Display help and available options:

$ java -jar ae.jar --help
usage: java -jar ae.jar <recipe_name> ...
 -c,--commandPort <arg>   Specifies the port for command communication.
 -con,--console           Force application to run in console mode
 -h,--help                Displays help information for usage.
 -n,--configName <arg>    Specifies the configuration name to use.
 -s,--serverPort <arg>    Specifies the port for the command server.
 -v,--version             Use this option to check which version of
                          Anteater you are running, ensuring compatibility
                          with your recipes and plugins.

Run without parameters to start interactively:

$ java -jar ae.jar
Start dir: D:\projects\anteater\delivery-pack\ae
Giant anteater looking for recipes ...
Environment file: D:\projects\anteater\delivery-pack\ae\ae.xml
Configuration: [Base Commands]
List of values for [Recipe]:
  1: #Sub-Recipe
  2: About
  3: Append
...
 34: WhileRun
 35: attr-map
Please select "Recipe" [22]: 22
Recipe: [Out]
30.06.2025 13:00:48 DEBUG  Recipe: "Out"
30.06.2025 13:00:48 INFO   <note>
        <to>Tove</to>
        <from>Jani</from>
        <heading>Reminder</heading>
        <body>Don't forget me this weekend!</body>
</note>
30.06.2025 13:00:48 DEBUG  Recipe: "Out" done
30.06.2025 13:00:48 DEBUG  Recipe 'Out' is stopped.

Run from Maven

To execute recipes as part of a Maven build, run:

$ mvn ae:do
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules
[INFO] Installing Central Publishing features
[INFO]
[INFO] ---------------------< com.ganteater:anteater-cli >---------------------
[INFO] Building Command-Line Interface 1.2.2-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] --- ae:1.2.2-SNAPSHOT:do (default-cli) @ anteater-cli ---
Start dir: D:\projects\anteater\code\anteater-cli
[INFO] Giant anteater looking for food ...
[INFO] Loading configuration ...
Environment file: D:\projects\anteater\code\anteater-cli\src\manual-test\ae\ae.xml
List of values for [Recipe]:
  1: #Sub-Recipe
  2: About
  3: Append
...
 34: While
 35: WhileRun
 36: attr-map
Please select "Recipe" [22]:
Recipe: [Out]
30.06.2025 13:17:21 DEBUG  Recipe: "Out"
30.06.2025 13:17:21 INFO   Hello World!
30.06.2025 13:17:21 INFO   msg = Hello again ...
30.06.2025 13:17:21 WARN   Warning Hello!
30.06.2025 13:17:21 INFO   Special case with XML body = <note>
        <to>Tove</to>
        <from>Jani</from>
        <heading>Reminder</heading>
        <body>Don't forget me this weekend!</body>
</note>

30.06.2025 13:17:21 DEBUG  Recipe: "Out" done
30.06.2025 13:17:21 DEBUG  Recipe 'Out' is stopped.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10.240 s
[INFO] Finished at: 2025-06-30T13:17:21+03:00
[INFO] ------------------------------------------------------------------------

For details about configuring and using the Maven integration, see: Anteater Maven Plugin.

Next steps

  • If you already have an Anteater environment (for example, an ae.xml plus plugins), point the CLI at it and run recipes non-interactively in CI.
  • If you are getting started, consult the project documentation for how to structure configurations, recipes, and plugin loading.