axle create
axle create [FOLDER] [--template NAME] [--package-manager NAME] [--linter NAME] [--formatter NAME] [--ci SERVICE] [--no-git] [--no-install] [--yes]Creates a new monorepo from one of the templates. Before Axle is installed, run it through your package manager:
pnpm create axlenpm create axle@latestyarn create axlebun create axlenub dlx create-axleaube create axleIn a terminal, running axle alone in a folder that isn’t in a repository starts it too.
The questions
Section titled “The questions”It asks one question at a time, with the arrow keys to choose and Enter to answer:
- Where should the monorepo go? A new or empty folder, whose name becomes the package name. The current folder is offered when it’s empty.
- What are you building? Empty, full-stack, frontend, backend, mobile or library. Empty is just the workspace and its shared settings, for your own apps and packages.
- Which template? The templates of that kind, when there’s more than one.
- Which package manager? pnpm, npm, Yarn, Bun, nub or aube. The one that ran the command is chosen to start with, and those not installed say so.
- Which linter? Oxlint and ESLint, Oxlint, ESLint, Biome or none.
- Which formatter? Prettier, Oxfmt or none. Not asked after Biome, which formats too.
- Which CI service? GitHub Actions, GitLab CI, Bitbucket Pipelines or none. The workflow runs what each change affects, as
axle generate ciwrites it. - Set up a Git repository? It makes the first commit when Git knows your name and email.
- Install the dependencies?
✔ Where should the monorepo go? my-shop✔ What are you building? Full-stack✔ Which template? Next.js + Express✔ Which package manager? pnpm✔ Which linter? Oxlint and ESLint✔ Which formatter? Prettier✔ Which CI service? GitHub Actions✔ Set up a Git repository? Yes✔ Install the dependencies? Yes✔ Created my-shop from the Next.js + Express template✔ Added the next plugin✔ Installed the dependencies✔ Wrote .github/workflows/axle.yml✔ Set up a Git repository and made the first commit
Next: cd my-shop pnpm dev pnpm build
Build again and Axle replays it from its cache.Press Esc or Ctrl+C to stop before anything is written.
Options
Section titled “Options”Each option answers a question, which is then not asked.
| Option | What it does |
|---|---|
FOLDER |
the new or empty folder to create the monorepo in |
--template NAME |
the template to start from, such as next-express |
--package-manager NAME |
pnpm, npm, yarn, bun, nub or aube; --pm for short |
--linter NAME |
oxlint-eslint, oxlint, eslint, biome or none |
--formatter NAME |
prettier, oxfmt or none; left out with --linter biome |
--ci SERVICE |
github, gitlab, bitbucket or none |
--no-git |
doesn’t set up a Git repository |
--no-install |
doesn’t install the dependencies |
--yes, -y |
asks nothing, using the defaults for whatever the options don’t give |
Outside an interactive terminal, such as in CI, nothing is asked either. The defaults are my-monorepo, the empty template, the package manager that ran the command (or pnpm when it’s installed, and npm when it isn’t), Oxlint and ESLint, Prettier, no CI workflow, a Git repository and installed dependencies:
axle create my-shop --template next-express --pm pnpm --linter biome --ci github --yesWhat it does
Section titled “What it does”- Downloads the templates from
axle-rs/axle-templates, at the tag of the running Axle’s version. - Copies the template into the folder, naming the root package after it and adding
@axle-rs/axleto itsdevDependencies. It writes anaxle.tomlwith only the#:schemaline, asaxle initdoes, so your editor completes the settings you add later. - Sets the workspace up for the package manager: pnpm keeps
pnpm-workspace.yaml, and the others get theworkspacesfield inpackage.json.packageManagerrecords the version that’s installed, and Yarn 2 and newer get a.yarnrc.ymlthat installs intonode_modules. - Sets up the linter and formatter you chose: the template’s
eslint-configandoxlint-configpackages stay when they’re used, and aprettier-config,oxfmt-configorbiome-configpackage is added. Every project gets the files that extend them, itslintandformatscripts, and the dependencies. With npm and Yarn 1, which don’t knowworkspace:*, the config packages are linked with*. - Adds the official plugins for the template’s tools to
axle.toml, so their tasks are cached from the first run. - Installs the dependencies, writes the CI workflow and makes the first commit.
A plugin that can’t be downloaded, or an install that fails, doesn’t stop it: the monorepo is created all the same, and the next steps list what’s left to do.
Errors
Section titled “Errors”- A folder that has files in it, or whose name can’t be a package name: the new monorepo’s folder can’t be used.
- A
--templatethat doesn’t exist: there’s no template by that name. - No connection to GitHub: the templates couldn’t be downloaded.
- An install that stops with an error: the dependencies didn’t install.