CLI and deployment#
Commands#
janux dev [--port 3000] # Vite dev server: SSR, HMR, api stubs, agent endpoint
janux build # client bundle → dist/client (+ prerendered pages with output: "static")
janux start [--port 3000] # production server on Bun
janux verify # fail CI when agent-reachable tools lack descriptions
janux eval [files...] # scripted agent-task scenarios against a live appPORT env is honored when --port is absent.
What dev does#
- Boots Vite with the Janux plugin: JSX runtime (
jsxImportSource: janux), SSR route loading, and the SWC transform that turnssrc/server/*.api.tsinto client fetch stubs. - Mounts the full Janux server as middleware: pages,
/_janux/api/*,/_janux/manifest,/_janux/agent,/_janux/approve.
What build produces#
dist/client/client.js— yoursrc/client.tsentry bundled (runtime + island defs).- If there is no
src/client.ts, build is a no-op: your app is fully static and ships 0 KB of JS. - With
output: "static"in your app config,buildalso prerenders every page — dynamic routes enumerated by theirstaticParamsexport — plusllms.txtintodist/client, ready for any static host with no server. See Deploying → Static export.
What start runs#
A Bun server that:
- Serves
dist/clientassets — brotli or gzip depending on what the client accepts, compressed once and cached in memory, with hashed filenames servedimmutablefor a year and everything else revalidating. (The docs playground ships 3.15 MB of editor: 0.72 MB of it goes over the wire.) - SSRs routes directly — Bun executes your TSX natively, no Vite in production.
- Exposes the same
/_janux/*surface as dev.
Deployment notes#
- Any host that runs Bun works: a container, a VM, Railway/Fly-style platforms.
- Set your model config in the environment (
JANUX_MODELor a provider key) — see Agent. - The manifest endpoint is public by default; scope it with
ctxFor(auth) if your tools are sensitive — forbidden/filtered tools never appear for unauthorized contexts.
Guarding the agent surface#
janux verifyrenders every route's manifest and exits 1 when an agent-reachableintent()orapi()has nodescription— wire it into CI so incomplete contracts fail the build instead of degrading conversations silently.janux evalreplaysevals/**/*.eval.jsonscenarios against a live app, includingapprovesteps that exercise the real human-in-the-loop flow. Details and scenario format: CLI reference.
create-janux#
bun create janux my-app # the starter app
bun create janux my-shop --example shop # start from any examples/ app--example <name> scaffolds a copy of one of the example apps (shop, i18n, interop-react, nested-islands, data-cache) instead of the starter template; omit the name to list them. bunx create-janux is the same command.
The starter template scaffolds the conventional layout (routes, components, agent, client entry) with a working counter + agent-panel demo.