Tinymist Docs

Command Line Interface (CLI)

The difference between typst-cli and tinymist-cli is that the latter one focuses on the features requiring code analysis or helping the language server. For example, tinymist-clitinymist-cli also provides a compilecompile command, but it doesn’t provide a queryquery or watchwatch command, which are provided by typst-clitypst-cli. This is because tinymist compiletinymist compile also collects and saves the compilation commands needed by the language server.

Servers

Starting a Language Server Following LSP Protocol

To start a language server following the Language Server Protocol, please use the following command:


                                
tinymist lsp

                                
tinymist lsp

                                
tinymist lsp

                                
tinymist lsp

Or simply runs the CLI without any arguments:


                                
tinymist

                                
tinymist

                                
tinymist

                                
tinymist

Starting a Preview Server

To start a preview server, please use the following command:


                                
tinymist preview path/to/main.typ

                                
tinymist preview path/to/main.typ

                                
tinymist preview path/to/main.typ

                                
tinymist preview path/to/main.typ

See Arguments.

Starting a debug adapter Server Following DAP Protocol

To start a debug adapter following the Debug Adapter Protocol, please use the following command:


                                
tinymist dap

                                
tinymist dap

                                
tinymist dap

                                
tinymist dap

Commands

Compiling a Document

The tinymist compiletinymist compile command is compatible with typst compiletypst compile:


                                
tinymist compile path/to/main.typ

                                
tinymist compile path/to/main.typ

                                
tinymist compile path/to/main.typ

                                
tinymist compile path/to/main.typ

To save the compilation command to the lock file:


                                
tinymist compile --save-lock path/to/main.typ

                                
tinymist compile --save-lock path/to/main.typ

                                
tinymist compile --save-lock path/to/main.typ

                                
tinymist compile --save-lock path/to/main.typ

To save the compilation command to the lock file at the path some/tinymist.locksome/tinymist.lock:


                                
tinymist compile --lockfile some/tinymist.lock path/to/main.typ

                                
tinymist compile --lockfile some/tinymist.lock path/to/main.typ

                                
tinymist compile --lockfile some/tinymist.lock path/to/main.typ

                                
tinymist compile --lockfile some/tinymist.lock path/to/main.typ

The lock file feature is in development. It is to help the language server to understand the structure of your projects. See Configuration: tinymist.projectResolution.

Running Tests

To run tests, you can use the testtest command, which is also compatible with typst compiletypst compile:


                                
tinymist test path/to/main.typ

                                
tinymist test path/to/main.typ

                                
tinymist test path/to/main.typ

                                
tinymist test path/to/main.typ

The testtest command will defaultly run all the functions whose names are staring with test-test- related the the main file:


                                
#let test-it() = []

                                
#let test-it() = []

                                
#let test-it() = []

                                
#let test-it() = []

See Docs: Testing Features for more information.

Generating shell completion script

To generate a bash-compatible completion script:


                                
tinymist completion bash

                                
tinymist completion bash

                                
tinymist completion bash

                                
tinymist completion bash

Available values for the shell parameter are bashbash, elvishelvish, figfig, fishfish, powershellpowershell, zshzsh, and nushellnushell.

Logging

By default, logging is set to INFOINFO for LSP and DAP modes, and WARNWARN otherwise. This can be overridden with --verbose--verbose for previewpreview and testtest.

You can use more granular overrides by setting TINYMIST_LOGTINYMIST_LOG in the environment, or passing it as an argument with tinymist --log-filtertinymist --log-filter. Note that to override tinymist itself you will need to override individual modules; for example tinymist --log-filter tinymist_preview=debug preview main.typtinymist --log-filter tinymist_preview=debug preview main.typ.