import { CLI_VERSION } from "./project" // What sol says about itself: the version, the usage, and the short hint a // bare `sol`, an unknown command or a bad flag gets instead of the full usage // (so an error line stays on screen). export function printVersion() { console.log(CLI_VERSION) } // The banner is information, not the error: only the error line goes to // stderr, and only an error fails the run. export function hint(error?: string): never { if (error) console.error(error) console.log(`sol ${CLI_VERSION}\nRun sol --help for usage.`) process.exit(error ? 1 : 0) } export function printUsage() { console.log(USAGE) } const USAGE = `Usage: sol [options] [file] Commands: init [] Scaffold a new SolidRT project into a new (empty) folder (--runtime: with the app's own runtime, or added to the project here) run [file] Start dev server + local solidrt-go client server [file] Start dev server only client Start solidrt-go client only demo [] List the demos the CLI ships, or run one tool [/] List the tools the installed packages ship, or run one (everything after the tool name is the tool's own arguments; a path ending in .ts runs the project's own script the same way) console Start the dev console: the dev servers on this machine and their clients android [file.apk] Launch the client on a connected Android device, installing it where missing (--apk: pack the app and install that instead; a packed APK: install and launch it) bundle [file] Transpile TS/JS/TSX/JSX to JS or bytecode (a prebuilt .sol.js: compile it to bytecode) check [file] Verify the app builds and typechecks, without writing anything (no file: every examples/*/src/index.tsx, packages/*/examples/*.tsx, packages/*/demos/src/*.tsx, tests/*.test.ts and the CLI's own commands) test [file] Run the tests: every tests/*.test.ts under the current folder, or under the given one, or the one given file render [file] Replay a script (optional) and render frames for video generation pack [file] Bundle + compile to a standalone executable (experimental) mcp MCP server (stdio) exposing the running dev server to coding agents Global options: --help Print this usage and exit --version Print the sol version and exit init options: --runtime The app's own runtime too: runtime/, a cargo project over lattice with a starter module (runtime:hello), built with make -C runtime; with no , added to the project in the current directory run/server/bundle/pack/render: what the command works on sol run In a project root (package.json): the project, entry from "solidrt": { "entry" } (default src/index.tsx) sol run Outside a project: the file on its own (no assets, no isolates) sol run --project In a project root: the project, with this entry sol run --file In a project root: the file on its own, ignoring the project Packs and bundles land under dist/ in the current directory, render frames under renders/. One server per project or file; each keeps the port it had last time, else the first free one from 34884 up (see the startup line). Loopback only unless --lan. run/server/demo options: --port Bind this port instead of the remembered/next free one --lan Bind every interface and announce the LAN address (QR) --proxy-http Route fetch calls through the dev server (HTTP cache enabled) --capture Record connected clients' key events to a script file --tunnel Accept ticket-paired clients through the p2p tunnel -- Everything after -- reaches the app on every client (flux:process argv) run/client options: --size Window size (default: 1280x720) --stats Show the debug stats overlay (FPS, memory, frame timings) --data-root Client data root (default: ~/.solidrt/clients) -c, --client Client number: its own data tree under the data root (default: 0) client options: (no flags) Connect to the dev server of the project (or file) in the current directory --port Connect to the local dev server on this port --server Connect to a dev server at this address android options: (no flags) Launch the client, pointed at the dev server of the project (or file) in the current directory (the server must run with --lan, or be reached from an emulator); installed from the project's @solidrt/android- target where missing, and offered as an update where the project's package carries another version (the first time, a picker asks which Android targets the project adds) Install a packed APK (sol pack --apk) and launch it, nothing dev-flavored --apk Pack the app (sol pack --apk), then install and launch on each device the APK built for its ABI --install Reinstall the client first, even when it is current --force Where the installed app blocks the install (signed with another key, or newer), uninstall it without asking; this clears its data --port Point it at the local dev server on this port --device Target a specific adb device by serial or unique prefix --env NAME=value Set this in the launched client's environment (repeatable): the runtime's knobs, such as SOLIDRT_CADENCE_HOLD=off for a measurement --census Read the compositor's present census for the client on screen instead of launching: present intervals in refreshes and the per-frame GPU span (frameReady minus queue) --clear With --census: clear the compositor's history first --seconds With --census: wait this long (drive the app meanwhile) before reading --layer With --census: the SurfaceFlinger layer (substring; default: the client's SurfaceView) --json With --census: print the summary as JSON mcp options: --port Attach to the dev server on this port (default: resolve by project) bundle options: -f, --flux Bundle for the bare Flux runtime, without SolidJS (entry must be .ts|.js) -d, --dev Use development build of SolidJS (default: production) -m, --minify Minify the output --compile Compile to bytecode -o, --output Output directory (default: dist/bundle; for a prebuilt .sol.js, its own directory) --stdout Write bundle to stdout --json Write the bundle, its manifest and its isolates as one JSON object to stdout (the dev server's rebuild; --server names it) test options: --filter Run only the tests whose name contains this text --seed Run the tests on another Math.random sequence (default: 0) --only Run one layer: the flux tests, or the app tests (the dev client) --durations List every test with the time it took -- Everything after -- reaches the test files (flux:process argv) console options: -- Everything after -- reaches the console (flux:process argv) pack options: --folder Write the flat app folder (runner + manifest + bundle + assets) instead of the single-file executable --app Write the app alone as one .solapp (manifest + bundle + assets, no runner), for a runner to load: solidrt .solapp --apk Patch the app into installable Android APKs, one per installed target (dist/-.apk; id, label, icon, version, payload; no Android SDK needed; base: the target's runner APK; the first time, a picker asks which targets the project adds) -f, --flux Pack for the bare Flux runtime instead of SolidRT (entry must be .ts|.js) -m, --minify Minify the output -o, --output Output filename (default: dist/) render options: --script Script file to replay (default: no scripted input) --link Start the app at a link (env.launchLink; a router renders that screen) --fps Frames per second (default: 60) --duration Duration in seconds, fractions allowed (default: 1) --size Frame size in physical pixels (default: 1280x720) --settle Run the app to rest (loads landed, transitions played out) before the first frame --strict Fail the render when the app logs an error (a contained error included) --seed Render on another Math.random sequence (default: 0) -o, --output Where frames land (frame-NNNNNN.png): a missing or empty directory (default: a new renders/-/ per render) --data-root Client data root (default: ~/.solidrt/clients) -c, --client Client number: the app's sandbox under that client's tree (default: 0) -- Everything after -- is passed to the app (flux:process argv)`