Typstyle Docs

Installation & Setup

Typstyle can be installed and used in multiple ways. Choose the method that best fits your workflow.

CLI Installation

Download Binary

The easiest way to get started is to download the pre-built binary from the release page.

Package Managers

Packaging status

Typstyle is available in many package managers. Check the packaging status for your distribution.

Notably, typstyle is available in Archlinux CN repo.

Cargo Installation

Using cargo-binstall (Recommended)

cargo binstall typstyle
cargo binstall typstyle

Building from Source

cargo install typstyle --locked
cargo install typstyle --locked
Important
Installing without --locked--locked may fail due to API changes: an older typstyletypstyle could depend on a newer, incompatible typstyle-coretypstyle-core. Always use --locked--locked to ensure version compatibility.

Editor Integration

Typstyle has been integrated into tinymist. You can use it in your editor by installing the tinymist plugin and set tinymist.formatterModetinymist.formatterMode to typstyletypstyle.

VS Code (via Tinymist)

  1. Install the Tinymist extension
  2. Set tinymist.formatterModetinymist.formatterMode to "typstyle""typstyle" in your settings
  3. Enable format on save or use Ctrl+Shift+PCtrl+Shift+P → "Format Document"

Library Installation

Typstyle is also available as a library integrated in your project.

Cargo (Rust)

[dependencies]
typstyle-core = "=0.13.17"
[dependencies]
typstyle-core = "=0.13.17"
Important
Typstyle follows Typst’s major and minor versioning, and even patch releases may introduce breaking changes. We recommend pinning the version in your dependency and upgrading only when you require new features.

NPM (JavaScript/TypeScript)

For web projects using WebAssembly bindings:

npm install @typstyle/typstyle-wasm-bundler
npm install @typstyle/typstyle-wasm-bundler

The @typstyle/typstyle-wasm-bundler@typstyle/typstyle-wasm-bundler package provides WebAssembly bindings for web bundlers like Webpack, Vite, and Rollup. Please see its README for details.

GitHub Actions

The typstyle-action maintained by grayespinoza can install and run Typstyle in a GitHub Action.

- name: Run typstyle
  uses: typstyle-rs/typstyle-action@main
- name: Run typstyle
  uses: typstyle-rs/typstyle-action@main

Pre-commit Hook

You can use your local installation:

repos:
  - repo: local
    hooks:
      - id: typstyle
        name: typstyle
        entry: typstyle -i
        language: system
        files: \.typ$
        args: [] # set your style args here
repos:
  - repo: local
    hooks:
      - id: typstyle
        name: typstyle
        entry: typstyle -i
        language: system
        files: \.typ$
        args: [] # set your style args here

This method requires typstyle to be installed and available in your PATH.