Silex v0.47.1 / Docs Canonical source ↗

Read the CLI reference

This page gathers the commands and options accepted by Silex 0.44. Linked guides explain when to use them and what they produce.

Programs and tests

silex run [source.sx|directory] [--backend <native|llvm>]
    [-d|--debug|-r|--release] [-n|--nocache] [--emit-ir]
silex interpret <source.sx> [-n|--nocache] [--emit-ir]
silex test <source.sx|directory> [--backend <native|llvm>]
    [-n|--nocache] [--emit-ir]
silex compile <source.sx> [--backend <native|llvm>] [--target <target>]
    [-d|--debug|-r|--release] [-n|--nocache]
    -o|--output <executable>
Option Commands Effect
--backend run, test, compile explicitly selects native or llvm
-d, --debug run, compile selects Debug (run default) and disables Release optimizations
-r, --release run, compile selects Release (compile default)
-n, --nocache run, interpret, test, compile ignores the cache for this command
--emit-ir run, interpret, test prints textual IR before the result
-o, --output compile selects the required executable path
--target compile selects a recognized target instead of the host

run keeps an explicit .sx file as the entry point. With a directory, or without a path for the current directory, it selects the only directly contained .sx file that declares a top-level main function. It does not search subdirectories. If no file or several files match, the command fails and asks for an explicit source path.

Without --backend, every supported host selects the native backend. LLVM is currently qualified only on macos-arm64 and must be requested explicitly with --backend llvm. An explicit selection that is unavailable fails without executing the other backend. interpret is not a compilation backend and therefore rejects this option.

See Run, interpret, or compile a program and Write and run tests.

Installation and packages

silex install <package|package-directory> [--suite] [--dev]
    [--target <target>]
silex check <package-directory>
silex login [--no-browser]
silex logout
silex publish <package-directory> [--dry-run]
silex link <package-directory> [--workspace <directory>]
    [--target <target>]
silex unlink <package-name> [--workspace <directory>]
silex packages
silex packages resolve [source.sx|project-directory]
Option Commands Effect
--suite install installs compatible suite extensions of a registered package
--dev install adds development dependencies of the requested package
--target install, link selects the target used to prepare the package
--workspace link, unlink limits the link to the given working folder
--no-browser login displays the GitHub URL and code without opening a browser
--dry-run publish validates and previews the snapshot without signing in or uploading

packages lists installed versions and user links. packages resolve prints the graph actually selected for the given path; without a path, it analyzes the current folder.

login obtains author access kept locally. Starting with Silex 0.46.0, it lasts 30 days and is renewed automatically when used, for up to 90 days after GitHub authorization; logout revokes it and removes the local copy when the registry is reachable. publish uploads the local directory's files to the Cloudflare registry. The first publication reserves its name for the signed-in GitHub identity. Installing a published version is anonymous. check validates a local package, while publish --dry-run previews what would actually be uploaded.

silex register <package-directory> remains a command for the former registry based on Git registration and a pull request. It is not part of the Cloudflare publication workflow.

See Install and select packages, Develop with local packages, and Publish a package.

Compiler and editors

silex setup
silex update
silex targets
silex version
silex lsp

setup, update, targets, version, and lsp accept no argument. silex lsp speaks LSP over standard streams; it is normally launched by an editor extension, not directly in an interactive terminal.

The following general forms are also available:

silex
silex --help
silex --version
silex -V

Without a command, Silex displays the same help as --help.

See Update and maintain Silex and the installation pages for Zed or VS Code.

Back to the tools