texshelf

Using texshelf

One install gives you two commands. texshelf lists LaTeX templates by default and typshelf lists Typst ones. Everything else about them is the same, and either can create a project from any template.

Install

There are no prebuilt downloads yet. For now you need Rust, and then:

cargo install --git https://github.com/texshelf/texshelf texshelf

Homebrew, a shell installer and Windows packages will follow the first tagged release.

Create a project

texshelf init article my-paper

This downloads the template, checks it against the checksum in the index, unpacks it into my-paper/, asks for the title and author, and runs git init. It then prints the command that compiles the document. Nothing is compiled for you.

OptionWhat it does
article@1.0.0Use a specific version instead of the latest
--var title="Lab 3"Set a variable without being asked
--yesKeep the defaults for every variable
--no-gitSkip git init
--forceWrite into a folder that already has files

Find a template

texshelf search thesis --sort stars
CommandWhat it does
search [words]Search names, titles, keywords and descriptions. Filter with --category, --license, --official; order with --sort stars|newest|name|official.
info <name>License, versions, variables and file count
view <name>Open the prebuilt PDF preview. No TeX install needed.
open <name>Open the template in Overleaf, or in the Typst web app when it is on Typst Universe
updateRefresh the local copy of the index. This also happens by itself once a day.
doctor [file.tex]List the TeX and Typst tools on your machine and the packages a document needs but you lack

Add --engine all to search both engines at once, and --json to search or info for output a script can read.

Publish a template

Templates stay in your own repository. The registry holds one small file per version that says where the template lives, which commit to take, and how to compile it.

  1. Make sure the template compiles from a clean checkout and has a license that allows redistribution.
  2. Copy an existing manifest in the registry to templates/<name>/<version>.toml and fill it in. rev must be a full commit hash.
  3. Run texshelf validate on the file, then open a pull request.

CI fetches that commit, compiles it in a full TeX Live or Typst container without shell-escape, and attaches the rendered PDF to the pull request. Once it is merged, the template appears here and in the CLI within a few minutes. A published version never changes; to update a template, add a new version file.

What it stores on your machine

The index, downloaded archives and previews live in your user cache folder (~/Library/Caches/science.jjsm.texshelf on macOS, ~/.cache/texshelf on Linux). Deleting it is safe. Each project gets a .texshelf.lock file that records which template and version it came from.