CLI

AxilJS CLI Installation

Install @axiljs/cli 0.3.6 with npx or npm install -g, verify axil --version, update to the latest release and use the project-local CLI. Node.js 20+.

2 min readUpdated DocumentationEdit this page
On this page6

The axil command comes from the @axiljs/cli npm package. It needs Node.js 20 or newer.

Terminal
❯node --version

Use it with npx

The quickest start needs no install at all:

❯npx @axiljs/cli create
❯pnpm dlx @axiljs/cli create
❯yarn dlx @axiljs/cli create
❯bunx @axiljs/cli create

To be sure you get the newest release rather than a cached one:

❯npx @axiljs/cli@latest create
❯pnpm dlx @axiljs/cli@latest create
❯yarn dlx @axiljs/cli@latest create
❯bunx @axiljs/cli@latest create

Install globally

❯npm install -g @axiljs/cli
❯pnpm add -g @axiljs/cli
❯yarn global add @axiljs/cli
❯bun add -g @axiljs/cli

The package installs two equivalent binaries, axil and axiljs. Verify:

Terminal
❯axil --version
Output
TXT
@axiljs/cli v0.3.6

Update

Terminal
❯npm install -g @axiljs/cli@latest
❯axil --version

Global CLI vs project CLI

Every project generated by axil create lists @axiljs/cli as a devDependency (together with @axiljs/studio, @axiljs/testing, typescript and @types/node). Inside a project:

  • npm run dev runs axil run, npm test runs axil test and npm run migrate (when present) runs axil migrate, all with the project's own CLI;
  • npx axil <command> also resolves to the project's copy.

A global install is only needed to run axil outside a project, mainly for axil create, and npx @axiljs/cli create covers that too.

Reinstall

If a global install behaves unexpectedly, remove it and install again:

Terminal
❯npm uninstall -g @axiljs/cli
❯npm install -g @axiljs/cli@latest
❯axil --version

Next steps

Was this page helpful?

Help improve the documentation

AxilJS is open source and documentation improvements are welcome.

AxilJS DocumentationMIT License · Built by SyntaxilitY