Browse the documentation

AEL 1.0.0

Creating a project

In AEL, the Agent Engineering Language, one command creates a ready-to-build project: ael init.

Usage

ael init <name>
ael init <name> --template <template>
Argument or optionMeaning
<name>The project's name. It becomes the name of the new folder and is recorded in metadata.ael.
--template <template>Start from a template instead of the minimal project.
--jsonA machine-readable report of what was created.

What it creates

ael init support creates a folder named support in the current folder, holding the three files every project has at its root:

support/
  main.ael        # main support(): the program's entry point
  pack.ael        # the packages the project uses; empty
  metadata.ael    # the project's name and settings
  • main.ael declares a main that carries the name you gave and does nothing, so the new project checks, builds and runs as it is:
# main.ael
main support() {
    return;
}
  • pack.ael declares no packages. It stays in the project even while it is empty:
pack { schema = 1; dependencies = []; }
  • metadata.ael records the name you gave, which names main and the program that ael build writes:
metadata {
    schema = 1;
    name = "support";
}

The new project is a console program. It opens no network port and adds no server; you add the HTTP package and declare routes only when you want it to serve an API, as Services and APIs shows. A new project has no pack.lock and no .package folder: they appear beside pack.ael when you add the first package with ael pack add.

Every other folder and file is your choice. Project layout shows a larger project.

Names

A project name is an AEL identifier:

  • letters, digits and _, not starting with a digit;
  • at most 64 characters;
  • not a keyword, not _ on its own and not the reserved name print;
  • not main: the name follows main in main.ael, and ael init main is refused, as main main() is.

Names are case-sensitive, but ael init refuses a folder name that differs only in letter case from one already beside it, and names that some operating systems reserve for devices, so the new folder means the same thing on every operating system.

It never overwrites

  • If a file or folder with the project's name already exists, ael init stops and changes nothing.
  • The files are prepared beside the new folder, and the folder appears only when all three are complete. You never find a project with one of its root files missing.
  • If it is interrupted, it reports anything it left behind, so you can remove it.

A project for a package

The same project layout serves a package. To build one with ael package, the name in metadata.ael has to be a package name, such as acme/billing: lower case and slash-separated. The package's main then takes the last segment of that name, as in main billing(). Building a package describes the rules.

Next