Your first deploy with the CLI

Put a folder on your computer online with npx @cubli/cli login and npx @cubli/cli up.

With the Cubli CLI you put the folder you work in online, without a Dockerfile and without GitHub. It takes a few minutes.

What you need

  • Node.js 20 or newer on your computer. That gives you npx.
  • A Cubli account and a project with a plan. Create the project in the dashboard: Projects, New project, Next: choose a plan. See Put your first site online.

1. Log in

npx @cubli/cli login

Your browser opens. Check that it shows the same code as your terminal, choose the workspace and click Allow access. The CLI then works only in that workspace. Your login is saved in ~/.config/cubli/cli.json.

Find your project’s id:

npx @cubli/cli projects

Link the folder you are in to that project:

npx @cubli/cli link --project <id>

The dashboard shows this command ready to copy too, in an empty project under Or from the folder of your site or app.

link creates a service named web in the project (or uses it if it exists) and writes a .cubli.json file in your folder. If your folder uses git, the CLI adds .cubli.json to your .gitignore. If your app listens on another port than 8080, pass it with --port. Give the service another name with --service.

3. Make it live

npx @cubli/cli up

The CLI packs your folder, uploads it, builds it at Cubli and streams the build log. When it is done, you see the address:

✓ Live at https://bakkerij-jansen-a9ixqd.cubli.app (48 s)

From then on it is just npx @cubli/cli up. Add -m "new menu" for a short note, which you see again with the versions in the dashboard.

When it goes wrong

If building or starting fails, you see the reason and the previous version stays online. Fix your code and run up again. What happens during the build is explained in How Cubli builds your code.

Type less

Install the CLI once, and the command is simply cubli:

npm install -g @cubli/cli
cubli up

Next

Was this helpful?

Stuck? Mail support@cubli.io, or ask from your dashboard: Help