One Logo Pool Ball
wwwwwwwwwwwwwwwwwww

CLI

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.

npx one

Scaffolding and entry point:

Terminal window
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].

one dev

Start the development server. See one dev for details.

Terminal window
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 config

The 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.

one build

Build your app for production. See one build for details.

Terminal window
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 build

one serve

Serve a built web app for production. See one serve for details.

Terminal window
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 workers

You must run one build before serve.

Programmatic Usage

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
}

one prebuild

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.

Terminal window
one prebuild [options]
--platform ios|android # which native project to generate
--no-install # skip installing native dependencies

Apps with expo in their dependencies use Expo prebuild instead; see Coming from Expo.

one run:ios

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.

Terminal window
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 UDID

one run:android

Build 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.

Terminal window
one run:android

one clean

Remove build folders and caches for the current project.

Terminal window
one clean

one patch

Apply 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.

Terminal window
one patch [options]
--force # re-apply all patches, even if already applied

one generate-routes

Generate route type definitions (app/routes.d.ts). See Typed Routes for details.

Terminal window
one generate-routes [options]
--appDir <path> # path to app directory (default: "app")
--typed type|runtime # auto-generate route helpers alongside the types

one typegen

Alias for one generate-routes. Takes the same options.

Terminal window
one typegen [--appDir <path>] [--typed type|runtime]

one metro-eject

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.

Terminal window
one metro-eject [options]
--force # overwrite existing files

one daemon

Multi-app development server proxy. Coordinates several One dev servers behind one port.

Terminal window
one daemon [subcommand] [options]
start (default) # start the daemon
stop # stop the daemon
status # show running servers and active routes
route # 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)

one updates publish

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.

Terminal window
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 map

Edit this page on GitHub.