KosmoKrator

rendering

Typst CLI for AI Agents

Use the Typst CLI from KosmoKrator to call Typst tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

Typst CLI Setup

Typst can be configured headlessly with `kosmokrator integrations:configure typst`.

Install, configure, and verify
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure typst --enable --read allow --write ask --json
kosmokrator integrations:doctor typst --json
kosmokrator integrations:status --json

Runtime Requirements

Install these host dependencies before calling Typst locally.

NameTypeDescription
typst binary Typst CLI is required to render PDFs.

Credentials

Authentication type: No credentials none. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

No credentials are required.

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call typst.render_typst '{"markup":"example_markup","title":"example_title"}' --json
Provider shortcut
kosmo integrations:typst render_typst '{"markup":"example_markup","title":"example_title"}' --json

Discovery

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

Discovery commands
kosmo integrations:docs typst --json
kosmo integrations:docs typst.render_typst --json
kosmo integrations:schema typst.render_typst --json
kosmo integrations:search "Typst" --json
kosmo integrations:list --json

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

typst.render_typst

Render a Typst document to PDF. Pass valid Typst markup and get back a downloadable PDF link. Use this tool to generate formatted documents: reports, invoices, proposals, summaries, letters, tables, and more. Example markup: ``` #set page(margin: 2cm) #set text(size: 11pt) = Quarterly Report == Summary Revenue increased by *15%* compared to last quarter. #table( columns: (1fr, 1fr, 1fr), [*Metric*], [*Q1*], [*Q2*], [Revenue], [$1.2M], [$1.38M], [Users], [12,000], [15,400], ) ``` Key Typst syntax: - `= Heading` for headings (`==` for h2, `===` for h3) - `*bold*` for bold, `_italic_` for italic - `#table(columns: ..., [...], [...])` for tables - `#set page(margin: 2cm)` for page settings - `#set text(size: 12pt, font: "...")` for text settings - `- item` for bullet lists, `+ item` for numbered lists - `#line(length: 100%)` for horizontal rules - `#align(center)[...]` for alignment - `#v(1em)` for vertical spacing

Write write
Parameters
markup, title
Generic call
kosmo integrations:call typst.render_typst '{"markup":"example_markup","title":"example_title"}' --json
Shortcut
kosmo integrations:typst render_typst '{"markup":"example_markup","title":"example_title"}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

typst.render_typst 2 parameters
Schema command
kosmo integrations:schema typst.render_typst --json
ParameterTypeRequiredDescription
markup string yes Typst markup content to compile into a PDF document.
title string no Document title used as link text (default: "Document").

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.