CLI commands

Every command of the Cubli CLI: log in, link a folder, deploy, roll back, variables, domains and downloading data.

The Cubli CLI is the npm package @cubli/cli. You need Node.js 20 or newer. Use it without installing via npx @cubli/cli <command>, or install it once with npm install -g @cubli/cli; the command is then cubli. The examples below use cubli.

Help for any command: cubli --help or cubli <command> --help.

Log in

cubli login

Opens your browser. Check the code, choose a workspace and click Allow access. The CLI then works only in that workspace; for another one, log in again. Your login is stored in ~/.config/cubli/cli.json and is valid for 90 days.

On a server or in CI, without a browser, log in with an API token:

cubli login --token <token>

If the token is in the CUBLI_TOKEN variable, cubli login picks it up from there.

cubli projects
cubli link --project <id>

projects lists your projects with their id. link links the folder you are in to a service in that project, and creates that service if it does not exist yet. The link is stored in .cubli.json; if your folder uses git, that file goes into your .gitignore.

Option Meaning
--service <name> The service’s name (default web)
--port <port> The port your app listens on, for a new service (default 8080)

Deploy

cubli up
cubli up -m "new menu"
cubli up --staging

Builds the folder and makes it live, with the build log in your terminal. -m adds a short note. --staging deploys to staging instead of production; your project then needs staging. You can also pass another folder: cubli up ./site.

If it fails, the previous version stays live. What is uploaded is explained in How Cubli builds your code.

Follow, roll back and open

cubli deployments
cubli rollback <deployment-id>
cubli logs -n 200
cubli open
  • deployments: the latest deploys of the linked service, with their status.
  • rollback: makes an earlier deploy live again. Nothing is rebuilt.
  • logs: the latest lines of the running app (100 by default).
  • open: opens your site in the browser.

Check first

cubli check

Reads your folder without uploading anything: which framework it is, what your app uses and which variables you still need to set.

Variables

cubli vars
cubli vars set API_KEY=abc123 MODE=live
cubli vars unset MODE

vars lists the variables; secret values stay hidden. After set or unset, the app restarts with the new values, without rebuilding. See Variables.

Domains

cubli domains
cubli domains add bakkerijjansen.nl

domains lists the linked service’s domains, with the records still to set. add connects a domain and prints the DNS records. For a bare domain, www comes along by itself; --no-www leaves it out. --redirect-to <domain> sends the domain’s visitors on to another domain of the same service.

Databases

cubli db export
cubli db import dump.sql.gz --database <id>
  • db export: downloads the linked app’s database as a gzipped SQL dump, into .cubli-data/ by default. --database <id> picks another database, --out <folder> another place.
  • db import: replaces a database’s content with a dump. See Import a database.

Download code and data

cubli pull ./my-site --project <id>
cubli pull ./my-site --project <id> --data

pull gets the code that is live into a folder, and links that folder to the service. That is how you start on an app you made from a template, or get back code that only lives on Cubli. If the code comes from GitHub, the CLI says so: change it there.

Option Meaning
--project <id> The project, when the folder is not linked yet
--service <name> The service in that project (default: its first app)
--force Write into a folder that already has files
--data Also download the database and files (such as uploads), into .cubli-data/

pull does not write into a folder that already has files, unless you add --force; files are then overwritten. Already have the code and only want the database? Use cubli db export.

.cubli-data/ is never uploaded by cubli up and stays out of git. It holds your customers’ data, personal data too: keep it safe and delete it once you are done. Variables and secrets are not in it.

For a WordPress site, pull makes a copy you can work on locally. See Work on WordPress locally.

The MCP server

cubli mcp

Starts the local MCP server for AI tools such as Claude Code, Codex and Cursor. You don’t start it yourself: your AI tool does. See MCP in Claude Code, Codex and Cursor.

Was this helpful?

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