#compdef typst

autoload -U is-at-least

_typst() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" : \
'--color=[Whether to use color. When set to \`auto\` if the terminal to supports it]:COLOR:(auto always never)' \
'--cert=[Path to a custom CA certificate to use when making network requests]:CERT:_files' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_typst_commands" \
"*::: :->typst" \
&& ret=0
    case $state in
    (typst)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:typst-command-$line[1]:"
        case $line[1] in
            (compile)
_arguments "${_arguments_options[@]}" : \
'-f+[The format of the output file, inferred from the extension by default]:FORMAT:(pdf png svg html)' \
'--format=[The format of the output file, inferred from the extension by default]:FORMAT:(pdf png svg html)' \
'--root=[Configures the project root (for absolute paths)]:DIR:_files' \
'*--input=[Add a string key-value pair visible through \`sys.inputs\`]:key=value:_default' \
'*--font-path=[Adds additional directories that are recursively searched for fonts]:DIR:_files' \
'--package-path=[Custom path to local packages, defaults to system-dependent location]:DIR:_files' \
'--package-cache-path=[Custom path to package cache, defaults to system-dependent location]:DIR:_files' \
'--creation-timestamp=[The document'\''s creation date formatted as a UNIX timestamp]:UNIX_TIMESTAMP:_default' \
'*--pages=[Which pages to export. When unspecified, all pages are exported]:PAGES:_default' \
'*--pdf-standard=[One (or multiple comma-separated) PDF standards that Typst will enforce conformance with]:PDF_STANDARD:((1.4\:"PDF 1.4"
1.5\:"PDF 1.5"
1.6\:"PDF 1.6"
1.7\:"PDF 1.7"
2.0\:"PDF 2.0"
a-1b\:"PDF/A-1b"
a-1a\:"PDF/A-1a"
a-2b\:"PDF/A-2b"
a-2u\:"PDF/A-2u"
a-2a\:"PDF/A-2a"
a-3b\:"PDF/A-3b"
a-3u\:"PDF/A-3u"
a-3a\:"PDF/A-3a"
a-4\:"PDF/A-4"
a-4f\:"PDF/A-4f"
a-4e\:"PDF/A-4e"
ua-1\:"PDF/UA-1"))' \
'--ppi=[The PPI (pixels per inch) to use for PNG export]:PPI:_default' \
'--make-deps=[File path to which a Makefile with the current compilation'\''s dependencies will be written]:PATH:_files' \
'--deps=[File path to which a list of current compilation'\''s dependencies will be written. Use \`-\` to write to stdout]:PATH:_files' \
'--deps-format=[File format to use for dependencies]:DEPS_FORMAT:((json\:"Encodes as JSON, failing for non-Unicode paths"
zero\:"Separates paths with NULL bytes and can express all paths"
make\:"Emits in Make format, omitting inexpressible paths"))' \
'-j+[Number of parallel jobs spawned during compilation. Defaults to number of CPUs. Setting it to 1 disables parallelism]:JOBS:_default' \
'--jobs=[Number of parallel jobs spawned during compilation. Defaults to number of CPUs. Setting it to 1 disables parallelism]:JOBS:_default' \
'*--features=[Enables in-development features that may be changed or removed at any time]:FEATURES:(html a11y-extras)' \
'--diagnostic-format=[The format to emit diagnostics in]:DIAGNOSTIC_FORMAT:(human short)' \
'--open=[Opens the output file with the default viewer or a specific program after compilation. Ignored if output is stdout]' \
'--timings=[Produces performance timings of the compilation process. (experimental)]' \
'--ignore-system-fonts[Ensures system fonts won'\''t be searched, unless explicitly included via \`--font-path\`]' \
'--ignore-embedded-fonts[Ensures fonts embedded into Typst won'\''t be considered]' \
'--no-pdf-tags[By default, even when not producing a \`PDF/UA-1\` document, a tagged PDF document is written to provide a baseline of accessibility. In some circumstances (for example when trying to reduce the size of a document) it can be desirable to disable tagged PDF]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':input -- Path to input Typst file. Use `-` to read input from stdin:_files' \
'::output -- Path to output file (PDF, PNG, SVG, or HTML). Use `-` to write output to stdout:_files' \
&& ret=0
;;
(c)
_arguments "${_arguments_options[@]}" : \
'-f+[The format of the output file, inferred from the extension by default]:FORMAT:(pdf png svg html)' \
'--format=[The format of the output file, inferred from the extension by default]:FORMAT:(pdf png svg html)' \
'--root=[Configures the project root (for absolute paths)]:DIR:_files' \
'*--input=[Add a string key-value pair visible through \`sys.inputs\`]:key=value:_default' \
'*--font-path=[Adds additional directories that are recursively searched for fonts]:DIR:_files' \
'--package-path=[Custom path to local packages, defaults to system-dependent location]:DIR:_files' \
'--package-cache-path=[Custom path to package cache, defaults to system-dependent location]:DIR:_files' \
'--creation-timestamp=[The document'\''s creation date formatted as a UNIX timestamp]:UNIX_TIMESTAMP:_default' \
'*--pages=[Which pages to export. When unspecified, all pages are exported]:PAGES:_default' \
'*--pdf-standard=[One (or multiple comma-separated) PDF standards that Typst will enforce conformance with]:PDF_STANDARD:((1.4\:"PDF 1.4"
1.5\:"PDF 1.5"
1.6\:"PDF 1.6"
1.7\:"PDF 1.7"
2.0\:"PDF 2.0"
a-1b\:"PDF/A-1b"
a-1a\:"PDF/A-1a"
a-2b\:"PDF/A-2b"
a-2u\:"PDF/A-2u"
a-2a\:"PDF/A-2a"
a-3b\:"PDF/A-3b"
a-3u\:"PDF/A-3u"
a-3a\:"PDF/A-3a"
a-4\:"PDF/A-4"
a-4f\:"PDF/A-4f"
a-4e\:"PDF/A-4e"
ua-1\:"PDF/UA-1"))' \
'--ppi=[The PPI (pixels per inch) to use for PNG export]:PPI:_default' \
'--make-deps=[File path to which a Makefile with the current compilation'\''s dependencies will be written]:PATH:_files' \
'--deps=[File path to which a list of current compilation'\''s dependencies will be written. Use \`-\` to write to stdout]:PATH:_files' \
'--deps-format=[File format to use for dependencies]:DEPS_FORMAT:((json\:"Encodes as JSON, failing for non-Unicode paths"
zero\:"Separates paths with NULL bytes and can express all paths"
make\:"Emits in Make format, omitting inexpressible paths"))' \
'-j+[Number of parallel jobs spawned during compilation. Defaults to number of CPUs. Setting it to 1 disables parallelism]:JOBS:_default' \
'--jobs=[Number of parallel jobs spawned during compilation. Defaults to number of CPUs. Setting it to 1 disables parallelism]:JOBS:_default' \
'*--features=[Enables in-development features that may be changed or removed at any time]:FEATURES:(html a11y-extras)' \
'--diagnostic-format=[The format to emit diagnostics in]:DIAGNOSTIC_FORMAT:(human short)' \
'--open=[Opens the output file with the default viewer or a specific program after compilation. Ignored if output is stdout]' \
'--timings=[Produces performance timings of the compilation process. (experimental)]' \
'--ignore-system-fonts[Ensures system fonts won'\''t be searched, unless explicitly included via \`--font-path\`]' \
'--ignore-embedded-fonts[Ensures fonts embedded into Typst won'\''t be considered]' \
'--no-pdf-tags[By default, even when not producing a \`PDF/UA-1\` document, a tagged PDF document is written to provide a baseline of accessibility. In some circumstances (for example when trying to reduce the size of a document) it can be desirable to disable tagged PDF]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':input -- Path to input Typst file. Use `-` to read input from stdin:_files' \
'::output -- Path to output file (PDF, PNG, SVG, or HTML). Use `-` to write output to stdout:_files' \
&& ret=0
;;
(watch)
_arguments "${_arguments_options[@]}" : \
'-f+[The format of the output file, inferred from the extension by default]:FORMAT:(pdf png svg html)' \
'--format=[The format of the output file, inferred from the extension by default]:FORMAT:(pdf png svg html)' \
'--root=[Configures the project root (for absolute paths)]:DIR:_files' \
'*--input=[Add a string key-value pair visible through \`sys.inputs\`]:key=value:_default' \
'*--font-path=[Adds additional directories that are recursively searched for fonts]:DIR:_files' \
'--package-path=[Custom path to local packages, defaults to system-dependent location]:DIR:_files' \
'--package-cache-path=[Custom path to package cache, defaults to system-dependent location]:DIR:_files' \
'--creation-timestamp=[The document'\''s creation date formatted as a UNIX timestamp]:UNIX_TIMESTAMP:_default' \
'*--pages=[Which pages to export. When unspecified, all pages are exported]:PAGES:_default' \
'*--pdf-standard=[One (or multiple comma-separated) PDF standards that Typst will enforce conformance with]:PDF_STANDARD:((1.4\:"PDF 1.4"
1.5\:"PDF 1.5"
1.6\:"PDF 1.6"
1.7\:"PDF 1.7"
2.0\:"PDF 2.0"
a-1b\:"PDF/A-1b"
a-1a\:"PDF/A-1a"
a-2b\:"PDF/A-2b"
a-2u\:"PDF/A-2u"
a-2a\:"PDF/A-2a"
a-3b\:"PDF/A-3b"
a-3u\:"PDF/A-3u"
a-3a\:"PDF/A-3a"
a-4\:"PDF/A-4"
a-4f\:"PDF/A-4f"
a-4e\:"PDF/A-4e"
ua-1\:"PDF/UA-1"))' \
'--ppi=[The PPI (pixels per inch) to use for PNG export]:PPI:_default' \
'--make-deps=[File path to which a Makefile with the current compilation'\''s dependencies will be written]:PATH:_files' \
'--deps=[File path to which a list of current compilation'\''s dependencies will be written. Use \`-\` to write to stdout]:PATH:_files' \
'--deps-format=[File format to use for dependencies]:DEPS_FORMAT:((json\:"Encodes as JSON, failing for non-Unicode paths"
zero\:"Separates paths with NULL bytes and can express all paths"
make\:"Emits in Make format, omitting inexpressible paths"))' \
'-j+[Number of parallel jobs spawned during compilation. Defaults to number of CPUs. Setting it to 1 disables parallelism]:JOBS:_default' \
'--jobs=[Number of parallel jobs spawned during compilation. Defaults to number of CPUs. Setting it to 1 disables parallelism]:JOBS:_default' \
'*--features=[Enables in-development features that may be changed or removed at any time]:FEATURES:(html a11y-extras)' \
'--diagnostic-format=[The format to emit diagnostics in]:DIAGNOSTIC_FORMAT:(human short)' \
'--open=[Opens the output file with the default viewer or a specific program after compilation. Ignored if output is stdout]' \
'--timings=[Produces performance timings of the compilation process. (experimental)]' \
'--port=[The port where HTML is served]:PORT:_default' \
'--ignore-system-fonts[Ensures system fonts won'\''t be searched, unless explicitly included via \`--font-path\`]' \
'--ignore-embedded-fonts[Ensures fonts embedded into Typst won'\''t be considered]' \
'--no-pdf-tags[By default, even when not producing a \`PDF/UA-1\` document, a tagged PDF document is written to provide a baseline of accessibility. In some circumstances (for example when trying to reduce the size of a document) it can be desirable to disable tagged PDF]' \
'--no-serve[Disables the built-in HTTP server for HTML export]' \
'--no-reload[Disables the injected live reload script for HTML export. The HTML that is written to disk isn'\''t affected either way]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':input -- Path to input Typst file. Use `-` to read input from stdin:_files' \
'::output -- Path to output file (PDF, PNG, SVG, or HTML). Use `-` to write output to stdout:_files' \
&& ret=0
;;
(w)
_arguments "${_arguments_options[@]}" : \
'-f+[The format of the output file, inferred from the extension by default]:FORMAT:(pdf png svg html)' \
'--format=[The format of the output file, inferred from the extension by default]:FORMAT:(pdf png svg html)' \
'--root=[Configures the project root (for absolute paths)]:DIR:_files' \
'*--input=[Add a string key-value pair visible through \`sys.inputs\`]:key=value:_default' \
'*--font-path=[Adds additional directories that are recursively searched for fonts]:DIR:_files' \
'--package-path=[Custom path to local packages, defaults to system-dependent location]:DIR:_files' \
'--package-cache-path=[Custom path to package cache, defaults to system-dependent location]:DIR:_files' \
'--creation-timestamp=[The document'\''s creation date formatted as a UNIX timestamp]:UNIX_TIMESTAMP:_default' \
'*--pages=[Which pages to export. When unspecified, all pages are exported]:PAGES:_default' \
'*--pdf-standard=[One (or multiple comma-separated) PDF standards that Typst will enforce conformance with]:PDF_STANDARD:((1.4\:"PDF 1.4"
1.5\:"PDF 1.5"
1.6\:"PDF 1.6"
1.7\:"PDF 1.7"
2.0\:"PDF 2.0"
a-1b\:"PDF/A-1b"
a-1a\:"PDF/A-1a"
a-2b\:"PDF/A-2b"
a-2u\:"PDF/A-2u"
a-2a\:"PDF/A-2a"
a-3b\:"PDF/A-3b"
a-3u\:"PDF/A-3u"
a-3a\:"PDF/A-3a"
a-4\:"PDF/A-4"
a-4f\:"PDF/A-4f"
a-4e\:"PDF/A-4e"
ua-1\:"PDF/UA-1"))' \
'--ppi=[The PPI (pixels per inch) to use for PNG export]:PPI:_default' \
'--make-deps=[File path to which a Makefile with the current compilation'\''s dependencies will be written]:PATH:_files' \
'--deps=[File path to which a list of current compilation'\''s dependencies will be written. Use \`-\` to write to stdout]:PATH:_files' \
'--deps-format=[File format to use for dependencies]:DEPS_FORMAT:((json\:"Encodes as JSON, failing for non-Unicode paths"
zero\:"Separates paths with NULL bytes and can express all paths"
make\:"Emits in Make format, omitting inexpressible paths"))' \
'-j+[Number of parallel jobs spawned during compilation. Defaults to number of CPUs. Setting it to 1 disables parallelism]:JOBS:_default' \
'--jobs=[Number of parallel jobs spawned during compilation. Defaults to number of CPUs. Setting it to 1 disables parallelism]:JOBS:_default' \
'*--features=[Enables in-development features that may be changed or removed at any time]:FEATURES:(html a11y-extras)' \
'--diagnostic-format=[The format to emit diagnostics in]:DIAGNOSTIC_FORMAT:(human short)' \
'--open=[Opens the output file with the default viewer or a specific program after compilation. Ignored if output is stdout]' \
'--timings=[Produces performance timings of the compilation process. (experimental)]' \
'--port=[The port where HTML is served]:PORT:_default' \
'--ignore-system-fonts[Ensures system fonts won'\''t be searched, unless explicitly included via \`--font-path\`]' \
'--ignore-embedded-fonts[Ensures fonts embedded into Typst won'\''t be considered]' \
'--no-pdf-tags[By default, even when not producing a \`PDF/UA-1\` document, a tagged PDF document is written to provide a baseline of accessibility. In some circumstances (for example when trying to reduce the size of a document) it can be desirable to disable tagged PDF]' \
'--no-serve[Disables the built-in HTTP server for HTML export]' \
'--no-reload[Disables the injected live reload script for HTML export. The HTML that is written to disk isn'\''t affected either way]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':input -- Path to input Typst file. Use `-` to read input from stdin:_files' \
'::output -- Path to output file (PDF, PNG, SVG, or HTML). Use `-` to write output to stdout:_files' \
&& ret=0
;;
(init)
_arguments "${_arguments_options[@]}" : \
'--package-path=[Custom path to local packages, defaults to system-dependent location]:DIR:_files' \
'--package-cache-path=[Custom path to package cache, defaults to system-dependent location]:DIR:_files' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':template -- The template to use, e.g. `@preview/charged-ieee`:_default' \
'::dir -- The project directory, defaults to the template'\''s name:_default' \
&& ret=0
;;
(query)
_arguments "${_arguments_options[@]}" : \
'--field=[Extracts just one field from all retrieved elements]:FIELD:_default' \
'--format=[The format to serialize in]:FORMAT:(json yaml)' \
'--target=[The target to compile for]:TARGET:((paged\:"PDF and image formats"
html\:"HTML"))' \
'--root=[Configures the project root (for absolute paths)]:DIR:_files' \
'*--input=[Add a string key-value pair visible through \`sys.inputs\`]:key=value:_default' \
'*--font-path=[Adds additional directories that are recursively searched for fonts]:DIR:_files' \
'--package-path=[Custom path to local packages, defaults to system-dependent location]:DIR:_files' \
'--package-cache-path=[Custom path to package cache, defaults to system-dependent location]:DIR:_files' \
'--creation-timestamp=[The document'\''s creation date formatted as a UNIX timestamp]:UNIX_TIMESTAMP:_default' \
'-j+[Number of parallel jobs spawned during compilation. Defaults to number of CPUs. Setting it to 1 disables parallelism]:JOBS:_default' \
'--jobs=[Number of parallel jobs spawned during compilation. Defaults to number of CPUs. Setting it to 1 disables parallelism]:JOBS:_default' \
'*--features=[Enables in-development features that may be changed or removed at any time]:FEATURES:(html a11y-extras)' \
'--diagnostic-format=[The format to emit diagnostics in]:DIAGNOSTIC_FORMAT:(human short)' \
'--one[Expects and retrieves exactly one element]' \
'--pretty[Whether to pretty-print the serialized output]' \
'--ignore-system-fonts[Ensures system fonts won'\''t be searched, unless explicitly included via \`--font-path\`]' \
'--ignore-embedded-fonts[Ensures fonts embedded into Typst won'\''t be considered]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':input -- Path to input Typst file. Use `-` to read input from stdin:_files' \
':selector -- Defines which elements to retrieve:_default' \
&& ret=0
;;
(fonts)
_arguments "${_arguments_options[@]}" : \
'*--font-path=[Adds additional directories that are recursively searched for fonts]:DIR:_files' \
'--ignore-system-fonts[Ensures system fonts won'\''t be searched, unless explicitly included via \`--font-path\`]' \
'--ignore-embedded-fonts[Ensures fonts embedded into Typst won'\''t be considered]' \
'--variants[Also lists style variants of each font family]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(update)
_arguments "${_arguments_options[@]}" : \
'--backup-path=[Custom path to the backup file created on update and used by \`--revert\`, defaults to system-dependent location]:FILE:_files' \
'--force[Forces a downgrade to an older version (required for downgrading)]' \
'(--force)--revert[Reverts to the version from before the last update (only possible if \`typst update\` has previously ran)]' \
'-h[Print help]' \
'--help[Print help]' \
'::version -- Which version to update to (defaults to latest):_default' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':shell -- The shell to generate completions for:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(info)
_arguments "${_arguments_options[@]}" : \
'-f+[The format to serialize in, if it should be machine-readable]:FORMAT:(json yaml)' \
'--format=[The format to serialize in, if it should be machine-readable]:FORMAT:(json yaml)' \
'--pretty[Whether to pretty-print the serialized output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_typst__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:typst-help-command-$line[1]:"
        case $line[1] in
            (compile)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(watch)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(init)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(query)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(fonts)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(update)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(info)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_typst_commands] )) ||
_typst_commands() {
    local commands; commands=(
'compile:Compiles an input file into a supported output format' \
'c:Compiles an input file into a supported output format' \
'watch:Watches an input file and recompiles on changes' \
'w:Watches an input file and recompiles on changes' \
'init:Initializes a new project from a template' \
'query:Processes an input file to extract provided metadata' \
'fonts:Lists all discovered fonts in system and custom font paths' \
'update:Self update the Typst CLI' \
'completions:Generates shell completion scripts' \
'info:Displays debugging information about Typst' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'typst commands' commands "$@"
}
(( $+functions[_typst__compile_commands] )) ||
_typst__compile_commands() {
    local commands; commands=()
    _describe -t commands 'typst compile commands' commands "$@"
}
(( $+functions[_typst__completions_commands] )) ||
_typst__completions_commands() {
    local commands; commands=()
    _describe -t commands 'typst completions commands' commands "$@"
}
(( $+functions[_typst__fonts_commands] )) ||
_typst__fonts_commands() {
    local commands; commands=()
    _describe -t commands 'typst fonts commands' commands "$@"
}
(( $+functions[_typst__help_commands] )) ||
_typst__help_commands() {
    local commands; commands=(
'compile:Compiles an input file into a supported output format' \
'watch:Watches an input file and recompiles on changes' \
'init:Initializes a new project from a template' \
'query:Processes an input file to extract provided metadata' \
'fonts:Lists all discovered fonts in system and custom font paths' \
'update:Self update the Typst CLI' \
'completions:Generates shell completion scripts' \
'info:Displays debugging information about Typst' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'typst help commands' commands "$@"
}
(( $+functions[_typst__help__compile_commands] )) ||
_typst__help__compile_commands() {
    local commands; commands=()
    _describe -t commands 'typst help compile commands' commands "$@"
}
(( $+functions[_typst__help__completions_commands] )) ||
_typst__help__completions_commands() {
    local commands; commands=()
    _describe -t commands 'typst help completions commands' commands "$@"
}
(( $+functions[_typst__help__fonts_commands] )) ||
_typst__help__fonts_commands() {
    local commands; commands=()
    _describe -t commands 'typst help fonts commands' commands "$@"
}
(( $+functions[_typst__help__help_commands] )) ||
_typst__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'typst help help commands' commands "$@"
}
(( $+functions[_typst__help__info_commands] )) ||
_typst__help__info_commands() {
    local commands; commands=()
    _describe -t commands 'typst help info commands' commands "$@"
}
(( $+functions[_typst__help__init_commands] )) ||
_typst__help__init_commands() {
    local commands; commands=()
    _describe -t commands 'typst help init commands' commands "$@"
}
(( $+functions[_typst__help__query_commands] )) ||
_typst__help__query_commands() {
    local commands; commands=()
    _describe -t commands 'typst help query commands' commands "$@"
}
(( $+functions[_typst__help__update_commands] )) ||
_typst__help__update_commands() {
    local commands; commands=()
    _describe -t commands 'typst help update commands' commands "$@"
}
(( $+functions[_typst__help__watch_commands] )) ||
_typst__help__watch_commands() {
    local commands; commands=()
    _describe -t commands 'typst help watch commands' commands "$@"
}
(( $+functions[_typst__info_commands] )) ||
_typst__info_commands() {
    local commands; commands=()
    _describe -t commands 'typst info commands' commands "$@"
}
(( $+functions[_typst__init_commands] )) ||
_typst__init_commands() {
    local commands; commands=()
    _describe -t commands 'typst init commands' commands "$@"
}
(( $+functions[_typst__query_commands] )) ||
_typst__query_commands() {
    local commands; commands=()
    _describe -t commands 'typst query commands' commands "$@"
}
(( $+functions[_typst__update_commands] )) ||
_typst__update_commands() {
    local commands; commands=()
    _describe -t commands 'typst update commands' commands "$@"
}
(( $+functions[_typst__watch_commands] )) ||
_typst__watch_commands() {
    local commands; commands=()
    _describe -t commands 'typst watch commands' commands "$@"
}

if [ "$funcstack[1]" = "_typst" ]; then
    _typst "$@"
else
    compdef _typst typst
fi
