Typst
$ typst 官方出品 低风险Typst(typst)是一款高速可编程排版系统,旨在替代 LaTeX 生成技术报告、论文与账单。采用 Rust 编写,单二进制即可将 .typ 文件编译为 PDF、SVG 或 PNG,并通过 typst query 以 JSON 提取标题与元数据。
brew install typst Typst 可在毫秒内将本地 .typ 文件编译为 PDF/SVG/PNG 并提供 typst query JSON 检索,直接作为 CLI 使用即可。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
单遍 typst compile 与支持 JSON 输出的 typst query,报错信息精准且退出码确定,完全无交互提示。
typst queryemits structured JSON for any selector- Deterministic millisecond compilation without multi-pass LaTeX reruns
文件访问受 --root 沙箱限制,且不存在类似 LaTeX --shell-escape 的任意命令执行风险。
- No
--shell-escapearbitrary code execution risk --rootconfines file reads to the project directory
单个自包含 Rust 二进制,无需动辄数 GB 的 TeX 发行版,可通过 Homebrew、Cargo 或二进制包安装。
brew install typstandcargo install --locked typst-cli
在 Agent 生成 PDF、技术报告和图表方面比 LaTeX 更快、更简洁且更易纠错。
- Supports PDF, SVG, PNG output and structured
queryintrospection
Typst GmbH 官方仓库(typst/typst)以 Apache-2.0 协议高频迭代。
- Official Typst GitHub organization
typst.app/docs 官方文档清晰现代,编译器错误提示极为友好。
- Official docs at typst.app/docs/
安全边界、鉴权与放权指南
无需任何凭据;纯离线编译器,仅在系统缓存目录保存可选的第三方包缓存。
CLI 开源免费(Apache-2.0);Typst 可选的在线协作 Web 平台提供免费版与付费版。
# Typst CLI Agent Rules - Run `typst compile` rather than `typst watch` in synchronous agent turns. - Pin `--root` to the project directory when compiling untrusted `.typ` files. - Use `typst query` to verify document structure or metadata programmatically.
Agent 高频安全命令配方
只读查询(安全推荐)
typst query main.typ "heading"
求值 Typst 文档并将匹配的标题或元素以结构化 JSON 输出,不写入文件。
typst fonts
列举 Typst 在本地发现的所有字体家族。
受控写入与预演
typst compile main.typ dist/main.pdf
将 main.typ 确定性地编译输出到 dist/main.pdf。
核心优势
- + 毫秒级单文件 Rust 编译器,彻底省去数 GB 体积的 TeX Live 环境。
- +
typst query可直接以干净 JSON 提取文档标题、标签与元数据。 - + 基于
--root的沙箱机制杜绝编译期的任意 Shell 执行风险。
注意事项与踩坑点
- !
typst watch会持续阻塞监听,不适合同步调用。 - ! 首次编译引用
@preview/...社区包时需联网拉取到本地缓存。