CalmPilot
How to make an app

Describe an app. Watch an agent build it on your reader.

This page follows one app from a sentence to ScriptoHub: Stocks, a short list of share prices with a tile for Home. An agent wrote it on a BOOX Picco. Every screen here is from that reader or from CalmPilot Studio, and the code is the app's own.

You need a reader with CalmPilot, CalmPilot Studio, and an agent such as Claude Code. Or no agent at all: an app is a folder of Python, and the app guide is written for people too.

Home on the reader, with the Stocks tile under the book being read
Step 1

Give an agent the keys to your reader.

The reader speaks MCP, the protocol agents use for tools. Once an agent is connected it can put files on the card, run Python, open an app, read Home's tiles and see what the screen shows.

In CalmPilot Studio open About and choose Show all of Studio, then the gear and Agent. Copy the line it gives you into a terminal, once. Claude Code is shown; any agent that speaks MCP over HTTP can use the address under it.

Studio stays connected beside the agent, so you watch what it does as it does it.

Studio's Use with an agent panel, connected to a BOOX Picco, with the line to paste for Claude Code
Studio › Agent, with the Picco connected. The line carries the reader's own token, so keep it to yourself.
Step 2

Say what you want, in a sentence or two.

Make an app for CalmPilot: a list of stocks, with tiles for Home. The stocks are mainly entered in the web app, but can be added on the reader with the on-screen keyboard.
The whole brief, typed into Claude Code.

Before writing anything the agent read how CalmPilot apps and tiles are written, and the code of Weather, the nearest app to this one. Give yours the CalmPilot app guide: the app API, tiles, and a small app to start from. Then it settled four things and said so:

Nothing ticksStocks fetches when you open it, if what it has is over an hour old, or when you tap Refresh. A price that changes by itself on a reader is a feed.
A tile doesn't fetchHome imports the tile and nothing else. The tile shows what the app last kept, so Home stays quick and works with no network.
One place knows the sourcePrices come from Yahoo Finance's chart address, which needs no key and isn't a documented service. Two functions in quotes.py are all that would change for another.
Eight stocks at mostEight rows fit one screen. A list that scrolls on e-paper is a list nobody reads.
Step 3

The app is a folder of Python.

manifest.jsonIts name, icon and version; that it uses the network; the tile it offers Home; what Studio may set.
main.pyThe app: the list, one stock's month on its axes, Refresh, Add and Edit. 270 lines.
quotes.pyThe data, shared by the app and its tile: the list, what was last fetched, one function that knows where prices come from.
tile.pyThe tile for Home, in three sizes. 52 lines.
icon.png, README.mdIts icon, and what it is and does.
studio/A picture of each tile, for Studio to show. It stays off the reader.

CalmPilot calls three functions: on_load when the app opens, on_draw for a frame, on_input for a tap or a key. The top row with the time and the battery is CalmPilot's; the app's part of the screen is 480 by 748 below it.

Buttons, the line under the top row and the rules between rows come from CalmPilot's own parts, imported as ui, so the app looks like the rest of the reader without trying.

