Skip to content
v2.7

Sites with the CLI

init site static or with a framework (static and SSR), the creation command for each framework, push site, and the address.

The commands below run in a folder linked to a project (owbase init project, see Functions with the CLI).

Terminal window
owbase init site --name storefront --site-id storefront --framework other
owbase push site --site-id storefront

init site with --framework other creates sites/storefront/ with a home page, a 404 page, and a stylesheet, and adds the site to owbase.json with no build commands (the output folder is the root). Replace the files with your own and publish.

With a framework, the CLI writes the install and build commands, the output folder, and the fallback file of the framework to owbase.json, and shows the command that creates the framework project. It does not generate the code: run the command it shows.

Terminal window
owbase init site --name blog --site-id blog --framework astro --adapter ssr
npm create astro@latest sites/blog
owbase push site --site-id blog

--adapter chooses the mode, static or ssr, when the framework has both; with a single mode, it applies without asking. In SSR mode the site runs on the framework’s Node server (see SSR).

Framework (--framework) Modes Creation command
Analog (analog) static and SSR npm create analog@latest sites/<folder>
Angular (angular) static and SSR npx @angular/cli@latest new <name> --directory sites/<folder>
Next.js (nextjs) static and SSR npx create-next-app@latest sites/<folder>
Nuxt (nuxt) static and SSR npm create nuxt@latest sites/<folder>
SvelteKit (sveltekit) static and SSR npx sv create sites/<folder>
Astro (astro) static and SSR npm create astro@latest sites/<folder>
TanStack Start (tanstack-start) static and SSR npx @tanstack/cli@latest create sites/<folder>
Remix (remix) static and SSR npx create-remix@latest sites/<folder>
React (react) static npm create vite@latest sites/<folder> -- --template react
Vue.js (vue) static npm create vue@latest sites/<folder>
Vite (vite) static npm create vite@latest sites/<folder>
Lynx (lynx) static npm create rspeedy@latest sites/<folder>
React Native (react-native) static npx create-expo-app@latest sites/<folder>
Other (other) static none: the CLI creates the home page
Terminal window
owbase push site --site-id blog

The push creates the site on the server (or updates its settings), uploads the folder as a deployment, and waits for the build to finish, showing the log. Left out of the package are .git/, macOS and Windows junk (.DS_Store, ._*, Thumbs.db), whatever the folder’s .gitignore lists and the patterns in the site’s ignore field. Keep node_modules/ in .gitignore (frameworks already do): the build reinstalls the dependencies. --force asks nothing; --with-variables also uploads the variables from the .env in the site folder, which replace those on the server.

The site’s settings come from owbase.json and replace those in the console; a field missing from the file goes back to its default. See The owbase.json file before publishing a site that already exists.

A site created in the console (or changed there) comes into owbase.json with:

Terminal window
owbase pull site --site-id blog --no-code

The pull writes the site’s settings to owbase.json. Without --no-code, it also downloads the code of the latest deployment to sites/<name>/. Without --site-id, it asks which sites to pull. In CI, it works with just the API key: see CI with an API key.

The first time, the push gives the site the address https://<id>.sites.owbase.dev (https://blog.sites.owbase.dev in the example). The name follows the rules in Public address: if the ID is not valid as a name or the name is already in use on the platform, the CLI warns you and you choose the address in the console.

Was this page helpful?