Build your first plugin and see it on a chart
You will have a plugin of your own, myplugin, loaded in a headless kernel. It answers a verb, keeps a node and adds an indicator that draws under a chart. The plugin is three files: a manifest, a Python program and a TypeScript script.
You need Taji built from source (Build from source), jq, the network (the keyless kernel reads Yahoo's delayed bars), and Taji's Python, which runs the plugin:
bash engine/crates/taji/scripts/python.sh .python
cargo build -p taji-open
.python is Taji's interpreter with its SDK; TAJI_PYTHON names another. Every command runs from the repository root, in one shell.
1. Write the manifest
A plugin is a directory holding taji-plugin.toml and its program. The manifest says what the plugin registers, and Taji checks the program against it:
id = "myplugin"
name = "My plugin"
version = "0.1.0"
taji = ">=0.7, <0.8"
[process]
run = ["myplugin.py"]
python = {}
[[kernel.verbs]]
route = "myplugin/say"
name = "myplugin_say"
description = "Tell my plugin some text: it answers `{said}` and keeps it as its node `myplugin`."
schema = { type = "object", properties = { text = { type = "string" } }, required = ["text"] }
scopes = ["local", "agent", "page"]
[[kernel.nodes]]
path = "myplugin"
description = "the last text my plugin was told"
[[kernel.indicators]]
name = "bar_range"
source = "indicators/bar_range.ts"
id,name,version,tajiname the plugin and the contract range it speaks; this build's contract is0.7.0.[process]makes it a process plugin:runis the program, andpython = {}gives it the standard library and the SDK.{ lock = "requirements.lock" }instead adds exactly the hashed wheels a lock file lists.[[kernel.verbs]]declaresmyplugin/say, a call with a JSON Schema for its arguments, open to thelocal,agentandpagetokens.[[kernel.nodes]]declaresmyplugin, state the plugin sets and anyone reads atGET /read/myplugin.[[kernel.indicators]]adds a script indicator,bar_range, to the chart's catalog.sourceis a path inside the plugin's directory.
The fields are all in the manifest reference.
2. Write the program
The program registers exactly the verbs the manifest declares; the SDK refuses to start otherwise:
import taji
p = taji.plugin()
@p.verb("myplugin/say")
def say(args, bindings):
text = args.get("text")
if not isinstance(text, str):
raise taji.Refused(400, "bad_args", "`text` is a string")
p.set("myplugin", {"text": text})
return {"said": text}
p.run()
taji.plugin()reads the manifest beside the program.@p.verb("myplugin/say")handles the verb. A plain function runs on a thread; anasync defworks too.taji.Refusedanswers its own status and error. Any other exception answers500 python, its traceback in the plugin's log, except one whose class is namedRateLimited, which answers429 rate_limited.p.setsets the node, and the return value is the answer.p.run()speakstaji-plugin/1, JSON lines on stdio, until the kernel stops it.printgoes to the plugin's log, never to the protocol.
- The SDK's API is documented in
packages/taji-py/src/taji/__init__.py, including how to test a plugin with no kernel:plugins/pyecho/test_pyecho.pycallsp.handlewith one line the kernel would send. plugins/echois the same plugin in Rust:plugins/echo/src/main.rscallstaji_sdk::servewith its manifest.
3. Add the indicator
The script is one module whose default export is indicator({…}) from @taji/indicators, as in your first indicator. Bar range plots each bar's high-to-low range as a percent of its close, and a 20-bar average of it:
import { indicator, input, plot, ta } from "@taji/indicators";
export default indicator({
name: "Bar range",
pane: "own",
inputs: { length: input.int(20, { min: 2 }) },
plots: { range: plot.columns({ title: "Range %" }), avg: plot.line({ title: "Average", color: "#ff9800" }) },
setup: ({ inputs }) => ({ avg: ta.sma(inputs.length) }),
next(bar, s) {
const range = ((bar.high - bar.low) / bar.close) * 100;
return { range, avg: s.avg.next(range) };
},
});
pane: "own"draws it in a pane under the price.plotsare a column per bar and an orange line.nextruns once per bar and returns one number per plot.
- The kernel compiles and runs the script on its own lane, never in your plugin's process.
- The manifest row's
nameis the catalog name, so a chart binds it asbar_range.
4. Boot a kernel with your plugin
Copy the plugin into a plugins directory, then boot a headless kernel on throwaway state with TAJI_PLUGINS naming that directory. TAJI_WIRE=0 takes a free port. get and v call the wire, which authenticates every request by x-taji-token:
W=$(mktemp -d)
mkdir -p "$W/plugins" && cp -R docs/plugins/examples/first-plugin/myplugin "$W/plugins/"
boot() {
mkdir -p "$W/state" "$W/store" "$W/home"
export TAJI_NO_UPDATE_CHECK=1 TAJI_NO_REPORT=1 TAJI_STATE_DIR=$W/state TAJI_STORE_DIR=$W/store TAJI_HOME=$W/home
TAJI_PLUGINS=$W/plugins TAJI_HEADLESS=1 TAJI_WIRE=0 target/debug/taji > "$W/boot.log" 2>&1 &
until [ -s "$W/state/wire-token" ] && curl -sf -o /dev/null -H "x-taji-token: $(cat "$W/state/wire-token")" "localhost:$(cat "$W/state/wire-port")/"; do sleep 1; done
PORT=$(cat "$W/state/wire-port"); TOKEN=$(cat "$W/state/wire-token")
}
get() { curl -s -H "x-taji-token: $TOKEN" "localhost:$PORT/$1"; echo; }
v() { curl -s -H "x-taji-token: $TOKEN" -H 'content-type: application/json' -X POST "localhost:$PORT/verb/$1" --data-binary "$2"; echo; }
boot
get read/plugins | jq '.[] | select(.id == "myplugin") | {enabled, source, sandbox, indicators}'
You see your plugin's row: enabled is true, source is dev (a TAJI_PLUGINS plugin), sandbox names the confinement it runs under (seatbelt on macOS, bubblewrap on Linux, processcontainer on Windows), and indicators is ["bar_range"].
- The kernel checked the manifest and compiled the script at boot. The program has not started yet: a process plugin starts at its first call.
5. Call the verb and read the node
v myplugin/say '{"text":"hello"}'
get read/myplugin
You see the verb's answer, then the node:
{
"said": "hello"
}
{
"text": "hello"
}
Captured 2026-12-04 on a headless kernel.
- Your program started, answered
{"said": "hello"}and set its node. Its log is$W/state/plugins/myplugin/log. - Your agent finds the same verb over MCP through
describe, and may call it because the manifest opens it to theagenttoken.
6. Draw the indicator on the chart
The kernel opens a desk with a daily chart of equity:SPY; pane 1 is that chart. Bind bar_range to it:
DESK=$(get "" | jq -r .active)
v desk/$DESK/chart/1/add_indicator '{"pane_id":1,"definition":"bar_range","params":{}}'
You see the binding's node, whose last segment is its id, and seq, the number of the /ws/live frame that carries the change:
{
"node": "desk/01a24253-67b5-70b2-b759-8b7f233f1e79/chart/indicators/01a24253-6a01-7702-b21e-26c8cac4b15f",
"seq": 1796409091864211
}
The window, were it open, now draws Bar range in its own pane under SPY:

Captured 2026-12-04 on a headless kernel reading a made-up daily series for SPY.
params: {}takes the defaults, so the legend readsBar range 20.- The binding names the bare
bar_range, so it follows your plugin's script.
7. Stop the kernel
v ui/quit '{}'
wait
rm -rf "$W"
- The kernel stops your plugin's process with it.
If something goes wrong
bootnever returns. The kernel did not start: read$W/boot.log, and check thattarget/debug/tajiexists.- Your row reads
enabled: false. Taji refused the plugin, andreasonsays why: asourcethat is absolute, climbs out with..or is missing, a script that does not compile, or an indicator name another plugin registers. A manifest that does not parse gets no row at all; its error is in$W/state/taji.log. reasonstartsno sandbox:. This machine lacks the confinement Taji needs. A debug kernel started withTAJI_UNSANDBOXED=1runs plugins unconfined; a release kernel ignores it.- A verb answers
unknown_route. The kernel seated no plugin with that route: read the row'sreason. - A verb answers
500 python. Your program raised: the traceback is in$W/state/plugins/myplugin/log.
Next
- Add a data source: a Python plugin that serves a product of its own.
- Write a pane: a window pane that draws your node.
- Pack and install a plugin from a signed registry.
- The manifest reference: every field.