# CLI: Account & Workspaces

> Read account info, API keys, credits, workspace summaries and members, and create, rename, or delete workspaces from the meshive CLI.

Source: https://docs.meshive.ai/sdk-cli/cli/workspaces/

Account and workspace commands in the `meshive` CLI. See [CLI Overview & Options](/sdk-cli/cli/) for global flags (`-o json`, `-o name`, `--api-key`) and write confirmation rules.

## `meshive me`

Shows the owner of the current API key — email, username, and role. Alias: **`whoami`**.

```bash
meshive me
```

```text
email:    you@example.com
username: you
role:     user
```

## `meshive api-keys`

Lists your active API keys. Alias: **`keys`**. Only the display prefix (`meshive_a1b2c3d4`) is ever shown — the secret is returned once at creation and is not stored, so there is no way to reveal it later. Issue and revoke keys in the [console](https://console.meshive.ai).

```bash
meshive api-keys
```

Columns: **NAME**, **ID**, **PREFIX**, **SCOPES**, **STATUS**, **CREATED**, **LAST USED**, **EXPIRES**.

## `meshive credit`

Shows your credit balance (GPU pods, tasks and serverless inference all draw from it), the auto-recharge setting, and whether a default payment method is on file. `-o name` prints just the balance.

```bash
meshive credit
```

## `meshive credit-history`

Lists credit top-ups, refunds and chargebacks. Refunds and chargebacks are negative; a chargeback that is later reversed appears as a positive row. Defaults to the last 90 days.

```bash
meshive credit-history
meshive credit-history --since 2026-07-01 --until 2026-07-31
```

Columns: **DATE**, **AMOUNT**, **METHOD**, **PAID**, **ID**. Stripe receipt and invoice links are not included — open them in the console.

## `meshive workspaces`

Lists the workspaces you can access. Alias: **`ws`**.

```bash
meshive workspaces
```

Columns: **NAME** (display label), **ID** (namespace name — the value you pass to `pods`/`pod`), **ROLE** (`admin`, `billing` or `viewer` — a viewer can't make changes), **STATUS**, **PODS** (pod count), **PRICE/HR**.

A workspace is ready for pods and tasks when its **STATUS** is `running`. One you just created with [`workspace-create`](/sdk-cli/cli/workspaces/#meshive-workspace-create) isn't yet, and can be missing from this list for a moment.

## `meshive workspace`

Shows one workspace: the current hourly price, the average daily cost over the last 7 days, the GPUs / vCPUs / RAM / storage it holds, a per-resource table (pods, storages, serverless deployments — active / paused / disabled), and the last 7 days of daily cost broken down by pod, storage, serverless, task, and asset.

```bash
meshive workspace <workspace>
```

Maintenance schedules and messages from hosts are in the JSON payload (`-o json`). Resources on a machine under maintenance aren't billed while its window is open.

## `meshive members`

Lists a workspace's members with their role (`admin`, `billing`, `viewer`) and join date.

```bash
meshive members <workspace>
```

## `meshive workspace-create`

```bash
meshive workspace-create [<name>] [--estimate] [--wait] [--wait-timeout <s>]
```

Creates a workspace, as you would in the console. An empty workspace costs nothing — pods, storage and tasks in it are billed as usual — so the command doesn't ask for confirmation. Needs `meshive` **1.6** or later.

| Option | Meaning |
| --- | --- |
| `<name>` | The workspace's display name: at most 63 characters, without control characters, and different from every workspace name you already use (an exact match, so `Research` and `research` are different names). Leading and trailing spaces are removed. Leave it out and a name starting with `my-workspace-` is generated. |
| `--estimate` | Print the name the workspace would get and what it costs, and stop; nothing is created. A name you already use is refused here too. |
| `--wait` | After the request is accepted, wait until the workspace is `running`, then print it. |
| `--wait-timeout <s>` | How long `--wait` waits, in seconds. |

```bash
meshive workspace-create research --estimate
meshive workspace-create research --wait
meshive workspace-create -o name          # a generated name; prints just the workspace ID
```

The output shows `accepted`, the name, the workspace ID (the **ID** column of `meshive workspaces`, which every other command takes), the transaction ID, and a reminder that the workspace must be `running` before you create anything in it. With `--wait`, it adds the status and says the workspace is running instead of the reminder. On success, `-o name` prints the workspace ID and `-o json` the raw response.

The request returns before the workspace is ready. A pod or task in a workspace that isn't `running` is refused (`Workspace not found or not ready`, `Workspace is not ready`), and storage or a serving may be accepted and then fail later — so wait for `running` first, with `--wait` or by checking [`meshive workspaces`](/sdk-cli/cli/workspaces/#meshive-workspaces). With `--wait`, the command polls every few seconds:

- A workspace that is missing from the list for a moment, or shows `terminated` for one poll, doesn't stop the wait — both can happen right after creation.
- `error` ends the wait at once with exit code `1`.
- If the workspace isn't `running` by `--wait-timeout`, the command exits `1` and names the workspace and the last status it saw. `terminated` as the last status means setup failed.

A failed wait doesn't undo the create. The workspace ID is printed on stderr before the wait starts (`Workspace <id> accepted; waiting for it to be running.`), and nothing goes to stdout after a failed wait, even with `-o name` or `-o json`. Check `meshive workspaces` before running the command again.

The request itself can be refused:

- **`Name Taken`** — one of your workspaces already has that name, whatever its status. Choose another name or leave it out.
- **A name that is too long or has control characters** is refused (HTTP 422) before anything is created.
- **`No Cluster Available`** (HTTP 503) — no cluster can take a new workspace right now. The command has already waited and retried, so wait at least 30 seconds before running it again.

Starting the command again generates a new idempotency key (see [Retrying a write](/sdk-cli/cli/#retrying-a-write)): after an interruption, check `meshive workspaces` first. If the first run did create the workspace, running again with the same name fails with `Name Taken`, and running again with no name creates a second workspace.

## `meshive workspace-update`

```bash
meshive workspace-update <workspace> --name <name> [--estimate] [-y]
```

Renames a workspace. Needs `meshive` **1.6** or later and the **admin** or **billing** role in the workspace; a `viewer` is refused. Only the display name changes: the workspace ID stays the same, so every command and script that passes the ID keeps working, and every member sees the new name. Renaming costs nothing, but the command still prints the change and asks `[y/N]`, because other people see it.

| Option | Meaning |
| --- | --- |
| `<workspace>` | The workspace ID — the **ID** column of [`meshive workspaces`](/sdk-cli/cli/workspaces/#meshive-workspaces), not its name. |
| `--name <name>` | The new name (required): at most 63 characters, without control characters, and different from the name of every other workspace you belong to (an exact match, so `Research` and `research` are different names). Leading and trailing spaces are removed. An empty name is refused (exit `2`). A workspace you have deleted no longer counts. Using the workspace's current name succeeds and changes nothing. |
| `--estimate` | Print the workspace ID, its current name and the new name, and stop; nothing is renamed and nothing is asked. A name you already use is refused here too. |
| `-y`, `--yes` | Skip the confirmation. |

```bash
meshive workspace-update a1b2c3d4e5f60718 --name research-2 --estimate
meshive workspace-update a1b2c3d4e5f60718 --name research-2 --yes
```

```text
workspace id: a1b2c3d4e5f60718
current name: research
new name:     research-2
```

After the rename the command prints the workspace ID and the confirmed name. `-o name` prints the workspace ID (with `--estimate` too), and `-o json` the raw response. The request can be refused:

- **`Name Taken`** — another of your workspaces already has that name. Choose another.
- **A name that is too long or has control characters** is refused (HTTP 422) before anything changes.
- **`Workspace Not Found`** — the workspace is already being deleted.
- **`You are not a member of workspace`** — a wrong workspace ID, or a workspace you don't belong to.

The new name is applied at once, but [`meshive workspaces`](/sdk-cli/cli/workspaces/#meshive-workspaces) can take a moment to show it, so keep using the ID.

## `meshive workspace-delete`

```bash
meshive workspace-delete <workspace> [--check] [-y]
```

Deletes a workspace that is **empty**, and only that. It can't be undone. Needs `meshive` **1.6** or later and the **admin** or **billing** role in the workspace.

The command checks the workspace first, every time. If anything is still in it, the command prints what is left on stderr and exits `1` without asking — `--yes` doesn't change that. Only an empty workspace gets the question `Delete workspace '<name>' (<id>)? This can't be undone. [y/N]`.

| Option | Meaning |
| --- | --- |
| `<workspace>` | The workspace ID — the **ID** column of [`meshive workspaces`](/sdk-cli/cli/workspaces/#meshive-workspaces), not its name. |
| `--check` | Only run the check: print whether the workspace can be deleted and what is still in it, and stop. Nothing is deleted and nothing is asked. Exit `0` if it can be deleted, `1` if not. |
| `-y`, `--yes` | Skip the confirmation (not the check). |

```bash
meshive workspace-delete a1b2c3d4e5f60718 --check
meshive workspace-delete a1b2c3d4e5f60718 --yes
```

```text
workspace id: a1b2c3d4e5f60718
name:         research
can delete:   no
Still in it:
  pods: 2
  assets: 14
  members: 1
```

The list counts what is left, by kind. The names are the `blockers` of the SDK's `check_workspace_delete`, with spaces for underscores. The SDK page [says what each one means and how to clear it](/sdk-cli/sdk/workspaces/#deleting-a-workspace).

A workspace counts as empty when none of these is left:

- pods (stopped ones too), storage volumes and servings
- tasks — queued or running ones, finished ones that are still in the Tasks list, and tasks whose outputs are still being saved
- assets, custom templates and custom registered models
- saved credentials (Hugging Face tokens, CivitAI keys, object-storage credentials, registry logins), webhooks and active inference API keys
- other members, and invitations sent in the last day that haven't been accepted
- earnings from shared serving capacity that haven't been credited yet
- operations that are still running, including the workspace's own setup

Your own `meshive_…` API keys, billing history, short-lived inference results, files in your own bucket, links added when you attach a model set and anything you have already deleted don't count, except a removed task whose outputs are still being saved.

No API key can delete a workspace that still holds things. A person can still delete it in the console, which removes what's in it for good; the [SDK reference](/sdk-cli/sdk/workspaces/#deleting-a-workspace) says how the console treats it. A write key can still delete pods, storage volumes and servings one at a time — see [Authentication](/sdk-cli/install-auth/#authentication).

A deletion runs in the background. The workspace leaves `meshive workspaces` within a moment, and its name stays taken for a while — creating a workspace with it is refused with `Name Taken` until the deletion has finished. The key's owner gets an email naming the key. `-o name` prints the workspace ID after a delete; with `--check` it prints the ID whatever the result, so rely on the exit code. `-o json` prints the raw response.
