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 can be configured headlessly with `kosmokrator integrations:configure typst`.
# 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 --jsonkosmokrator integrations:doctor typst --jsonkosmokrator integrations:status --json
Runtime Requirements
Install these host dependencies before calling Typst locally.
Name
Type
Description
typst
binary
Typst CLI is required to render PDFs.
Credentials
Authentication type: No credentialsnone. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
No credentials are required.
Call Typst Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to Typst.
typst.render_typst
Write write
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
Use these parameter tables when building CLI payloads without calling integrations:schema first.
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
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.