Developer Tools

CLI Commands

Every ubex command, its arguments and its flags. Commands that work on a project (status, push, deploy, dev, call...) run inside the project's folder. ubex help prints this list in your terminal.

Account ubex login ubex logout ubex whoami ubex workspaces ubex projects Project ubex new ubex pull ubex status ubex push ubex build ubex deploy ubex open Endpoints and help ubex dev ubex endpoints ubex call ubex help ubex version + --json on every command
The whole CLI at a glance: 17 commands in three groups.
ubex <command> [arguments] [flags]

Flags for every command

Flag What it does
--json Machine-readable output on stdout, for scripts and AI editors
--org ID The organization to act in. By default, the project's, or else the one you last logged in to
--api URL The Ubex API. By default, the project's, or else $UBEX_API, or else https://api.ubex.ai
--no-color Plain text in a terminal too, as NO_COLOR=1 does. A pipe or a file always gets plain text

Account

ubex login

ubex login [--read-only]

Logs in through your browser: a Ubex page opens, you choose the organization and allow access, and the terminal carries on. The login is kept in your user's config folder and renews itself.

Flag What it does
--read-only Asks for read access only

ubex logout

ubex logout [--all]

Logs out of the organization. --all logs out of every organization you logged in to.

ubex whoami

ubex whoami

Who you are logged in as, the organization, your access in it, and the workspaces you can reach with your role in each.

you@company.com (Your Name)
Organization: Acme (12), with build access
API: https://api.ubex.ai
  workspace 31  Marketing (Admin)
  workspace 42  Shop (Admin)

ubex workspaces

ubex workspaces
ubex workspaces create NAME

Lists the organization's workspaces you can reach, with their ids. With create NAME, creates a new workspace.

ubex projects

ubex projects [--workspace ID]

Your projects with their web apps: each project's workspace, how many workflows and endpoints it has, and each web app's id, address and whether it is deployed. Use the web app's id with ubex pull.

Shop / My Shop  (project 512, workspace 42: 6 workflows, 6 endpoints)
  web app 1234     https://my-shop.ubex.dev/  deployed
Flag What it does
--workspace ID Lists one workspace's projects only

Project

ubex new

ubex new NAME [DIR] [--workspace ID | --new-workspace NAME]

Starts a new project with its web app, and puts it in a folder: DIR, or by default a folder named after the project. The web app comes with starter files that build.

Flag What it does
--workspace ID Creates the project in this workspace (ubex workspaces lists them)
--new-workspace NAME Creates a new workspace for it
ubex new "My shop" --workspace 42
cd my-shop

ubex pull

ubex pull WEB_APP_ID [DIR] [--force]     # outside a project: download it
ubex pull [--force]                      # inside a project: bring in the changes made on Ubex

Outside a project, downloads a web app and every workflow of its project into DIR (by default, a folder named after the app). Inside a project's folder, brings in what changed on Ubex since the last sync: edits in the Ubex editor, by Qira or Vira, or by a teammate.

When a file changed both here and on Ubex, pull keeps your version and saves Ubex's beside it as <file>.ubex-remote, for you to merge.

Flag What it does
--force Goes ahead where ubex would stop to protect changes. Use it only when you mean to overwrite

ubex status

ubex status

What changed here and on Ubex since the last sync, with the app's name, id and address. When nothing changed:

My Shop (web app 1234)  https://my-shop.ubex.dev/
In sync with Ubex.

ubex push

ubex push [PATH...] [--dry-run] [--force] [--run]

Uploads what changed here, or only the paths you name, and reports whether the app still builds. It sends the buckets first, then the tables, then the endpoints, then the site, so an endpoint can use a table added in the same push. Changed and new endpoints are saved as drafts, which ubex dev and ubex call run and ubex deploy publishes. Push never deletes anything: it says what it kept.

It refuses files that changed on Ubex since the last sync. Run ubex pull, merge, and push again.

