Esc
Start typing to search...

Projects

A Keel project is a directory containing a keel.toml manifest file. The manifest declares your project's entry point and permissions, so you don't need to pass environment variables or flags on every invocation.

Creating a Project

Use keel init to scaffold a new project:

keel init my-project

This creates a my-project/ directory with a minimal project structure:

my-project/
  keel.toml
  src/
    main.kl
  modules/          -- user-defined file modules go here

For a data pipeline scaffold with IO and DataFrame permissions pre-configured:

keel init my-pipeline --template pipeline

Project Manifest

The keel.toml file describes your project:

[project]
name = "my-project"
version = "0.1.0"
main = "src/main.kl"
FieldRequiredDefaultDescription
nameYesProject name
versionYesProject version
mainNosrc/main.klEntry point for keel run

Permissions

Permissions sections control what capabilities your Keel code has access to. All sections are optional — missing sections keep the default behavior.

IO Permissions

[permissions.io]
enabled = true
read_only = false
sandbox = "./data"
FieldDefaultDescription
enabledfalseEnable file IO operations
read_onlyfalseRestrict to read-only file access
sandboxRestrict IO to this directory (relative to project root)

HTTP Permissions

[permissions.http]
enabled = true
allowed_hosts = ["api.example.com"]
FieldDefaultDescription
enabledfalseEnable HTTP requests
allowed_hostsRestrict requests to these hosts

DataFrame Permissions

[permissions.dataframe]
enabled = true
sandbox = "./data"
max_rows = 1_000_000
FieldDefaultDescription
enabledtrueEnable DataFrame operations
sandboxRestrict DataFrame file access to this directory
max_rowsMaximum number of rows allowed

Running a Project

From anywhere inside a project directory:

keel run

This finds the nearest keel.toml by walking up from the current directory, applies permissions, and runs the entry point.

You can also run a specific file while still using the project's permissions:

keel run src/other.kl

Running without a manifest and without a file argument produces an error:

keel run
# Error: No file specified and no keel.toml found

Project Templates

Minimal (default)

The minimal template creates a simple project with just an entry point:

"Hello from my-project!"

Pipeline

The pipeline template scaffolds a data pipeline with extract/transform/load steps using tasks:

-- my-pipeline data pipeline
-- Run with: keel run

let { data } = Task.run "steps/extract.kl" ()
let { transformed } = Task.run "steps/transform.kl" (data)
Task.run "steps/load.kl" (transformed)

It also pre-configures IO and DataFrame permissions with a ./data sandbox.

Next Steps