@termy-oss/ts-bindings
v0.1.0
Published
TypeScript bindings for termy plugin host
Readme
Termy TypeScript bindings
TypeScript SDK for Termy plugins that speak the existing newline-delimited JSON protocol over stdio.
What this package provides
- Protocol constants and manifest/message types aligned with
termy_plugin_core PluginSessionthat mirrors the Rust SDK handshake and message loop- Bun-friendly stdio support for plugins compiled to a single executable
Build the bindings package
bun install
bun run buildRun tests
bun test
bun run type-checkMinimal plugin example
Remember to install
bun add @termy-oss/ts-bindingsSee examples/hello-plugin/plugin.ts and examples/hello-plugin/termy-plugin.json.
The example follows the same flow as the Rust SDK:
- Read the host hello from stdin
- Reply with plugin hello
- React to
ping,invoke_command, andshutdown
Compile a Termy plugin to a single Bun executable
bun build --compile ./examples/hello-plugin/plugin.ts --outfile ./dist/hello-pluginThen point your plugin manifest at the compiled binary:
{
"schema_version": 1,
"id": "example.hello",
"name": "Hello Plugin",
"version": "0.1.0",
"description": "Minimal TypeScript Termy plugin compiled with Bun",
"runtime": "executable",
"entrypoint": "./dist/hello-plugin",
"autostart": true,
"permissions": ["notifications"],
"contributes": {
"commands": [
{
"id": "example.hello.run",
"title": "Run Hello",
"description": "Show a sample toast from the TypeScript example plugin"
}
]
}
}No Termy host change is required for Bun plugins in this model. termy_plugin_host already launches plugins as executables and communicates over stdio.
