KIRI DEVELOPERS
Build on Kiri
One SDK, in Go, Rust, TypeScript or Python. Write a module, your own program that Kiri runs beside your containers, or a plugin that adds something to Kiri itself.
Your program, run by Kiri. Change two lines of a web service and Kiri runs it as WebAssembly beside your containers. It starts in about a millisecond and reaches only what kiri.yaml lists.
Extend Kiri. Add a way to share, a place to deploy, a scanner, a check before a pull, or a tab, a column or a note in Kiri's window. People read its permissions before they install it.
Your first plugin kiri-plugin.tomlPlugin APIQuick start
From a web service you already have to a running module. The code follows the language you pick at the top of the page.
- Add the SDK to your project with your language's own tool. Kiri reads
go.mod,Cargo.toml,package.jsonorpyproject.toml. - Change two lines: the one that opens the database and the one that listens. Your handlers stay as they are.
- List what it may touch in
kiri.yaml: its port, its database, the sites it calls, its secrets. - Check, then run.
kiri checksays what WebAssembly can't run;kiri runbuilds and starts it. No Dockerfile.
// go get runkiri.com/go/kiri
db := kiri.DB() // was: sql.Open("sqlite3", "shop.db")
kiri.Serve(nil) // was: http.ListenAndServe(":8080", nil)// cargo add kiri
let db = kiri::db(); // was: a pool opened from DATABASE_URL
kiri::serve(app)?; // was: axum::serve(listener, app).await?// npm install @kiri/sdk
const db = kiri.db(); // was: new pg.Pool({ connectionString: … })
kiri.serve(app); // was: app.listen(8080)# pip install kiri
db = kiri.db() # was: sqlite3.connect("shop.db")
kiri.serve(app) # was: app.run(port=8080)$ kiri check .
shop · 41 packages
✓ 41 packages work as WebAssembly · 0 to change
$ kiri run .
● serving on :8080 · 2.1 MB · started in 1.2 ms
http://shop.kiri.localThe full quick start, from a plain Go program to a link you can share.
Six calls, the same in every language
A module asks Kiri for everything outside its own code. Each call needs its key in kiri.yaml, and Kiri refuses whatever the file doesn't list.
kiri.Servekiri::servekiri.servekiri.serveKiri listens on the port and your handler answers each request.
kiri.yaml: portkiri.DBkiri::dbkiri.dbkiri.dbA SQLite database kept by Kiri, or a connection to a real Postgres.
kiri.yaml: databasekiri.HTTPkiri::httpkiri.httpkiri.httpOutbound calls, only to the sites you list.
kiri.yaml: networkkiri.Secretkiri::secretkiri.secretkiri.secretA secret read from the system's keychain, never from a file.
kiri.yaml: secretskiri.KVkiri::kvkiri.kvkiri.kvKey-value storage that outlives restarts and rebuilds.
kiri.yaml: kvkiri.Logkiri::logkiri.logkiri.logLogs with levels and fields, in Kiri's window and your terminal.
kiri.yaml: always allowedEach returns the type your code already uses where there is one, such as Go's *sql.DB. The API reference has every signature.
Every place a plugin can use
A plugin names the places it wants. Each becomes one line in the install prompt, and Kiri draws what the plugin sends there in its own look. Pick a number to read about that place.
Compose
shop
- 1A note in the status bar[window] status
- 2Items in a row's menu, and commands[adds] actions, commands
- 3A tab, and a line at the top of a page[window] tabs, facts
- 4A page under the Plugins heading[window] page
- 5A section of its own, with its settings button[window] section
- 6A choice in Share with, Deploy to or Scan with[adds] share, deploy, scan
- 7A column of badges in a list[window] columns
- 8Notices, and system notifications[window] notices, notifications
- 9Fields in Settings[[settings]]
- 10Checks before pull, build and run[adds] checks: no place of their own
Examples
Worked plugins and a module, from setup to the code and the permissions behind them.
Two ways to share a port: a quick link with no account, and a link on your own domain.
Share withsettingsTSTailscalePluginShare on your tailnet, or to anyone with Funnel, with a note that says whether the tailnet is online.
Share withstatus barcontainerCOCoolifyPluginA place to deploy Compose projects, with a tab, its own section, a menu item and commands.
Deploy totabsectioncommandsTVTrivy scannerPluginScans images from their package list, marks them in a column and warns before a risky run.
Scan withcolumnpagecheckNLno-latestPluginThe first plugin: a check that blocks images with no fixed version, and counts its blocks.
checkstatus barSHshopModuleA small web shop as a module: orders in Postgres, payments through Stripe, a cache in KV.
ServeDBHTTPSecretKVPublish to the marketplace
Four commands take a plugin from your folder to everyone who uses Kiri: dev, check, test and publish.
Open source, under Apache 2.0
The SDK is open source under the Apache License 2.0, the same licence as Kiri's engine. Modules use WASI interfaces and are stored as OCI artifacts, so the code inside isn't tied to Kiri, and any registry that holds images holds modules.