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.

1 functions 0 read 1 write No credentials auth

Typst CLI Setup

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 --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 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.

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

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:typst render_typst '{
  "markup": "example_markup",
  "title": "example_title"
}' --json

Agent Discovery Commands

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

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

All CLI Functions

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

Parameters
markup, title

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

Function Schemas

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

Operation
Write write
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.