Flag What it does
PATH... Pushes only these files or folders
--dry-run Shows what would be sent, without sending it
--force Overwrites files that changed on Ubex. Their change is lost
--run Also runs each workflow it saves, once. Those runs write real rows
ubex push                                  # everything that changed
ubex push app/api/orders components/Cart   # only these
ubex push --dry-run                        # look before sending

ubex build

ubex build

Checks that the app on Ubex builds. Errors come back as path:line:col.

ubex deploy

ubex deploy [--label TEXT] [--no-push]

Pushes your changes, publishes the project's workflows that have unpublished changes, builds the site and puts it live at its address. If the site does not build, nothing goes live and the errors come back. It can take a minute or two.

Flag What it does
--label TEXT Names this version. By default it is "Version N"
--no-push Deploys what is on Ubex already, without pushing your local changes first
ubex deploy --label "Checkout v2"

ubex open

ubex open

Opens the live site in your browser.

Endpoints

ubex dev

ubex dev [--port 5173] [--live] [--open]

Runs the site from this folder at http://127.0.0.1:5173, rebuilt and reloaded on every save. Its /api calls go to the endpoints' drafts on Ubex. It serves real paths, so a reload on /orders/42 opens that page as on the deployed site. Leave it running in a second terminal while you work.

Flag What it does
--port N Serves on another port (5173 by default)
--live Calls the published endpoints instead of the drafts
--open Opens the site in your browser

ubex endpoints

ubex endpoints

The project's endpoints: method, path and authentication of each. When there are none yet, it says so: each app/api/<path>/route.ts becomes one when you push it.

ubex call

ubex call METHOD /api/<path> [BODY | @file | -] [-H 'Name: value']... [--live] [--keep-token | --no-token] [--as NAME]
ubex call --forget-token [--as NAME]

Sends one of your endpoints a real request and prints the answer: the draft by default, the published version with --live. It writes real rows, as your app would. It exits with code 1 on a 4xx or 5xx answer.

Argument or flag What it does
METHOD GET, POST, PUT, PATCH or DELETE
/api/<path> The endpoint's path, as ubex endpoints lists it
BODY A JSON body, such as '{"title":"x"}'
@file Reads the JSON body from a file, such as @order.json
- Reads the JSON body from standard input
-H 'Name: value' Adds a header. Repeat it for several
--live Calls the published version instead of the draft
--keep-token Keeps the token a login endpoint answers. The calls after it send it
--no-token Calls without the kept token
--as NAME Keeps and sends a login of its own under this name, to call as several people
--forget-token Drops the kept token (with --as NAME, that person's)
ubex call POST /api/auth/login '{"email":"ana@example.com","password":"..."}' --keep-token
ubex call GET /api/orders/list
ubex call POST /api/orders/create @order.json
cat order.json | ubex call POST /api/orders/create -
ubex call GET /api/orders/list -H 'Authorization: Bearer eyJ...' --no-token
ubex call GET /api/orders/list --as ben

Kept logins live in the project's .ubex/ folder, which is never pushed and which git skips. A name with no kept login, or an expired one, is refused before anything is sent. ubex call sends JSON only: to try a file upload, use the site in ubex dev.

With --json, a failed call has the same fields as a successful one, plus error.

Help

ubex help

ubex help

Lists every command and flag.

ubex version

ubex version

Prints the installed version, such as ubex 0.4.0. To update, run the install line again (see Ubex CLI).

Environment variables

Variable What it does
UBEX_API The Ubex API to use when the project and --api don't say. Default https://api.ubex.ai
NO_COLOR Set to 1 for plain text in a terminal, like --no-color
UBEX_VERSION Read by the installers: installs this version instead of the newest

Exit codes

Code Meaning
0 Done
1 Refused, a conflict, a failed build or a failed deploy. For ubex call, a 4xx or 5xx answer
2 Wrong usage: an unknown command or a missing argument
3 Not logged in: run ubex login
4 Network or server error
ubex push --json > push.json || echo "push stopped with code $?"

We update these pages often. Spotted something out of date? Tell us

AI AssistantPowered by Ubex
Beta
Ask me anything about Ubex workflows, nodes, or the API.