Skip to main content
The uniac CLI connects a local application composition to a remote project. Its commands prepare descriptions, deploy services, and read live state. npm install -g @uniac/cli installs the uniac command with Node 18+. npx -y @uniac/cli … runs the same command without a global installation. This reference describes release 0.3.38.

Invocation

Local directory options default to the current directory. Flags may appear before or after a command’s positional argument; a surplus argument is a usage error. uniac -h lists commands, and a command’s -h prints its usage. --version and -v are aliases for version. Output describes result formats, progress and exit codes.

Local initialization

init runs offline and writes a prebuilt-image service definition named <name>-definition and a private deployment declaration <name> that instantiates it; public_ports on the declaration adds an endpoint. It prompts for the service name, previews the file and asks for confirmation; end-of-input accepts the defaults. The default name comes from the directory name, with app as the fallback. init stops when the directory already has a uniac.yaml. npm create @uniac@latest invokes uniac init through the @uniac/create package. Initialization is local: it writes uniac.yaml and leaves the remote account unchanged.

Local project ownership

plan, deploy, link, status, logs and exec resolve the owning local project from their starting directory. A containing workspace owns its included packages. Without a workspace, the nearest ancestor uniac.yaml owns the standalone project. Above that project, only a uniac.yaml that declares workspace can contain it; discovery reads the others’ top-level keys alone. Starting from a member or its subdirectory selects the same project as starting from the root. All six commands validate manifest structure and workspace membership. An unlisted manifest below a workspace and a nested workspace are errors. link, status, logs and exec need only a valid description; deployable workloads, buildable sources and Docker are requirements of deploy.

Project selection

Deployment addresses an existing remote project. project create <name> creates one on the authenticated account and prints its name and assigned slug. It is non-interactive, works from any directory, and changes only the remote account. The name must match ^[a-z][a-z0-9-]{0,62}$. Project creation, deletion and linking use the platform selected by UNIAC_PLATFORM_URL, whose default and credential selection are described in Authentication. link resolves the local project first. An exact project slug or a uniquely matching name selects the project directly. Without an argument, link opens the project picker, whatever the number of projects, and several matching names open it too. The command fails when nothing matches, the account has no projects, or required input stays unanswered. Linking writes or replaces .uniac/deploy.json at the owning project root: All workspace packages share the root’s binding; a binding file in a member or on the path below the root is an error, even when it matches the root binding. Relinking from any member changes the owner’s binding for subsequent operations. Each operation captures its destination when it starts, so a concurrent relink applies to later operations. Relinking changes where later commands deploy; remote services stay where they are. deploy, status, logs, exec, route list, route delete and the service and volume deletes select their destination as follows:
  • A nonempty UNIAC_PROJECT_URL names a project by its gateway URL or slug, in place of the binding, and the platform origin comes from UNIAC_PLATFORM_URL. The CLI finds that project in the account’s project listing on that platform and uses its name, slug and gateway; a value that names no project on the account fails with not_linked.
  • Otherwise the binding supplies the project gateway and platform. A conflicting explicit UNIAC_PLATFORM_URL fails before a network call. A binding without platform_url uses the selected default platform; one without gateway_url derives the gateway from its slug.
  • Without a binding or override, deploy opens the project picker and saves the selected binding; status, logs, exec, the route commands and the service and volume deletes report that the project is not linked.
status reads the project that the binding or UNIAC_PROJECT_URL names. It reads every service in the project, including services missing from the local description; whole-project status also reads volumes.

Planning and deployment

