Script Widgets
A script widget is a small live indicator your own script puts in Omniscio's titlebar through the local API — a count, a status pill, a dot, a gauge or a trend line. Covers how to send one, what it may contain, how it is labelled, and how to remove, hide or add one back.
On this page
What it is
You write a small script — it watches your builds, a price, a to-do count, anything — and it tells Omniscio what to show. Omniscio draws a little widget in the top bar next to the built-in ones, and updates it every time your script sends a new value.
No plugin, no manifest, no install: one web request shows it, another updates it, another removes it. If you want a widget that opens its own page when clicked, build a plugin widget instead (plugin-widgets.md).
Where to find it
In the top titlebar, beside the other header widgets, as soon as a script sends one. Hover it to see its label — always "<name> · from a script" — followed by whatever tooltip text your script sent. Drag it left or right like any titlebar widget.
How it behaves
Sending one
Your script needs your Omniscio key, which lives in ~/.amc/cli-token on your computer. From a shell, the amc-api.mjs helper reads it for you and sends it:
node "$HOME/.claude/skill-content/omniscio-control/amc-api.mjs" PUT widgets/builds \
'{"name":"Builds","shape":"stat","value":"3","label":"failing","tone":"error","tooltip":"3 of 12 builds red"}'
The same call again with a new value updates it. Remove it with:
node "$HOME/.claude/skill-content/omniscio-control/amc-api.mjs" DELETE widgets/builds
A Node script that refreshes a widget every ten seconds:
const fs = require('node:fs')
const os = require('node:os')
const token = fs.readFileSync(`${os.homedir()}/.amc/cli-token`, 'utf8').trim()
async function show(value) {
await fetch('http://127.0.0.1:19519/widgets/open-tasks', {
method: 'PUT',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ name: 'Open tasks', shape: 'stat', value: String(value), tone: 'neutral', icon: 'ListChecks' })
})
}
setInterval(() => show(Math.floor(Math.random() * 10)), 10_000)
Make it stick — saved widgets
Don't want to keep a script running? Save the widget instead and Omniscio runs it for you — on its own schedule, hidden, and again after every restart. You (or any agent you ask) send the widget's name and a few lines of JavaScript once:
node "$HOME/.claude/skill-content/omniscio-control/amc-api.mjs" PUT saved-widgets/open-tasks \
'{"name":"Open tasks","refreshSeconds":60,"code":"console.log(JSON.stringify({shape:\"stat\",value:\"3\",icon:\"ListChecks\"}))"}'
The code prints one line of JSON — the same widget fields listed below. Anything printed before that last line (debug output) is ignored. It runs as a modern JavaScript module, so
await fetch(...)works at the top level.It can read Omniscio. Each run gets the app's address and your key in
AMC_CLI_PORTandAMC_CLI_TOKEN, so a widget can show anything the app knows:const res = await fetch(`http://127.0.0.1:${process.env.AMC_CLI_PORT}/deepseek/balance-forecast`, { headers: { Authorization: `Bearer ${process.env.AMC_CLI_TOKEN}` } }) const { data } = await res.json() console.log(JSON.stringify({ shape: 'stat', value: `$${Math.round(data.balance)}`, icon: 'Wallet' }))A saved widget's reads made with
fetchto the app's own address are counted against that widget, never against the shared allowance other unnamed scripts draw on, so a widget on a clock keeps its reading on a busy machine.Nothing to install — Omniscio runs the code with its own built-in engine.
It refreshes every
refreshSeconds(15 seconds at the fastest, 60 by default) and runs straight away when you save it.Check the code before you save it.
POST /saved-widgets/verifywith{ name, code }runs the code once and saves nothing, answeringpasswith the widget it would draw — orfailwith every problem named by field and limit. Saving also answers with its first run's result, so you never leave a widget you have not seen work.If the code breaks, a failed run changes nothing on screen — the widget keeps the last reading it drew. Click it to see the plain reason, the last reading that worked and when it was taken, when it will try again, and a Try again button that runs it at once. A failure that lasts ten minutes replaces that reading with a dash and the word "error"; a widget that has never worked shows the dash at once, and an app restart inside that window blanks it.
GET /saved-widgetscarries the same detail so you (or an agent) can fix it and save again.Hidden means stopped, never deleted: taking a widget off the header or out of the sidebar runs no code and leaves the saved widget and its code exactly as they were. It stays listed — in Settings → Widgets, in the Widget Library and in the sidebar's Add-a-widget picker — and adding it back runs it straight away rather than waiting out a failed attempt's backoff.
Remove it for good with
DELETE /saved-widgets/<id>— the only thing that deletes a saved widget or its code.
What a widget can contain
The same short description plugin widgets use — Omniscio picks every colour, font and pixel:
| Field | What it is |
|---|---|
name |
Your widget's name, up to 24 characters — shown as "<name> · from a script". No control or text-direction characters (they could reorder the "from a script" wording); Arabic, Hebrew and emoji names are fine |
shape |
A compact face — stat, pill, dot, gauge or sparkline — or a rich kind: list, chart, note or progress |
value |
Up to 8 characters |
label |
Up to 16 characters |
tooltip |
Up to 120 characters, shown after the app's own label |
tone |
A meaning — neutral, running, needs-you, error, ember or accent |
icon |
An icon name from Omniscio's list, such as Zap, Bell, ListChecks or ShieldCheck |
progress |
0 to 1, for a gauge |
series |
Up to 32 numbers, for a sparkline |
Anything else is refused with a plain reason. The short text limits are deliberate: the titlebar sits next to your account switcher, so nothing up there may be long enough to fake "Your session expired, sign in again".
Limits and safety
- Only your own key works. An AI session's limited key is refused, so no agent can change your titlebar with its own credentials.
- Six at a time. A seventh is refused until you remove one; nothing is ever pushed out.
- Update as often as you like, within reason. Omniscio redraws at most four times a second and ignores an update that changes nothing; one widget may update 60 times a minute.
- Cleared on restart — unless saved. A widget an outside script sends lives only while the app runs, so the script just keeps sending. A saved widget comes back on its own.
- Desktop only. They never appear on a paired phone.
Removing or turning them off
Right-click a script widget — in the titlebar, or its row in the ⋯ menu — and choose Remove from header to hide it; it stays hidden even while the script keeps sending. Undo on the toast that appears brings it straight back.
Nothing is lost by removing it. A removed script widget stays listed, under the app's own "<name> · from a script" label, everywhere you can add it again:
- Settings → Widgets, in the band of removed items, with Add back — it goes straight back on the header and runs at once, even if its last attempt had failed.
- The Widget Library, in the Top bar list — the row reads Not on the top bar, and Add puts it back and runs it.
- The sidebar's Add a widget picker, where it reads Removed from the top bar — add it back in Settings → Widgets.
Removing never deletes it: the saved widget and its code stay exactly as they were, and the only way
to delete one is DELETE /saved-widgets/<id>. Taking a script widget out of the sidebar works the
same way — the sidebar changes, the saved code does not.
To turn off every titlebar widget — plugin and script alike — switch Header Widgets off in Settings; while it is off, scripts get a plain "switched off" answer.
Related
- Customize Omniscio — the front door: every way to make the app your own, with a plain-language overview of each.
Plugin widgets (plugin-widgets.md) are the richer sibling — same faces, plus a click-to-open page drawn by the plugin. The built-in titlebar widgets and how to reorder them are in header-widgets.md.
A script widget — one your script is sending right now, or a saved one Omniscio runs for you — is listed in the Widget Library alongside every other widget in the app, with the same Add and Remove buttons, and in the sidebar's Add-a-widget picker. Removing it from any of them keeps the saved widget and its code.
Last verified 2026-11-21