Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Eval: Add --output to output to a file#8576

Open
Nerixyz wants to merge 1 commit into
typst:maintypst/typst:mainfrom
Nerixyz:feat/eval-outputNerixyz/typst:feat/eval-outputCopy head branch name to clipboard
Open

Eval: Add --output to output to a file#8576
Nerixyz wants to merge 1 commit into
typst:maintypst/typst:mainfrom
Nerixyz:feat/eval-outputNerixyz/typst:feat/eval-outputCopy head branch name to clipboard

Conversation

@Nerixyz

@Nerixyz Nerixyz commented Jun 26, 2026

Copy link
Copy Markdown

Some use-cases for typst eval (or previously typst query) include generating additional files. For example, with the touying package for presentations allows exporting speaker notes to a JSON file (docs). Users evaluate query(<pdfpc-file>).first().value to get the contents.

While it's easy to use file redirection when running the command to output to a file, the main motivation for this is the output of dependencies when used in a Makefile (#8577).

This PR adds the --output/-o argument. This is - (stdout) by default. If a file is specified, the output format will be inferred from the extension (similar to typst compile).

One semi-related change to the output of the command is that it no longer outputs two final newlines when the output format is YAML.

@laurmaedje laurmaedje added cli About Typst's command line interface. waiting-on-review This PR is waiting to be reviewed. labels Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli About Typst's command line interface. waiting-on-review This PR is waiting to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.