Skip to main content

CLI Installation

Uniform ships a CLI tool to create a new uniform-powered local development project in a few minutes. You can select from a Next.js or Nuxt.js barebones template. The project is authenticated and connected to a Uniform project. From here, you can continue building your composable website with Uniform.

To utilize the CLI tool, you require installed Node.js and its package manager, npm.

Since npm version 5.2.0, npm ships with its package runner npx. Create a new Uniform project using the command:

npx @uniformdev/cli new

The new command shipped with version 18.0.0 of the Uniform CLI. You have to update the CLI if you have an older version, or use the command:

npx @uniformdev/cli@latest new

Follow the prompts to:

  1. Authenticate your Uniform account. The CLI opens the web browser. Create a new Uniform account or copy the generated token if you're signed in to an existing Uniform account. Paste the copied token into the CLI as directed.

    Important

    If you are on a free-tier Uniform account, you must delete the sample project automatically created during signup, as you are only allowed one project. Else, this will throw the error “usage exceeded” in the CLI console.

  2. In the CLI, select the Uniform team to install the new project in

  3. Add a project name

  4. Select a web framework for the project. Next.js and Nuxt.js are currently available.

The CLI creates a new personalized website powered by Uniform. A local development server is started for the project, with its port displayed in the CLI console.

Uniform secret keys are provisioned and added as environment variables in the .env file of your local project. With these, changes you make and publish in your Uniform dashboard are reflected in local development when you refresh.

Next Step

  1. Learn how Uniform composes web pages and experiences by following this tutorial.
  2. Dive right into the code and start making changes to your new project.
  3. Create more Components and Compositions in Uniform Canvas, and connect them in your local project.