SDK
Install the Miblo SDK (TypeScript and Python) and get a token
Install @miblo/status or miblo-status, get the token with miblo sdk token, run your first program and let Miblo run it for you with miblo apps add.
Before you start
Miblo 1.30.0 or newer installed on the computer (with the app or the command line), with the
miblocommand in your terminal. Check withmiblo sdk status;miblo updatebrings the newest. A Miblo on your desk needs 1.30.0 or newer too (the computer updates it).Node.js 20+ for the TypeScript package, or Python 3.9+ for the Python package.
A Miblo on your desk is optional. With no gadget paired everything works, and actions answer
delivered: 0, which is not an error: sessions still show in Miblo Hub and in Miblo Remote.
Install the package
The packages come only from miblo.ai, version 2.4.0. They are not on npm or PyPI: install straight from the address. Coming from an SDK 1.x? Install this one over it: Miblo 1.30.0 and newer refuse 1.x (upgrade). To update an SDK 2.x, install the package again from the same address; what each version brought is in What's new in the SDK.
TypeScript / Node.js
@miblo/status: ESM, typed (index.d.ts), no dependencies.
npm install https://miblo.ai/dl/sdk/miblo-status-2.4.0.tgzPython
miblo-status: standard library only.
python3 -m venv .venv && . .venv/bin/activate # a Python from Homebrew or a Linux distribution refuses a global pip install
pip install https://miblo.ai/dl/sdk/miblo_status-2.4.0-py3-none-any.whlCheck the download
Each file has its Ed25519 signature next to it (the same name with .sig), made with the key of Miblo's updates (public key LGtuUvDA506N8iD1tolbQzWAJBb9hUerW0OH4C2pBek=), and the signed SHA256SUMS lists every version. The checksum, then the signature (Node only, no other tool):
curl -fLO https://miblo.ai/dl/sdk/miblo-status-2.4.0.tgz
curl -fsSL https://miblo.ai/dl/sdk/SHA256SUMS | shasum -a 256 -c --ignore-missing
curl -fLO https://miblo.ai/dl/sdk/miblo-status-2.4.0.tgz.sig
node -e 'const c=require("crypto"),fs=require("fs"),f=process.argv[1];const k=c.createPublicKey({key:{kty:"OKP",crv:"Ed25519",x:Buffer.from("LGtuUvDA506N8iD1tolbQzWAJBb9hUerW0OH4C2pBek=","base64").toString("base64url")},format:"jwk"});console.log(c.verify(null,fs.readFileSync(f),k,Buffer.from(fs.readFileSync(f+".sig","utf8").trim(),"base64"))?"signature ok":"BAD signature")' "$(basename https://miblo.ai/dl/sdk/miblo-status-2.4.0.tgz)"The token
The Status API is off until you create its token. In your own terminal:
export MIBLO_TOKEN=$(miblo sdk token) # turns the API on; the token goes into the variable, not on screenPrefer no terminal? In Miblo Hub → Programs (SDK) you turn the API on, copy the token and replace it.
The packages read the token from
MIBLO_TOKEN(or take it as a parameter:new MibloStatus({ token }),MibloStatus(token=...)). Hand the token to your program on purpose; a program should not go looking for Miblo's files.miblo sdk token --rotatereplaces the token (and prints the new one): whoever held the old one is refused from then on (not_authorised), and your AI tools, the CLI and Miblo Remote are not affected. Programs Miblo runs for you (below) get the new token when they start again.miblo sdk offdeletes the token and turns the API off (sdk_off).miblo sdk statussays whether it is on and where the file is.The bridge must be running. Your AI tools start it, and so does
miblo sdk start.
First program
Ten lines: the program shows up as a session, works, says it needs you and finishes.
// first.mjs, in the folder where you ran npm install; run: node first.mjs
import { MibloStatus } from '@miblo/status';
const miblo = new MibloStatus(); // reads MIBLO_TOKEN
const job = await miblo.session({ tool: 'first.mjs', title: 'Deploy', detail: 'building' });
await new Promise((r) => setTimeout(r, 5000)); // ...your work...
await job.needsYou('confirm the deploy'); // Miblo alerts
await new Promise((r) => setTimeout(r, 10000));
await job.done('deployed');# first.py, with the .venv active; run: python3 first.py
import time
from miblo_status import MibloStatus
miblo = MibloStatus() # reads MIBLO_TOKEN
job = miblo.session("first.py", title="Deploy", detail="building")
time.sleep(5) # ...your work...
job.needs_you("confirm the deploy") # Miblo alerts
time.sleep(10)
job.done("deployed")What happens:
session()registers the session Deploy on Miblo Desk, in Miblo Hub and in Miblo Remote, with the linefirst.mjs · building.needsYou()moves it to needs you: Miblo Desk gives the question alert and the "needs you" counter goes up. On Miblo Remote, the session shows as Other tool: first.mjs.done()shows it as finished, with the finished alert. When the process exits, the session goes by itself (the package sends its own process'spid).
Let Miblo run your program
For a program that is always on (a screen app, a watcher), let Miblo's supervisor look after it. In your own terminal (an AI agent cannot do this for you):
miblo apps add "node steps.mjs" --cwd ~/code/steps --id steps
miblo apps enable steps # starts it now and every time Miblo starts
miblo apps logs steps # what the program printedMiblo starts the program with
MIBLO_TOKEN,MIBLO_PORTandMIBLO_APP_ID(the app's id), plusMIBLO_LANG(ptoren) and the system's basics (PATH, HOME, language, time zone, proxy). Nothing else from your environment goes along: keys in your shell never reach the program.Without
--id, the id comes from the file name (steps.mjs→steps); when that id is taken, Miblo adds-2,-3... (miblo apps addprints the id it chose). Use the same id the program declares inapp.declare(). Without--cwd, it runs in the folder you added it from.If the program exits, Miblo starts it again after 2 s, 10 s, 30 s, 2 min and then every 10 min; a program that stayed up for a minute counts as healthy and starts the waits over. While an app is on, the bridge stays up.
The log keeps the last 256 KB, and at most 64 KB every 10 seconds (the rest is dropped, with a line saying so).
miblo apps show <id>shows its state and how many times it restarted;miblo apps disable <id>turns it off;miblo apps remove <id>turns it off, takes its screen away and forgets the program and its settings.miblo apps listshows them all (the official ones, yours and the community's). In Miblo Hub, the Desk apps tab does the same with a switch per app.
Start an app: two paths
For a store app (a screen, or alerts people turn on with one click), start from the ready-made template and watch it in the simulator, with or without a Miblo on your desk:
With Miblo installed:
miblo apps new "My App" --page(the Miblo 1.45 page Desk app, the default way; without--pagethe template is the old, card one), thenmiblo apps dev my-app(the screen in your browser, reloaded on every save) andmiblo apps check my-app(the Desk App Store's rules).Without Miblo: download the starter https://miblo.ai/dl/extras/miblo-app-starter-1.48.0.zip and use
node sim.mjs new | dev | check(Node 22.15+, 23.5+ or 24+; on another Node, pointMIBLO_NODEat a suitable one).
The details are in Develop without a Miblo.
When something goes wrong
Every error is a MibloError with a stable code. The ones you meet while setting up:
code | What it means | What to do |
|---|---|---|
upgrade | This SDK is older than Miblo accepts (an SDK 1.x on Miblo 1.30.0 or newer) | Install the SDK above (2.4.0) |
bridge_outdated | Miblo on the computer is older than this SDK | miblo update |
no_token | No token in MIBLO_TOKEN or the parameter | export MIBLO_TOKEN=$(miblo sdk token) |
sdk_off | The API is off on this computer | miblo sdk token |
bridge_unavailable | Nothing answers on Miblo's port | miblo sdk start (or open an AI tool) |
not_authorised | Wrong or rotated token, or a Miblo from before the SDK existed | Get the token again; update Miblo |
unverified_answer | The answer was not signed by Miblo | Something took Miblo's port: restart the bridge |
timeout | The bridge did not answer in time | Try again; check miblo status |
The other codes are in Sessions and status and The App screen.