@zenithbuild/cli
v0.7.10
Published
Deterministic project orchestrator for Zenith framework
Readme
@zenithbuild/cli ⚡
⚠️ Internal API: This package is an internal implementation detail of the Zenith framework. It is not intended for public use and its API may break without warning. Please use
@zenithbuild/coreinstead.
The command-line interface for developing and building Zenith applications.
Canonical Docs
- CLI contract:
../../docs/documentation/cli-contract.md - Deployment targets guide:
../../docs/documentation/guides/deployment-targets.md - Route protection:
../../docs/documentation/routing/route-protection.md - Server output contract:
./SERVER_OUTPUT_CONTRACT.md
Overview
@zenithbuild/cli is Zenith's deterministic project orchestrator. It owns the daily development loop:
zenith devzenith buildzenith preview
It does not ship a public plugin-management surface.
Features
- Dev Server: Instant HMR (Hot Module Replacement) powered by Bun.
- Build System: deterministic build output and adapter packaging.
- Preview: target-aware verification of built output.
Config Baseline
Current top-level zenith.config.js keys:
routerembeddedMarkupExpressionstypescriptDefaultoutDirpagesDirbasePathtargetadapterstrictDomLintsimages
There is no separate assetPrefix config. Public framework asset URLs follow basePath.
pagesDir resolution:
- If
pagesDiris set, the CLI uses that path relative to the project root. - If
pagesDiris not set, the CLI checkspages/first, thensrc/pages/, then falls back to the defaultpagespath.
basePath behavior:
basePathdefaults to/.- Canonical route paths stay base-path free in manifests and route classification.
- Public app URLs, bundled asset URLs, router URLs, and any framework endpoints exposed by the selected target are prefixed with
basePath. - Canonical
.zenith-outputfiles stay adapter-neutral; final adapter output may still nest public files underbasePathwhen direct-file serving requires it.
router behavior:
router: trueenables client router bootstrap/runtime injection.router: falsedisables client router bootstrap/runtime injection.assets/router-manifest.jsonmay still be emitted as an internal preview artifact. Its presence does not mean client router mode is enabled.
target / adapter behavior:
targetis the shorthand deployment target. Phase 1 defaults loaded config totarget: 'static'.adapteris the explicit adapter object form and is mutually exclusive withtarget.static-exportemits rewrite-free concrete public files rooted atoutDirand requiresexportPathsfor dynamic prerender routes.vercel-staticemits a Vercel Build Output API layout rooted atoutDir.netlify-staticemits a Netlify publish directory rooted atoutDir, including generated_redirectsrewrites for dynamic prerendered routes.vercelemits a Vercel Build Output API layout with packaged route functions for server-classified routes and static rewrites for prerendered dynamic routes.netlifyemits a deploy root withpublish/,functions/,netlify.toml, and generated_redirectsthat force server-classified routes through packaged functions.nodeemits a standalone Node artifact rooted atoutDirwithindex.js,package.json,manifest.json,static/, andserver/.
Server-capable target contract:
- Route classification stays upstream in the manifest and server package layers.
.zenith-output/serveris the canonical packaged server contract consumed by adapters.- Adapters package classified output into host layouts; they do not reinterpret route meaning.
Current limitations:
- There is no separate
assetPrefixknob. Assets intentionally followbasePath. static-exportdoes not expose deployed/_zenith/imageor/__zenith/route-checkendpoints. A plain static file server is the contract.vercelandnetlifydo not yet emit a deployed/_zenith/imageendpoint. Thenodetarget does.- Image materialization is route-artifact-driven. Bundler owns final build/static HTML image materialization, while preview and server render still materialize at runtime from structured
image_materializationmetadata. No path executes page assets, and dynamic image props are currently unsupported until the compiler emits a dedicated image-props artifact. - There is no shipped plugin install/remove command surface in this CLI.
Commands
zenith dev
Starts the development server on localhost:3000.
zenith build
Compiles and bundles your application for production.
zenith preview
Previews the locally built target contract for verification. Static targets serve built files; target: 'node' boots the built Node artifact.
Installation
Typically installed as a dev dependency in your Zenith project:
bun add -d @zenithbuild/cliLicense
MIT
