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.