plan and deploy collect every deployment declaration in the resolved project’s root and included packages, so they always cover the whole project. Planning requires at least one deployment declaration, and each service comes from one declaration. plan performs description validation offline and needs neither credentials nor Docker. It composes the complete graph and checks that its build paths exist; image builds and remote checks happen in deploy. Its text preview also lists the declared domains and routes, so a purchase that deploy would request shows before anything is applied. --full expands the text preview; --json returns the generated description, as specified in Output. deploy repeats this planning before authentication or remote activity. Single-service and multi-service projects use the same deployment path. Deployment additionally requires credentials for the target project’s platform and a reachable local Docker daemon for either image: or build:. Before Docker or image work, deployment checks the credential with the platform. It looks up the project’s slug and requires the returned name, slug and gateway to match the binding, or the project that UNIAC_PROJECT_URL names in the account-level project listing. A saved binding is optional because deployment can select an existing project interactively. A project that declares domains or routes has them applied after the project check and before image work. Deployment first checks that the platform serves them, domains on the account and routes on the project, and exits deploy_failed before applying anything when it does not. It then requests each declared domain the account does not have, which starts its purchase, and leaves every other declared domain as it stands, including one whose purchase failed, which domain retry starts again. Each declared route is created when the project does not have it, updated when its configuration differs, and otherwise left alone. Removing a declaration deletes nothing. A refusal stops the deployment before image work, and the domains and routes applied before it stay. Deployment waits on neither a purchase nor a hostname: after the release, it reads each declared domain and route again and reports where each stands, as Output shows. For service sources, deployment pulls prebuilt images using local Docker credentials or builds from the current working tree. Both target linux/amd64. The build context’s .dockerignore filters its input. Builds run on every deployment and use Docker’s layer cache. The resulting image is pushed to the project registry and registered with the service description. Sources remain relative to their defining package. Within one run, services sharing a source and target platform share image work; different packages’ build: . sources remain distinct. Missing build directories or Dockerfiles fail during local planning. Dockerfile syntax, missing build stages, failing build commands, image pulls and daemon availability are checked during image work. Planning checks the endpoint, environment variable and volume limits that the service, exposure and storage pages state, and the platform applies those pages’ constraints when the deployment is submitted. All service images are checked before the first push. Each run submits a new deployment version of every declared service, in reference order: a service whose environment references another declared service is registered after that service’s deployment has settled, so the reference resolves to the version the same run declared. Services with no reference between them are registered together before the CLI waits for any of them. Services that reference each other in a cycle are registered together, and each resolves the others against the versions serving at that moment. When registration returns a task ID and the initial task read succeeds, the CLI polls every two seconds until the task finishes, when the deployment succeeds or fails, or a five-minute observation deadline passes. Authentication or access denial fails the command. In other cases, the report shows the accepted registration without an observed state. Failure, interruption or the observation deadline stops new local work and returns partial results: when a deployment does not settle, the services registered after it are not attempted. Deployments the platform accepted continue, each on its own. An interrupted or lost registration response leaves acceptance unconfirmed. A later deploy is a new, independent operation. After a release attempt, including a partial failure, the CLI writes a local record of image digests, submission outcomes and receipts under ~/.uniac/store; UNIAC_STORE_DIR selects another directory. Output describes recording failures.

Reading logs

logs <service> prints the logs of the service’s instances, as the service has them when the command starts. Each line is prefixed with its instance’s short form, which Output describes with the line format. Without -f, logs prints each instance’s current run, or with --previous the run before it, one instance after another in key order, and exits. An instance without a run prints nothing, and --previous on an instance without a previous run fails that instance’s read with deploy_failed. With -f, it follows every instance at once and continues into later runs. The platform ends a followed read after five minutes, and the CLI resumes it after the last line it received, without missing or repeating a line. It resumes the same way after a dropped connection. When the credential expires, the platform ends the read and the CLI’s next read fails with auth. When the platform moves a followed instance to another node, the CLI continues with its runs there; when the instance is removed, its output ends. While the platform cannot serve an instance’s logs, as briefly after a move, the CLI waits as the platform asks and retries, for up to five minutes of waiting in a row, and then reports the instance unreachable. Each instance being read holds one open read. An account can hold 10 open reads and an instance 4; a read beyond either fails with deploy_failed, and its message names the limit it reached. logs selects the project as status does and uses its platform’s credentials.

Running a command

exec <service> -- <command> [<arg>...] runs one command in a running instance of the service, as an exec, and prints what the command writes to stdout on stdout and to stderr on stderr, as it arrives. Everything after -- is the command’s argument list, with no shell added; -- sh -c '<script>' runs a shell the image has. An argument must be valid UTF-8. Without -t, the platform stops the command 120 seconds after it starts. A service with one instance runs the command there. A service with several needs --instance; without it, exec runs nothing, and its message lists the instances by their short forms. A service without instances fails the same way. Each exec runs its command once, and running exec again runs the command again. exec exits with the command’s exit code. For its own outcomes it uses the codes docker exec uses. A command can exit with the same codes, so each of these outcomes except an interruption also writes on stderr, as Output shows: An exec is refused when the instance’s container is not running, and its message names the instance’s state; when the account holds 4 open execs or the instance 2, and its message names the limit; and when the platform cannot run it at the moment. That last refusal can follow a command that started and was stopped, so run a command that changes data again only once you know it did not run. exec selects the project as status does and uses its platform’s credentials.

In a terminal

exec -it <service> -- <command> [<arg>...] runs the command in a terminal connected to the CLI’s own, such as -- sh for a shell. It requires a terminal on the CLI’s standard input, and the command’s arguments together hold at most 512 bytes as UTF-8. The CLI’s terminal is in raw mode once its connection to the platform is open, so every key reaches the program, Ctrl-C included, and the terminal’s size follows the CLI’s window. The terminal ends when the program exits, after 15 minutes without input, or at 1 hour. exec -it exits with the program’s exit code, and otherwise with the codes above: 125 also covers -t without -i or without a terminal on standard input, a command over 512 bytes, a refused terminal, and a connection that closed before the terminal ended; 130 is SIGINT or SIGTERM sent to the CLI itself. An end other than the program’s own exit writes one line on stderr, as Output shows. A terminal is refused as an exec is, with its own caps of 4 open terminals per account and 2 per instance.

