CLI Commands
Baybay has four commands. Run baybay <command> --help anywhere for the same information in your terminal.
Global flags
These flags work on every command:
| Flag | Description |
|---|---|
--config <path> | Use a config file other than ./baybay.config.js. |
--quiet | Only print warnings and errors. Exit codes are unchanged. |
--verbose | Print the resolved config and per-file timing. |
--no-color | Disable ANSI colors (also respects the NO_COLOR env var). |
--version, -v | Print version and platform, then exit. |
--help, -h | Show usage for the command. |
baybay new
Scaffold a new project into a fresh directory. Refuses to write into a non-empty folder unless --force is given.
usage
baybay new <directory> [flags]
| Flag | Default | Description |
|---|---|---|
--template <name> | default | Starter template: default, blog, docs, or bare (no layout, no CSS). |
--locale <tag> | en | Set the default locale in the generated config. |
--no-git | — | Skip git init and the generated .gitignore. |
--force | — | Scaffold into a non-empty directory, overwriting clashes. |
Example
shell
$ baybay new field-notes --template blog --locale fil
✔ Created field-notes/
✔ Wrote 11 files (blog template, locale: fil)
✔ Initialized git repository
next: cd field-notes && baybay dev
baybay dev
Start the local development server with incremental rebuilds and live reload. Drafts (draft: true) are always included in dev.
usage
baybay dev [flags]
| Flag | Default | Description |
|---|---|---|
--port <n> | 8484 | Port to listen on. Falls through to the next free port if taken. |
--host <addr> | localhost | Bind address. Use 0.0.0.0 to test from other devices on your network. |
--open | — | Open the site in your default browser once the server is ready. |
--no-reload | — | Disable live reload; rebuilds still happen, refresh manually. |
Example
shell
$ baybay dev --port 3000 --open
baybay v1.4.2 dev server
➜ Local: http://localhost:3000/
built 12 pages in 96 ms · watching src/ and static/
baybay build
Compile the site for production into outDir (default dist/). Exits non-zero on any broken internal link, so it is safe to gate CI on.
usage
baybay build [flags]
| Flag | Default | Description |
|---|---|---|
--out <dir> | dist | Override outDir for this build. |
--base <path> | / | Override the public base path (e.g. /docs/). |
--drafts | — | Include pages marked draft: true. |
--no-minify | — | Skip HTML/CSS minification (useful for diffing output). |
--no-clean | — | Do not empty outDir before building. |
Example
shell
$ baybay build --base /docs/ --verbose
baybay v1.4.2 production build
config: baybay.config.js (base overridden by flag)
✔ 12 pages compiled (en: 6, fil: 6)
✔ 5 assets copied from static/
✔ 0 broken links · sitemap.xml written
dist/ · 12 pages · 88.6 kB total · 104 ms
baybay deploy
Run a production build, then publish outDir to a hosting target. Credentials are read from the environment (BAYBAY_TOKEN) or the host's own CLI login — Baybay never writes secrets to disk.
usage
baybay deploy --target <target> [flags]
| Flag | Default | Description |
|---|---|---|
--target <name> | — | Required. One of netlify, vercel, gh-pages, rsync. |
--dest <spec> | — | For rsync: destination, e.g. user@host:/var/www/site. |
--branch <name> | gh-pages | For gh-pages: branch to push the build to. |
--prod | — | For netlify/vercel: promote to the production URL instead of a preview. |
--dry-run | — | Build and list what would be uploaded, then stop. |
Example
shell
$ baybay deploy --target gh-pages --branch gh-pages
✔ Built 12 pages in 101 ms
✔ Committed dist/ to gh-pages (17 files)
✔ Pushed to origin/gh-pages
➜ Live: https://daiven.github.io/field-notes/
deployed in 6.8 s
Exit codes
| Code | Meaning |
|---|---|
0 | Success. |
1 | Build error (invalid config, template error, broken internal link). |
2 | Deploy error (auth failed, upload rejected). The build itself succeeded. |