← Kobo home

YOUR FIRST STEPS

Get started
with Kobo.

Install the tools, write a little Kobo, and build a real .NET app. Choose a standalone program or add Kobo to a C# project you already have.

PREVIEW 0.1.8·ABOUT 5 MINUTES
Download the complete guide
01

BEFORE YOU BEGIN

Get the .NET SDK.

Kobo targets .NET 11. Install the .NET 11 SDK, then verify it is available from your terminal:

TERMINAL
dotnet --list-sdks

Confirm that an 11.0 SDK is listed. Kobo is in preview, so the install commands below use prerelease packages.

02

STANDALONE APP

Build your first program.

Install the command-line compiler as a global .NET tool. This is the recommended way to download Kobo and get started with a standalone project:

INSTALL THE KOBO CLI
dotnet tool install --global thinkmine.kobo.lang --prerelease

Create a file named hello.kobo:

HELLO.KOBO
import System

module Examples/Hello

[public] class:Program
{
    [public, static] function:void Main(string[] args)
    {
        Console.WriteLine("Hello, world!")
    }
}

Compile it, then run the generated .NET assembly:

BUILD AND RUN
kobo build hello.kobo --output-directory ./build --name Hello
dotnet ./build/Hello.dll

The output includes Hello.dll and Hello.runtimeconfig.json. Keep both files to run the standalone app.

Already installed? Update the CLI with dotnet tool update --global thinkmine.kobo.lang --prerelease.
03

EXISTING C# PROJECT

Bring Kobo into your build.

Use BuildTools when you want Kobo and C# files in the same SDK-style project. The package discovers .kobo files automatically; no separate compile step is needed.

ADD THE BUILD COMPONENT
dotnet add package thinkmine.kobo.lang.buildtools --prerelease

Add Greeting.kobo to the project:

GREETING.KOBO
module Example/Greetings

[public] class:Greeting
{
    [public] function:string For(string name)
    {
        return $"Hello, {name}, from Kobo!"
    }
}

Call the Kobo-defined type from your existing C# code as usual:

PROGRAM.CS
using Example.Greetings;

var greeting = new Greeting();
Console.WriteLine(greeting.For("Ada"));

Now use dotnet build and dotnet run. Your project keeps control of dependencies, configuration, and the output assembly.

Compiler host: BuildTools requires a .NET 11 compiler host with Roslyn 5.9 or newer, including in the IDE. The target framework of the consuming app does not select the analyzer host.
Download the BuildTools package guide
04

ONE FILE, ONE UTILITY

Keep a script self-contained.

The CLI can also compile a single Kobo file as a standalone app, without a project file. Add optional SDK, build-property, or NuGet package directives at the top:

GREET.KOBO
#:sdk Microsoft.NET.Sdk
#:property Nullable=enable

import System

[public] class:Program
{
    [public, static] function:void Main(string[] args)
    {
        var name = args.Length > 0 ? args[0] : "world"
        Console.WriteLine($"Hello, {name}!")
    }
}
BUILD AND RUN
kobo build greet.kobo --output-directory ./build --name Greet
dotnet ./build/Greet.dll Ada

Add NuGet dependencies with #:package Package.Name@version. These directives apply to standalone single-file apps, not BuildTools or multi-file builds.

05
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.