Docs
KYLO docs
Wrap any command, pay only for the seconds it ran, and get back a receipt signed by the node that ran it.
Quickstart
Needs Node 22.5 or newer. The package has no dependencies.
# runs on your own machine, nothing charged (settlement: simulated)
npx kylo-cli run -- echo hello
# or install the command
npm install -g kylo-cli
Without --cloud the command runs on your machine with no sandbox. Seconds are metered and the receipt is signed for real by your own key, but no money moves. Use it to see how billing works before you fund anything.
Run on a node
Your account is the ed25519 key in ~/.kylo/key.pem. There is no sign-up and no API key: every request is signed with that key, timestamped, and carries a one-time nonce.
export KYLO_CLOUD=https://your-node.example
kylo account --cloud # id, balance, deposits
kylo run --cloud --worker python --budget 0.05 -- python3 -c "print(6*7)"
Opening a session holds the budget from your balance. Closing it pays for every started second the sandbox was up and returns the rest. When the budget runs out the sandbox is destroyed on the spot, and run exits with 124.
Fund your account
Balances are funded by depositing the node's stablecoin into the KyloVault contract. The node watches Deposited events and credits your account after the configured number of confirmations.
- In the browser: run
kylo fund --cloudfor a link with your id filled in, connect a wallet, approve, deposit. - From a script:
approve(vault, amount)on the token, thendeposit(bytes20 account, uint256 amount)on the vault. Selector0x6503126e.
A node can watch vaults on several EVM chains at once; deposits from all of them credit the same account. The chains, vaults and token addresses are on the fund page and in GET /api/node (deposits). Deposits cannot be withdrawn; unused session budget always returns to your balance.
Sandbox limits
Each session gets its own Docker container with no network, all Linux capabilities dropped, a non-root user, a pids limit and a read-only root filesystem. Nodes can run it under gVisor (KYLO_DOCKER_RUNTIME=runsc), a user-space kernel that keeps code further from the host. Workers: shell (Alpine 3.20), python (3.12), node (22). Several commands: sh -c 'cmd1 && cmd2'.
Web console
Everything the CLI does for an account, in the browser at /app: balance, a 14-day usage chart, a runner with a budget slider, every receipt (inspect, verify, download), and deposits by chain.
- Sign in with a wallet: connect, sign one message (no transaction, no gas). The key is derived from that signature, so the same wallet always opens the same account.
- Create a key in the browser, or import the CLI's
~/.kylo/key.pem. Export it any time to use the same account from the CLI.
The key is kept in the browser's local storage and signs every request; it never leaves the browser.
Commands
| Command | What it does |
|---|---|
| run -- <cmd> | Runs the command, meters it, stops it when the budget runs out, saves the signed receipt. --budget, --worker, --cloud [url], --public, --json. |
| account | Your account id. With --cloud: balance, deposits and recent sessions. |
| fund | Prints the fund link for your account. |
| quote <seconds> | What that many seconds cost. |
| receipts | Every receipt on this machine, newest first. --json for scripts. |
| verify <file> | Checks a receipt's signature and arithmetic. --node <id> to require a specific node. |
| whoami | Your key's id and public key. |
| mcp | Starts an MCP server on stdio for agents. |
MCP for agents
Give an agent four tools: kylo_run, kylo_quote, kylo_verify, kylo_account.
{
"mcpServers": {
"kylo": { "command": "npx", "args": ["kylo-cli", "mcp", "--cloud", "https://your-node.example"] }
}
}
SDK
import kylo from "kylo-cli";
const s = await kylo.open({ worker: "python", budget: "0.10", cloud: "https://your-node.example" });
await s.exec("echo 'print(6*7)' > main.py");
const out = await s.exec("python3 main.py"); // { code, stdout, stderr, seconds, spent }
const receipt = await s.stop();
Receipts
Every session ends in a JSON receipt, saved under ~/.kylo/receipts/.
{
"v": 1, "mode": "cloud", "session": "0x7f3a…c21e", "account": "0x6158…8347",
"worker": "python", "image": "python:3.12-slim",
"opened": "…", "closed": "…", "seconds": 412,
"rate": "0.000400", "currency": "USDG",
"budget": "2.000000", "paid": "0.164800", "refund": "1.835200",
"status": "completed", "settlement": "ledger",
"execs": [{ "cmd": "python3 scraper.py", "code": 0, "signal": null }],
"output": "sha256:91c7…",
"node": { "id": "0xbf86…c85d", "pub": "MCow…" },
"sig": "5d0a…"
}
outputis the sha256 of every byte the commands wrote to stdout and stderr, in arrival order.sigis an Ed25519 signature over the canonical JSON (keys sorted, no whitespace) of every other field.node.idis the first 20 bytes of sha256 of the node's public key, so a receipt cannot swap in another key.- Verifiers also check
paid + refund = budgetandpaid = min(budget, seconds × rate). - Statuses:
completed,budget_exhausted,idle_timeout,interrupted,node_shutdown.
HTTP API
| Endpoint | |
|---|---|
| GET /api/node | Rate, limits, workers, node key, vault and token. |
| GET /api/stats | Sessions, seconds, paid, accounts, deposits. |
| GET /api/feed | Latest closed sessions; private ones are masked. |
| GET /api/receipt/:id | A public session's receipt. |
| POST /api/try | {worker, cmd} on the public try account, rate limited. |
| GET /v1/account | Signed. Balance, held, deposits, sessions. |
| POST /v1/run | Signed. {worker, budget, cmd, public?} → output + receipt. |
| POST /v1/sessions | Signed. Opens a session: {worker, budget}. |
| POST /v1/sessions/:id/exec | Signed. {cmd}; files in /work persist between calls. |
| POST /v1/sessions/:id/stop | Signed. Closes and returns the receipt. |
Signed requests carry x-kylo-pub, x-kylo-ts, x-kylo-nonce and x-kylo-sig, an Ed25519 signature over METHOD\nPATH\nTS\nNONCE\nsha256(body). Requests older than 60 s or with a reused nonce are refused.
Trust model
Be clear about what is on-chain and what isn't:
- On-chain: deposits. Anyone can see what went into the vault and for which account id.
- Off-chain (the node's ledger): balances and per-session charges. Receipts make every charge provable and tamper-evident, but you are trusting the operator to honor your balance and run your command honestly.
- Not withdrawable: deposits are prepaid compute. Deposit what you plan to spend.
- Beta: the vault uses audited OpenZeppelin building blocks but has not itself been audited.