This is the examples/cookbook layer for Tenki, and this is your playbook. New here? Read this top to bottom once, then you're set.
- Get a Tenki account + key. Install the CLI and run
tenki login— it writes your token and default workspace to~/.config/tenki/config.yaml. The examples read from there automatically. - Node 20+.
- Run an example to confirm your setup works:
If that prints a ✓, you're ready.
cd examples/run-code-in-a-sandbox npm install node verify.mjs # ✓ create → exec python3 → 42 → dispose
Every example runs on Tenki and proves it in CI. A public example that doesn't work damages the brand more than a missing one helps.
- Each example ships a
verify.mjsthat exercises it against the live Tenki API and exits non-zero on any failure. - CI (
.github/workflows/verify.yml) runs everyverify.mjswith aTENKI_API_KEYsecret. A red build blocks the merge. verify.mjsproves the Tenki-facing part. If an example needs an LLM (an agent turn), verify the tool/backend against Tenki directly — don't require a model key in CI. (Seelangchain-code-interpreterfor the pattern.)
Any small, runnable example that shows one clear Tenki integration or workflow is welcome. Pick the shipped example closest to your idea and copy the pattern from it.
examples/<name>/
README.md # the tutorial — what it does, the whole integration, how to run
package.json # deps ("type": "module")
verify.mjs # CI-runnable proof it works against Tenki
<code> # the example itself (a script, agent/, tool + agent, …)
verify.mjs reads the token from TENKI_AUTH_TOKEN / TENKI_API_KEY (CI) or ~/.config/tenki/config.yaml (local), drives the Tenki-facing code, asserts the result, and cleans up any sandbox it created. Keep it under ~60 lines. Copy one from a shipped example.
Which template to copy:
- Direct SDK use →
run-code-in-a-sandbox - A framework agent + a code-execution tool →
langchain-code-interpreter - A pluggable sandbox backend for a framework →
vercel-ai-sdk
cp -rthe closest template toexamples/<your-name>/.- Swap in your code; keep it to one clear thing.
- Write
verify.mjs— assert the Tenki-facing result, clean up. - Run it:
node verify.mjs→ must print ✓. - Write the
README.md(the tutorial) — link back totenki.cloud, name the products used. - Add a row to the repo
README.mdexamples table. - Open the PR. CI runs your
verify.mjs. - Write the companion article (the example is the code; the article is the walkthrough).
- Short and runnable beats comprehensive. One clear thing per example.
- Name the Tenki products used; link back to
tenki.cloud. - Tenki confines file I/O to
/home/tenki— use relative paths. - Note any gotchas inline (e.g.
exec(cmd, { args })doesn't shell-split;allowOutbound: trueis needed for network).
Draft → content review (+ an engineer spot-checks technical accuracy) → publish. Then pick the next example and ship it.