Skip to main content
This guide walks you through creating a minimal Kairo application from scratch. By the end you will have a working project that you can build and run locally using the Forge compiler and Pulse runtime.
Make sure you have Forge and Pulse installed before you begin. See the Installation guide for setup instructions.

Create your first Kairo app

1

Create your project directory

Create a new directory for your project and navigate into it. Kairo projects are just folders — there is no scaffolding command yet, so you set them up by hand.
Your project will have a simple structure with one manifest file and one source file:
2

Write the package manifest

Create a file named kairo.toml in your project directory. This is the package manifest — it tells Forge the name, version, language version, and kind of your project.
The kind field tells Forge how to build your project. Use "application" for programs with an entry point and "library" for packages meant to be consumed by other projects.
3

Write your first Kairo source file

Create a file named main.ak. Every Kairo source file starts with a module declaration that matches your package name. The main function is the entry point of your application.
A few things to notice:
  • The module declaration matches the name in kairo.toml
  • import Pulse.Console brings in the console I/O module from the Pulse standard library
  • public is required on main so Forge can find it as the entry point
  • There are no semicolons
4

Check your code with Forge

Before building, run forge check to validate your code without producing any output files. This is the fastest way to catch type errors and syntax issues during development.
If everything is correct, you will see output similar to:
Use forge check frequently while writing code. It is faster than a full build and gives you immediate feedback on errors.
5

Build your application

Run forge build to compile your project. Forge reads kairo.toml, resolves dependencies, compiles all .ak source files, and writes the output to the build directory.
A successful build looks like this:
Your compiled application is now ready to run.
6

Run your application with Pulse

Use pulse run to execute your compiled application with the Pulse runtime.
You should see your message printed to the console:
That’s it — you’ve written, built, and run your first Kairo application.

Trying different entry point signatures

Kairo supports several valid signatures for the main function. You can return an exit code or a Result if your application needs to signal success or failure.
All three signatures also have async variants — for example, public async func main() — for applications that need to perform asynchronous work at startup.

What’s next?

Now that your first program is running, explore the rest of the language and toolchain.

Language Syntax

Learn Kairo’s syntax, keywords, and core constructs in detail.

Types

Explore Kairo’s built-in types and how to define your own value and object types.

Forge CLI

Master the full Forge command set: restore, build, test, package, and publish.