Native Shell
Native Shell:AI 生成的 UI,在你的應用中原生呈現,涵蓋每個平台。iOS、Android、macOS、Windows 與 Linux 上的應用、GPUI 應用與網頁在執行時載入已簽名、沙箱隔離的 TSX 模組並繪製 th
AI 翻譯
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Give your web app a command line, for people and AI agents. Register commands once: get a console, help and man pages, and WebMCP tools.
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗One set of commands for your web app: people type them, AI agents call them. Try it live →
Sutram turns what your web app can do into commands. WebMCP is how a page hands tools to an agent; Sutram decides what those tools are. Every part of the app (a form, the navigation, a module) registers its commands in one registry, the same way. Register a command once, and it is there for everyone:
Sutram.call().› help
cart add <sku> [qty] Add a product to the cart
cart status Show what is in the cart [read-only]
checkout Place the order [consequential]
› cart add V60-02 --qty=2
Added 2 × V60 dripper, size 02. The cart has 2 items, €48.00.
› checkout
Place an order for 2 items, €48.00? [Yes] [No]
help, man, Tab completion, history and
"did you mean". You write no help pages.Save this as an HTML file, open it in a browser and press ` (the key left of 1):
<!doctype html>
<meta charset="utf-8">
<title>Hello, Sutram</title>
<p>Press <kbd>`</kbd> and type <code>help</code>.</p>
<script type="module">
import Sutram from "https://cdn.jsdelivr.net/npm/@d34dman/[email protected]/dist/sutram.js";
Sutram.register({
name: "hello world",
provider: "hello",
description: "Say hello",
input: {
type: "object",
properties: { who: { type: "string", default: "you", description: "Who to greet" } },
},
positional: ["who"],
annotations: { readOnly: true },
run: ({ who }) => ({ text: `Hello, ${who}.` }),
});
Sutram.mountConsole();
</script>
Then try:
› help
› hello world
› hello world Ada
› hello world --who="Grace Hopper"
› hello world -h
› man hello world
npm install @d34dman/sutram
Other ways in:
dist/sutram.js as a module from a CDN, as in
the quick start. It sets up the console and WebMCP for you.drupal/sutram
module.See Install for the details.
Without Sutram, an agent reads the page (screenshots, snapshots, HTML), works out what to click, then reads the page again to see whether it worked. With Sutram, it reads a short list of commands and runs them:
form fields node-article-form
form set node-article-form title "Pour-over, step by step"
form submit node-article-form
When something is wrong, the error names the field and the fix, so the agent corrects one value instead of starting over.
On the Drupal demo, Claude Code built a Canvas page with half the task tokens and 7 fewer calls (21 instead of 28) than the same agent without Sutram, and edited an article in 11 calls instead of 14. One run each, so a direction, not a benchmark. See Why commands and the measurements.
WebMCP lets a page hand tools to an agent. It does not say which tools, how they are named, or how many parts of an app share one page. Sutram is that layer, and WebMCP is one of the ways out of it.
form set <form> … is the tool form_set for every form, not one
tool per form. Commands look up their target when they run and answer "not
on this page" when it is gone, so the tool list stays put.help, man, status), errors that
name the fix, changes to wait for (events wait) or poll (events recent), and app-defined formats.
What WebMCP has no field for, like what a command returns or that it leaves
the page, goes into the tool description.Sutram.call() or the console. Browsers with WebMCP
get native tools, and your code does not change when support arrives.Sutram registers its tools through WebMCP's own registerTool(), and it never
reads or changes the page's HTML: your app's JavaScript says what the commands
are. It does not replace Playwright or browser agents either. They drive the
browser; Sutram gives them commands to call instead of buttons to click.
For one app with a few fixed actions, plain WebMCP is enough. Sutram earns its place when several parts of an app share a page, or when people should use the same commands as the agent.
Read it at d34dman.github.io/sutram/docs
or in docs/. Most apps need only these four:
Later, when you need them: forms, batches, formats, events and the API reference.
llms.txt
and llms-full.txt. Every
docs page is also published as Markdown.skills/:
use a Sutram page for agents that drive
a browser, and add Sutram to an app for
coding agents.Sutram.agentPrompt(task) hands a task to an agent that
drives a browser. The agent opens the console and starts with help.git clone https://github.com/d34dman/sutram.git
cd sutram
npm test # node --test, no dependencies to install
npm run example # a todo list to play with, at http://localhost:8080/example/
npm run build # dist/sutram.js
npm run site # the website and docs, at http://localhost:8080/site/
npm run docs # regenerate the generated docs (API, measurements, skill, llms.txt)
See CONTRIBUTING.md.
Sūtram (सूत्रम्) is Sanskrit for a short, exact rule. Pāṇini described all of Sanskrit grammar in about 4,000 of them. In Malayalam, sūtram (സൂത്രം) is also everyday speech for a knack, a clever little device. Each command is a sūtram: one short line in place of clicks and screenshots.
Version 0.8, early. Sutram follows semantic versioning
for its JavaScript API: register() and command definitions, the kits'
adapters, annotations, the policy, exit codes, the result envelope
({ code, text, data } or { code, message }), the entry points and their
types. Until 1.0, a breaking change there bumps the minor version (0.8 → 0.9).
The commands themselves are not part of that promise: the kits' command
names, their parameters, what they print and return in data, and the
WebMCP tool descriptions. Agents learn them on every page (help, man, the
tool list), so they may change in any release when that makes them work
better. We try not to, and the changelog lists every change
under Commands. Code that hard-codes command lines, such as tests that use
Sutram.call() or Sutram.exec(), should pin a version.
Your choice of MIT or GPL 2.0 or later
(MIT OR GPL-2.0-or-later). MIT fits most JavaScript projects; GPL fits
Drupal and other GPL software. Version 0.2.0 on npm was GPL only.