Skip to content
Subako Docs
English
Esc
↑↓navigate↵open⌘Jpreview
On this page

Examples

Example packages to build and use.

subako-function-examples holds complete packages, each a standalone project that builds the bundle Subako takes. They are a good place to start a package of your own, and most are useful granted as they are. The quickstart builds and grants anydoc.

Rust

Written with subako-function-sdk, each starting from the Rust template.

Example Tools What it does
anydoc convert_to_markdown Converts Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, and text-based PDF files on the volume to Markdown.
python run_python Runs Python code or scripts with CPython compiled to WebAssembly, with HTTPS through urllib.request and charts with pygal.
bashkit run_bash Runs bash scripts with pipes, about 145 built-in commands, the volume’s files, and a limited curl.
typst render_pdf Typesets Typst or Markdown into PDF, from a template shipped in the package’s assets.
quickjs run_javascript Runs JavaScript in QuickJS, with fetch and the volume’s files.
pptx create_pptx Builds PowerPoint decks from JavaScript with PptxGenJS.
html render_html Draws HTML to PNG, so an agent can check the layout of HTML it wrote, and names elements that overflow the viewport.
github github_api, read_file, … Reads GitHub: any read-only REST path, files and directories, and whole repositories downloaded to the volume, with an optional token from a vault.
cd rust/anydoc
cargo test
./package.sh                      # dist/<name>.tar.gz

Go

Written with subako-function-sdk-go, starting from the Go template.

Example Tools What it does
xlsx create_xlsx, read_xlsx Writes Excel workbooks on the volume — formulas, a frozen header row, column widths, number formats — and reads them back with formulas calculated.
cd go/xlsx
go test ./...
bash package.sh                   # dist/xlsx.tar.gz

In the SDK repositories

Each SDK’s own repository has a GitHub example — a repository’s stars and issues, and its owner’s avatar saved to the volume and shown to the model:

Granting an example

Most examples need nothing but Allow and, for files the agent should keep, Give functions Data (/volume/data). Those that reach the network — python, bashkit, quickjs, github — need the grant’s network to allow the hosts they call, and github takes its token from a vault through credentials for https://api.github.com. Each example’s README says what it needs.

Was this page helpful?