Install Egret

Egret-lang is a new programming language built for the AI era. It focuses on AI-oriented syntax, strong typing, clear abstractions, async concurrency, and an engineering-first toolchain.

The current 0.1.3 preview package is available for Linux x64, Linux ARM64, and MacOS ARM64.

Install

Install Egret with the official script:

If you want a non-interactive install, use the --yes flag. If the install directory is not already in your PATH, add it manually and verify the command is available.

Install with one command

curl -fsSL https://egret-lang.org/install.sh | sh

Non-interactive install

curl -fsSL https://egret-lang.org/install.sh | sh -s -- --yes

Add the default install directory to PATH

export PATH="$HOME/.local/bin:$PATH"

Verify the installation

egret --help

Hello World

Your first Egret program can be as small as this:

Save it as hello.eg, then build and run it. Egret programs usually start from main, and returning 0 means the program completed successfully.

If you want to read command-line arguments, use the argc and argv form:

hello.eg

func main() -> Int {
    print("hello egret");
    return 0;
}

Build and run

egret build hello.eg -o hello
./hello

Read command-line arguments

func main(argc: Int, argv: Int) -> Int {
    if argc > 1 {
        let name: String = argv_get(argc, argv, 1);
        print(name);
    }
    return 0;
}

Package Project

For larger programs, Egret supports package-based projects with egret.toml.

A minimal package can look like this:

Build from the project root with the manifest file:

egret.toml

[package]
name = "hello_egret_package"
version = "0.1.0"

[lib]
modules = ["hello_egret_package"]

Project layout

hello-egret-package/
├── egret.toml
├── main.eg
└── src/
    └── hello_egret_package/
        └── hello_egret_package.eg

main.eg

use hello_egret_package;

func main() -> Int {
    _ = hello_egret_package.print_hello_world();
    return 0;
}

src/hello_egret_package/hello_egret_package.eg

module hello_egret_package;

func print_hello_world() -> Void {
    print("hello world");
}

Build from the project root

egret build --manifest-path egret.toml

AI Coding

Egret-lang also provides a dedicated Skills repository for AI coding agents: egret-lang/skills.

This repository helps an agent load only the Egret-specific references it needs, instead of pulling the full handbook into every task.

Its references are split by responsibility, including language syntax, coding style, build and project layout, standard library usage, reusable templates, and testing or debugging workflows.

That makes generated Egret code more consistent with the current project syntax, engineering workflow, and verification expectations.

Clone the skills repository

git clone https://github.com/egret-lang/skills.git

Common Commands

These are the most useful commands to get started with Egret quickly:

Build a single source file

egret build hello.eg -o hello

Build from a package manifest

egret build --manifest-path egret.toml

Build one executable target

egret build --manifest-path egret.toml --bin server

Build all executable targets

egret build --manifest-path egret.toml --bins

Build and test the compiler from source

make -j4
make test