One provides a single CLI for development, building, and serving your apps. Run npx one --help for the full list, or npx one <command> --help for one command.
Scaffolding and entry point:
npx one [name]With no arguments inside an existing app (a vite.config.ts is present), this runs the dev server. Otherwise it starts the create flow, scaffolding a new app into [name].
Start the development server. See one dev for details.
one dev [options]
--clean # clear all caches before running--host # set the hostname to bind to--port # set the port to bind to--mode # "development" or "production": run the dev server against the production bundle--debug-bundle # write the bundle to a temp file and serve it from there for debugging--debug # pass debug args to Vite--extra-config # path to an extra Vite config file to merge on top of the project configThe One development server serves both web and native apps on the same port at the same time, and should hot reload both at once. When you see the Server running on message with a host and port, that is the same for both native and web.
Build your app for production. See one build for details.
one build [options]
--platform web|ios|android # what to build (default: web)--only <pattern> # limit the pages built to a micromatch pattern--step <name> # run a single internal build step--skip-env # skip loading .env files during buildServe a built web app for production. See one serve for details.
one serve [options]
--host # set the hostname to bind to--port # set the port to bind to--compress # enable gzip compression (default: true)--loadEnv # load .env files before running--outDir # build output directory (default: dist)--cluster # enable cluster mode using all CPU cores--cluster=N # enable cluster mode with N workersYou must run one build before serve.
You can also run your production server programmatically:
import { serve } from 'one/serve'
await serve()Which takes options:
type ServeOptions = { // you can pass in your own Hono server app?: Hono
host?: string port?: number compress?: boolean outDir?: string
/** * Whether to run the Vite logic to load .env files before running the server * @default false */ loadEnv?: boolean
/** * Enable cluster mode with multiple worker processes. * Pass true to use all CPU cores, or a number for specific worker count. */ cluster?: boolean | number}Generate the native Xcode and Android projects. Requires native.app in your Vite config with the app name, iOS bundle ID, and Android application ID. See the Build or Run the Native iOS App guide.
one prebuild [options]
--platform ios|android # which native project to generate--no-install # skip installing native dependenciesApps with expo in their dependencies use Expo prebuild instead; see Coming from Expo.
Build and launch the app on an iOS simulator. Generates the native project with prebuild first when ./ios does not exist yet. Start one dev first so the app can connect to the bundler.
one run:ios [options]
--simulator <name> # explicitly set the simulator to use, e.g. "iPhone 16"--udid <udid> # explicitly set the simulator to use by UDIDBuild and launch the app on Android. Generates the native project with prebuild first when ./android does not exist yet. Start one dev first so the app can connect to the bundler.
one run:androidRemove build folders and caches for the current project.
one cleanApply package patches configured via the patches option in your Vite config. Patches are automatically applied during one dev and one build, but you can run this command to apply them manually.
one patch [options]
--force # re-apply all patches, even if already appliedGenerate route type definitions (app/routes.d.ts). See Typed Routes for details.
one generate-routes [options]
--appDir <path> # path to app directory (default: "app")--typed type|runtime # auto-generate route helpers alongside the typesAlias for one generate-routes. Takes the same options.
one typegen [--appDir <path>] [--typed type|runtime]Write babel.config.cjs and metro.config.cjs into your project so you can own and customize the Metro configs freely. The generated files delegate to one/babel-preset and one/metro-config. See Metro Mode for details.
one metro-eject [options]
--force # overwrite existing filesMulti-app development server proxy. Coordinates several One dev servers behind one port.
one daemon [subcommand] [options]
start (default) # start the daemonstop # stop the daemonstatus # show running servers and active routesroute # route a bundle ID to a server slot
--port <port> # port to listen on (default: 8081)--host <host> # host to bind to (default: 0.0.0.0)--app <bundle-id> # bundle ID for the route subcommand--slot <n> # slot number for the route subcommand--project <path> # project path for the route subcommand--tui # show TUI (default: true if TTY)Bundle the native JS and publish an over-the-air update directory with manifest.json and assets. Requires native.app.updates.runtimeVersion in your Vite config, so the binary only takes updates published for its own runtime version. See Over-the-air Updates for the full flow.
one updates publish [options]
--platform ios|android # which platform to bundle for (required)--out <dir> # directory to write manifest.json and assets into (required, must be empty)--metadata key=value # manifest metadata (repeatable, values parse as JSON scalars)--intermediatesOut <dir> # separate directory for the local debug bundle and composed source mapEdit this page on GitHub.