Domains, routes and approvals

domain search <label> reads the label’s offers under every sold top-level domain and prints them one line per name with its offer and prices, then a count by offer. Without --all it prints 50 names: those under com, net, org, dev, app, io, co and xyz first, where sold, then the rest in name order; with --all, every name in name order. A listed name is unconfirmed, taken or not known; domain check <name> reads that one name’s offer at the registrar, available or unavailable with its reason, at the name’s own one-year price and today’s renewal price. domain tlds prints the sold top-level domains in name order, each with a standard name’s prices. None of these buys a name: a deployment that declares the domain requests it. domain list prints the account’s domains in name order: where each purchase or holding stands, its price or expiry, when it was registered, and the next step. domain retry <name> starts a new purchase of a domain whose purchase failed, which waits for a person’s approval again. domain auto-renew <name> on|off turns an active domain’s renewal on or off. domain delete <name> deletes a domain and its DNS records; in a terminal it names the domain’s phase and asks for its typed name, and --silent and the absence of a terminal behave as for the other deletes. A deployment that still declares a deleted domain requests it again. domain records <name> prints a domain’s DNS records in the order they were added, each with its id. domain record-add <name> <type> <host> <value> adds a record; <type> is MX, TXT or CNAME in any case, and --priority gives an MX record’s priority. domain record-remove <name> <id> removes the record with that id from the domain; in a terminal it names the record and asks for the domain’s typed name, and --silent and the absence of a terminal behave as for the other deletes. The domain commands work from any directory and use the platform and credentials of project create. route list prints the linked project’s routes in name order: each route’s domain, service and port, and each hostname’s phase. route delete <name> deletes a route at once: its hostnames stop being served. In a terminal it names the hostnames that stop being served and asks for the route’s typed name; --silent and the absence of a terminal behave as for the other deletes. Removing a route from uniac.yaml deletes nothing, and a deployment that still declares it creates it again. approval list prints the account’s approvals, newest first: what each allows, the requester’s summary, and whether a person approved or declined it. --phase takes pending, approved or declined and prints only that phase. A person approves or declines each in the dashboard, from its bell or its Approvals page; the CLI reads approvals. approval list works from any directory and uses the platform and credentials of project create. Each of these commands first checks that the platform serves its operation, and exits deploy_failed when it does not. A refusal, such as a retry of a domain whose purchase did not fail, a deletion of an active domain or an offer read past the account’s registrar lookups, prints the platform’s reason and exits deploy_failed. Output describes their reports.

Deleting services, volumes and projects

service delete <name> deletes a service of the linked project, with the effects in Dashboard and removal: a volume bound to it is unbound and keeps its data. volume delete <name> deletes a volume and its data, with the effects in Volume lifecycle: a volume a service is bound to is refused. <name> is the volume’s full name as status lists it, <service>.<volume>. project delete <name> deletes a project of the authenticated account, with the effects in Project lifetime: its services, endpoints, and every volume and its data, including unbound volumes. Like project create, it works from any directory. service delete and volume delete then poll every two seconds until what they delete is gone, up to a five-minute deadline, then exit pending; the deletion continues after the deadline or an interruption. A service already terminating or a volume already deleting is awaited without the question below or a new deletion. project delete returns once the platform accepts the deletion. The platform then removes the project’s services, endpoints and volumes, and project create accepts the name again once it has. A repeated project delete finds no project of that name and exits deploy_failed. A directory linked to the deleted project keeps its binding; deploy, status and the service and volume deletes there exit not_linked until link selects another project. In a terminal, the three commands show what they delete and ask for its typed name; any other answer deletes nothing and exits 2. --silent skips the question and changes nothing else. Without a terminal on standard input, --silent is required, and the command exits 2 before any network call. service delete and volume delete select the project as status does and use its platform’s credentials; project delete uses the platform and credentials of project create. Output describes their results.

Reading usage

usage prints what the account’s usage cost in a month, the figures the dashboard’s Usage page shows. Without options it reads the current month so far: the month, the time its figures run through, and its total; each category with its quantity and cost, in the order CPU, Memory, Network and Volume; and each project’s cost, largest first. A project whose cost rounds to $0.00 is left out, and the projects the account no longer has are summed into one Deleted projects (<n>) line, last. usage changes nothing. Like project create, it works from any directory and uses that command’s platform and credentials. Output describes the report.