# Getting started with the CLI

Source: https://cloud.synteq.com/docs/cli
Updated: 2026-11-12T02:37:06.544243+00:00

---
# Getting started with the CLI

The Synteq CLI (`synteq`) manages your servers, storage, apps, functions, billing, and support tickets from a terminal. It uses the same API as the portal, and every command can print JSON for scripts.

## Install

The CLI needs Node.js 20 or newer.

```
npm install -g synteq
synteq --version

```

To upgrade:

```
npm install -g synteq@latest

```

If your version is below the minimum the portal supports, every command except `login`, `logout`, and `settings` exits with code 4 and tells you to upgrade.

For tab completion in bash, zsh, or PowerShell, run `synteq autocomplete` and follow the printed steps.

## Sign in

```
synteq login

```

The CLI opens the portal in your browser and prints the URL and a code. Confirm the code in the portal to finish signing in.

```
synteq whoami    # name, email, role, active team, and auth mode
synteq logout    # revoke the session and clear stored credentials

```

Credentials are stored in your OS keychain, or in a file only you can read when there's no keychain. Config lives in `~/.config/synteq` (`%APPDATA%\synteq` on Windows).

### Sign in with an API key

An API key runs server, storage, ordering, catalog, and billing commands within its scopes. It doesn't run Apps, Functions, tickets, SSH keys, or account commands; those need a browser session. Create a key in the portal first; see [Creating an API key](/docs/creating-an-api-key).

```
echo "$SYNTEQ_API_KEY" | synteq login --with-token

```

`--with-token` verifies the key and stores it. With nothing piped, it prompts with masked input. To use a key for one shell without storing it:

```
export SYNTEQ_API_TOKEN=sk_...
synteq vps list

```

A command outside the key's scopes fails and names the missing scope. Under a key, `synteq --help` lists only the commands the key can run.

## Choose a team and project

Commands act on the active team (your portal organization) and its default project.

```
synteq team            # show the active team
synteq team --list     # list your teams
synteq team acme       # switch by name substring or id prefix
synteq projects        # list projects in the active team
synteq config          # active profile, team, project, and user

```

Most commands that create or list resources also take `--project <id>`.

Connection profiles keep a separate login per API URL. `SYNTEQ_PROFILE` overrides the active profile for one shell.

```
synteq config profile add staging https://api.staging.cloud.synteq.com
synteq config profile use staging
synteq config profile use default

```

## Order and manage a server

`synteq order` asks what you want to order and walks you through plan, location, image, hostname, SSH key, and payment. To skip the first question, name the kind: `vps`, `gpu`, `instant-metal`, or `storage`.

```
synteq catalog            # products and plans
synteq os-images          # OS images and their short ids
synteq order vps

```

The same order without prompts, waiting until the server is running:

```
synteq order vps --plan <plan-id> --location <location-id> --image <image-id> \
  --hostname web-1.example.com --ssh-key <key-id> \
  --no-interactive --yes --wait

```

`vps`, `vds`, `gpu`, and `instant-metal` share one set of commands. Servers are named by short id, full id, hostname, or IP.

```
synteq vps list
synteq vps details web-1
synteq vps power web-1 reboot
synteq vps console web-1     # serial console; Ctrl-] to disconnect
synteq vps stats web-1

```

Power actions other than `on`, reinstalls, and resizes ask for confirmation. Resizes and extra IP addresses show a prorated quote before they charge. Physical dedicated servers use `synteq baremetal`. Every flag is in the [CLI reference](/docs/cli-reference).

## Add block storage

```
synteq storage order --name data --size 100     # prompts for location and payment
synteq storage list
synteq storage attach data --resource web-1
synteq storage detach data

```

A volume can attach to a server in the same location, and its data is kept when you detach it. To attach at order time, pass the server's full id from `synteq vps list -o json` as `--attach-resource`. Volumes can grow with `synteq storage resize` but can't shrink.

## Deploy an app

Link the directory to an app, then deploy:

```
synteq link
synteq deploy

```

`link` walks you through picking a team, project, and app, or creating one. Its optional steps set environment variables and connect GitHub; see [Deploying and configuring an app](/docs/deploying-and-configuring-an-app). Subdirectories inherit the link, so later commands need no `--app`. In an unlinked directory, `deploy` runs the walkthrough first.

`deploy` uploads the directory, follows the build, and prints the URL when the release is live. A Dockerfile is used if there is one; otherwise Synteq detects the language and builds it.

```
synteq deploy --image registry.example.com/acme/my-api:v3   # roll out an existing image
synteq deploy --create my-api --location dfw                # create an app and deploy in one step
synteq status                                               # the linked app and its last build
synteq app logs -f                                          # tail live logs until Ctrl-C

```

## Deploy a function

```
mkdir hello-fn && cd hello-fn
synteq function init hello-fn

```

`init` creates or reuses the function, links the directory, and writes a starter handler if there isn't one. The default runtime is Node.js 22, with `index.mjs`:

```
export default async function handler(event, context) {
  return { hello: "world", path: event.path };
}

```

`--runtime python312` starts from `handler.py` instead:

```
def handler(event, context):
    return {"hello": "world", "path": event["path"]}

```

If a handler already exists, `init` infers the runtime and overwrites nothing. Then deploy and call it:

```
synteq function deploy
synteq function invoke --path /
synteq function logs --lines

```

`invoke` calls `<name>.fn.synteq.app` without Synteq credentials, so you see what any caller sees. The upload limits and handler contract are in [Writing and deploying a function](/docs/writing-and-deploying-a-function).

## Billing, SSH keys, and support

```
synteq credits                                   # account credit balance and history
synteq credits add 50 --payment-method <id>      # buy credit
synteq payments                                  # saved payment methods
synteq ssh-key add --name laptop --file ~/.ssh/id_ed25519.pub
synteq ticket create --subject "Disk is slow" --message "..." --department <key>
synteq ticket list

```

`synteq team invite` adds a member to the active team. See [Roles and permissions](/docs/roles-and-permissions) for what each role can do.

## The interactive app

Bare `synteq` on a terminal opens an interactive app with your dashboard, resources, ordering, and billing. `synteq tui` opens it explicitly. It needs a browser session.

## Use in scripts

Output is a table on a terminal and JSON when piped or redirected. Force either with `-o json` or `-o table`.

```
synteq vps list -o json | jq -r '.[].hostname'

```

When stdout isn't a terminal, the CLI never prompts, opens a browser, or opens the interactive app. Pass values as flags, `--no-interactive` to wizards, and `--yes` to commands that confirm. Use `--wait` to block until an order, power action, or reinstall finishes. Exit codes and the JSON error format are in the [CLI reference](/docs/cli-reference#exit-codes-and-errors).

For an AI agent working in your repository, `synteq agents` prints a short automation guide you can append to `AGENTS.md` or `CLAUDE.md`.

When a command doesn't exist yet for an API endpoint, `synteq api` calls it directly with your credentials:

```
synteq api GET /resources

```

## What next?

- [CLI reference](/docs/cli-reference): every command, flag, scope, and exit code.
- [Creating an API key](/docs/creating-an-api-key): keys and scopes for CI and scripts.
- [Apps overview](/docs/apps-overview): plans, builds, domains, and billing for apps.
- [Functions overview](/docs/functions-overview): runtimes, scaling, triggers, and budgets.
