Running a program
In AEL, the Agent Engineering Language, ael run checks, builds and runs a program in one step, on the machine you are working on.
Usage
ael run
ael run <path>
ael run --json
| Argument or option | Meaning |
|---|---|
[path] | The project folder. Without a path, the project in the current folder. |
--json | Diagnostics and reports from the command in machine-readable form. |
What it does
ael run goes through the same steps as ael build, for the machine you are working on:
- check and compile the project;
- compute and verify the complete reference map, starting at
main; - build the native program, named after the application, then start it.
A shortcut never skips a step: a program that ael run starts has passed exactly the checks a build applies. If any step fails, nothing runs, and the diagnostics point at your source.
The program starts at main in main.ael, which carries the application's name, such as main support(). When a main without a result type finishes, the program exits successfully; a main that declares an i64 result exits with the value it returns.
A program that declares functions in other languages builds them with your toolchains, as ael build does, and runs them with their runtimes on the machine you work on.
Packages at startup
Nothing downloads when the program starts. ael run uses only the packages already installed and pinned by your lock files, and a missing package is reported before anything runs, with the command that installs it. Your lock file pins the exact versions you built with, so a run repeats, even offline.
Time and token reports
Time and token usage is reported by default. For a program started from the command line, the report is a summary on standard error, so the program's own output on standard output stays unchanged for pipes and scripts.
You can turn off each field without disabling the limits behind it: all reporting at once, time or tokens alone, or single token counts. Reporting, logs and replay describes the report and its settings.
Agents and configuration
An agent that the program runs gets its own run ID and budget, and its configuration is locked into a snapshot for that run. Agents, nodes and edges and Configuration describe both.
Build or run
Use ael run while you work. Use ael build when you need a file to deploy or copy to another machine, or a program for another target: ael run always builds for the machine it runs on.
Related
- A first program:
ael runin a small project. - Running tests: the project's tests, without a network or a model account.