Command-Line Interface
The Command-Line Interface (CLI) is a core module that provides a base command processor and a command-line interface. It offers a minimal configuration designed for use in automation processes or manual execution of pre-created recipes. This module operates without a graphical interface, making it ideal for running scripts in headless environments or integrating with automated workflows.
How to run
You can use the following command to display help information for Anteater's Command-Line Interface:
$ java -jar ae.jar --help
usage: java -jar ae.jar <recipe_name> ...
-c,--commandPort <arg> Specifies the port for command communication.
-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.
This command provides an overview of available options, commands, and usage instructions for running Anteater via the command line.
You can run the CLI without any parameters. In this case, the application will prompt you to provide the required configuration and the recipe to execute interactively. This allows for a guided setup when no parameters are specified:
$ 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.
If you use a classpath definition, ensure you run the main class: com.ganteater.ae.RecipeRunner
:
$ java -cp ae.jar;plugins/*.jar com.ganteater.ae.RecipeRunner
To run the Anteater CLI within a Maven project, you can use the Maven plugin with the following command:
$ 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] ------------------------------------------------------------------------
This allows you to execute Anteater recipes directly from your Maven project, leveraging the configured Maven plugin for streamlined integration and automation. For more information see: Anteater Maven Plugin.