stocks/manifest.json
{
"app_id": "stocks",
"display_name": "Stocks",
"version": "1.0.0",
"description": "A short list of stocks: the last price, the day's change and a month at a glance.",
"entry": "main.py",
"api": "2.4",
"permissions": [
"net"
],
"icon": "chart-line"
}
main.py: the list
def draw_list(g):
if screen == "edit":
ui.info(g, "The top ones show on Home")
else:
at = hhmm(cache["updated"])
ui.info(g, "%d stocks" % len(syms) if len(syms) != 1 else "1 stock", ("as of " + at) if at else None)
small, medium = kit.font("small"), kit.font("medium")
for k, s in enumerate(syms):
y = ui.INFO_H + k * ROW
q = cache["quotes"].get(s)
g.text(ui.PAD, y + 12, s.lstrip("^"), {"font": medium, "bold": True})
g.text(ui.PAD, y + 42, kit.short(q["name"], 18) if q else "No price yet", {"font": small})
if screen == "edit":
# up, down and off the list: three places 56 wide at the right (EDIT_X)
for name, x, live in (("arrow-up", EDIT_X[0], k > 0), ("arrow-down", EDIT_X[1], k < len(syms) - 1),
("x", EDIT_X[2], True)):
if live:
g.icon(name, x + 28, y + ROW // 2, {"size": 30})
elif q:
Q.spark(g, q["closes"], 232, y + 18, 84, ROW - 36)
g.text(W - ui.PAD, y + 12, Q.money(q["price"]), {"font": medium, "align": "right"})
g.text(W - ui.PAD, y + 42, Q.pct(Q.day(q)), {"font": small, "align": "right"})
ui.rule(g, ui.PAD, y + ROW - 1, W - 2 * ui.PAD)
if not syms:
g.text(ui.PAD, ui.INFO_H + 24, "Tap Add to choose a stock.", {"font": medium})
Step 4

It runs on a computer first, then on the reader.

The agent wrote a test beside the app: a stand-in for the network, then 29 checks. The list from Studio is taken as it opens. A stock typed on the reader joins the list only once it has a price. With no Wi-Fi it says so and keeps what it had.

python3 test/stocks/test_stocks.py
# ok a stock typed on the reader is asked for first
# ok with no Wi-Fi it says so, once, and keeps what it has
# All passed

Then it copied the folder to /sd/apps/stocks/ on the reader's card, opened it and read the screen back. An app on the card is in Apps at once; nothing is installed or restarted.

Studio's terminal showing the agent's Python and its output: Stocks opened on the reader with no errors
Studio's terminal while the agent works. Lines marked [agent] are what it ran; under them, what the reader answered.
Stocks on the reader: three stocks, each with a line for the month, its price and the day's change; Refresh, Add and Edit at the foot
Anthropic's price on the reader: 108.43, 2.1% down today, 11.6% up since 19 Nov, and its closes as a line on axes of price and date
Step 5

Give it a tile for Home.

Two things make a tile. The manifest names it, the sizes it comes in and when it can change: "every": "data" means whenever the app's own files do, so the tile is drawn again after each fetch and each change to the list.

manifest.json
"tiles": [
{"name": "list", "title": "Stocks",
"sizes": ["1x1", "2x1", "2x2"], "every": "data"}
]

And tile.py beside main.py has one function. It returns a few words for CalmPilot to lay out as it lays out every app's tile, or draws the tile itself and returns nothing. Stocks does both: the first at 1×1, the second at the two larger sizes.

The tile shows the top of the list, so the order is worth changing on the reader: Edit has an arrow up, an arrow down and an x for each stock. Put another in the top three and Home shows it; put it first and the 2×2 tile shows its month.

Last, a picture of each tile at each size, such as studio/tile-list-2x1.png: what it looks like with something in it. Studio shows that on its Home, from ScriptoHub, so the reader has nothing to draw for it.

The Stocks tile at 1x1: GSPC 7,407.91, +0.1% today
1×1, laid out by CalmPilot
The Stocks tile at 2x1: three stocks with price and change
2×1, drawn by the app
The Stocks tile at 2x2: GSPC large over its month as a line, then ANT and NVDA
2×2, the top stock over its month
stocks/tile.py
import quotes as Q
ROW = 44
def tile(ctx, name, size, opts):
syms = Q.symbols(ctx)
have = Q.load(ctx)["quotes"]
rows = [(s, have[s]) for s in syms if s in have]
if not rows:
return {"label": "Stocks", "value": "–", "line": "Open Stocks to fetch prices"}
if size == "1x1":
s, q = rows[0]
p = Q.day(q)
return {"label": s.lstrip("^"), "value": Q.money(q["price"]), "line": Q.pct(p) + " today",
"icon": "trending-down" if p is not None and p < 0 else "trending-up"}
g, w, h = ctx.g, ctx.screen.width, ctx.screen.height
if size == "2x2":
lead(ctx, g, w, rows[0])
rows, top = rows[1:3], h - 2 * ROW
else:
rows = rows[:h // ROW]
top = (h - len(rows) * ROW) // 2
F = ctx.fonts
for k, (s, q) in enumerate(rows):
y = top + k * ROW
mid = y + ROW // 2
g.text(4, mid, s.lstrip("^"), {"font": F.medium, "valign": "middle", "bold": True})
g.text(w - 96, mid, Q.money(q["price"]), {"font": F.medium, "valign": "middle", "align": "right"})
g.text(w - 4, mid, Q.pct(Q.day(q)), {"font": F.small, "valign": "middle", "align": "right"})
if k or size == "2x2":
g.line(4, y, w - 4, y)
return None
def lead(ctx, g, w, row):
"""The first stock, large, over its month as a line, with the month's high and low beside it."""
s, q = row
F = ctx.fonts
c = q["closes"]
g.text(4, 6, s.lstrip("^"), {"font": F.medium, "bold": True})
g.text(w - 4, 6, Q.pct(Q.day(q)) + " today", {"font": F.medium, "align": "right"})
g.text(4, 32, Q.money(q["price"]), {"font": F.size(56)})
if len(c) > 1:
x, y, cw, ch = 4, 116, w - 92, 116
Q.spark(g, c, x, y, cw, ch, 3)
g.text(w - 4, y, Q.money(max(c)), {"font": F.small, "align": "right"})
g.text(w - 4, y + ch, Q.money(min(c)), {"font": F.small, "align": "right", "valign": "bottom"})
Studio's Home panel: the reader's Home with the Stocks tile two wide under the current book
Studio's Home, as on the reader. Stocks is in the list under From apps as soon as its folder is on the card: drag it on, pull its corner for another size, Send to reader. The tile here is the app's own picture of it, as it looks once Stocks is on ScriptoHub; until then it is the app's icon and name.
Edit on the reader: each stock with an arrow up, an arrow down and an x to take it off the list
Step 6

Let Studio set what a keyboard would be slow at.

Typing eight ticker symbols on e-paper is nobody's idea of calm. So the manifest says what its owner may set, and Studio draws the form: Get apps, Stocks, Settings.

manifest.json
"settings": [
{"key": "symbols", "label": "Stocks", "type": "list",
"max": 8, "upper": true, "placeholder": "ANT",
"hint": "Ticker symbols as Yahoo Finance has them..."}
]

Studio sends the list to the reader, which checks it against the manifest and keeps it as settings.json among the app's own files. The app reads that file when it opens, and Add on the reader, with CalmPilot's keyboard, writes the same one. Home's tile follows, since the app's files changed.

A field is a list, a text or a choice.

Get apps in Studio with Stocks' settings open: ^GSPC, ANT and NVDA as removable entries, a box to add one, Send to reader
Get apps › Stocks › Settings.
Step 7

Share it on ScriptoHub.

There is nothing to install and nothing to build: ScriptoHub takes your Python as it is. Add one text file to it, SKILL.md. The lines at the top say what the app is, and what you write under them is its page.

stocks/SKILL.md
---
name: "Stocks"
description: "A short list of stocks."
version: 1.0.0
category: Apps
requires:
needs: [display, touch]
---
A short list of stocks, kept calm.
Tap one for its month in full.

category: Apps is what puts it in Get apps. Keep version the same here and in manifest.json.

  1. Open scriptohub.ai/upload and sign in with GitHub.
  2. Drop the folder on the page. It fills in the name and the version from your file.
  3. Press Publish ScriptO. A ScriptO is anything shared there, apps included.

ScriptoHub checks it for malware first, which takes from a minute to an hour or more, and checks each update too. Then it is under Get more in Get apps, in Studio and on the reader, for every CalmPilot. To update it, raise the version and drop the folder again: readers that have it are offered Update.

Use one nameThe folder, app_id and the name on ScriptoHub should be the same word. What the app keeps is filed under its id.
Leave the pictures out, for nowThe upload page takes text files only, so drop the folder without icon.png and studio/. The reader draws the icon your manifest names, and Studio shows that icon and the tile's name.
Whoever writes it

Four things that make an app feel at home.

Calm firstThe screen changes when it is touched, or when something on it really has changed. No badges, no counts, nothing that ticks.
Ink and paperThe panel is black and white while an app runs. Emphasis is bold or a heavier line; large black areas leave ghosts.
Keep, then showWrite what you fetch to the app's files. The app opens at once with it, and the tile has something to show.
Setup belongs in StudioAnything with typing, choosing from many or uploading goes in the page. The reader keeps the one-tap version.

See what others have made.

Chess, Weather, Word Hive and the rest are folders like this one. Each is on ScriptoHub with its source.

Get apps