> ## Documentation Index
> Fetch the complete documentation index at: https://docs.internal.nscale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Instances

> Manage compute instances.

export const resource_0 = "instance"

**Aliases:** `instances`, `inst`

Commands that act on one {resource_0} take its ID either as a positional argument or with `--id`. If you omit it, the CLI opens an interactive picker, so always pass it in scripts.

## Subcommands

* [list](#list) — List instances
* [get](#get) — Get instance details
* [create](#create) — Create a new instance
* [update](#update) — Update an existing instance
* [delete](#delete) — Delete an instance
* [start](#start) — Start an instance
* [stop](#stop) — Stop an instance
* [reboot](#reboot) — Reboot an instance
* [snapshot](#snapshot) — Create a snapshot from an instance
* [ssh](#ssh) — Open an SSH session to an instance
* [sshkey](#sshkey) — Get an instance's SSH key
* [consoleoutput](#consoleoutput) — Get instance console output
* [consolesession](#consolesession) — Get a VNC console session URL

***

## list

List compute instances, optionally filtered by organization, project, network, or region.

```bash theme={null}
nscale instances list [flags]
```

### Flags

<table>
  <thead><tr><th>Flag</th><th>Description</th></tr></thead>

  <tbody>
    <tr><td><code>{"--org string"}</code></td><td>Organization ID</td></tr>
    <tr><td><code>{"--project string"}</code></td><td>Project ID</td></tr>
    <tr><td><code>{"--network string"}</code></td><td>Network ID</td></tr>
    <tr><td><code>{"--region string"}</code></td><td>Region ID</td></tr>

    <tr>
      <td>
        <code>
          {"--json"}
        </code>
      </td>

      <td>Emit the full JSON payload (mutually exclusive with <code>-q</code>)</td>
    </tr>

    <tr>
      <td>
        <code>
          {"-q, --query stringArray"}
        </code>
      </td>

      <td>jq filter for value extraction (see <a href="/docs/cli/query-output">Query output with <code>-q</code></a>)</td>
    </tr>
  </tbody>
</table>

### Example

```bash theme={null}
nscale instances list --org <org-id> --region <region-id>
```

***

## get

Get details for a specific instance.

```bash theme={null}
nscale instances get <instance-id> --org <org-id>
```

### Flags

<table>
  <thead><tr><th>Flag</th><th>Description</th></tr></thead>

  <tbody>
    <tr><td><code>{"--id string"}</code></td><td>Instance ID</td></tr>
    <tr><td><code>{"--org string"}</code></td><td>Organization ID</td></tr>

    <tr>
      <td>
        <code>
          {"--json"}
        </code>
      </td>

      <td>Emit the full JSON payload (mutually exclusive with <code>-q</code>)</td>
    </tr>

    <tr>
      <td>
        <code>
          {"-q, --query stringArray"}
        </code>
      </td>

      <td>jq filter for value extraction (see <a href="/docs/cli/query-output">Query output with <code>-q</code></a>)</td>
    </tr>
  </tbody>
</table>

***

## create

Create a new compute instance. Accepts input from a JSON file or stdin; with neither, the CLI prompts for the instance details. Optionally supply a cloud-init configuration or bind an SSH certificate authority.

```bash theme={null}
nscale instances create [flags]
```

### Flags

<table>
  <thead><tr><th>Flag</th><th>Description</th></tr></thead>

  <tbody>
    <tr><td><code>{"-f, --file string"}</code></td><td>Path to a JSON file</td></tr>
    <tr><td><code>{"--stdin"}</code></td><td>Read JSON from standard input</td></tr>
    <tr><td><code>{"--cloud-init-path string"}</code></td><td>Path to a cloud-init YAML file</td></tr>
    <tr><td><code>{"--ssh-ca-id string"}</code></td><td>SSH certificate authority ID to bind (pass empty string to clear)</td></tr>
    <tr><td><code>{"--dry-run"}</code></td><td>Preview actions and payload without persisting</td></tr>
    <tr><td><code>{"-y, --yes"}</code></td><td>Automatically confirm creation</td></tr>

    <tr>
      <td>
        <code>
          {"--json"}
        </code>
      </td>

      <td>Emit the full JSON payload (mutually exclusive with <code>-q</code>)</td>
    </tr>

    <tr>
      <td>
        <code>
          {"-q, --query stringArray"}
        </code>
      </td>

      <td>jq filter for value extraction (see <a href="/docs/cli/query-output">Query output with <code>-q</code></a>)</td>
    </tr>
  </tbody>
</table>

### Examples

```bash theme={null}
nscale instances create --file instance.json
nscale instances create --stdin < instance.json
cat instance.json | nscale instances create --stdin
```

***

## update

Update an existing instance. Accepts input from a JSON file or stdin; with neither, the CLI prompts for the fields to change. You can update the description and other mutable fields, but the instance **name is immutable** — it cannot be changed after creation.

```bash theme={null}
nscale instances update <instance-id> [flags]
```

### Flags

<table>
  <thead><tr><th>Flag</th><th>Description</th></tr></thead>

  <tbody>
    <tr><td><code>{"--id string"}</code></td><td>Instance ID</td></tr>
    <tr><td><code>{"--org string"}</code></td><td>Organization ID</td></tr>
    <tr><td><code>{"-f, --file string"}</code></td><td>Path to a JSON file</td></tr>
    <tr><td><code>{"--stdin"}</code></td><td>Read JSON from standard input</td></tr>
    <tr><td><code>{"--ssh-ca-id string"}</code></td><td>SSH certificate authority ID to bind (pass empty string to clear)</td></tr>
    <tr><td><code>{"--dry-run"}</code></td><td>Preview actions and payload without persisting</td></tr>
    <tr><td><code>{"-y, --yes"}</code></td><td>Automatically confirm update</td></tr>

    <tr>
      <td>
        <code>
          {"--json"}
        </code>
      </td>

      <td>Emit the full JSON payload (mutually exclusive with <code>-q</code>)</td>
    </tr>

    <tr>
      <td>
        <code>
          {"-q, --query stringArray"}
        </code>
      </td>

      <td>jq filter for value extraction (see <a href="/docs/cli/query-output">Query output with <code>-q</code></a>)</td>
    </tr>
  </tbody>
</table>

### Examples

```bash theme={null}
nscale instances update <instance-id> --file instance.json
nscale instances update <instance-id> --stdin < instance.json
cat instance.json | nscale instances update <instance-id> --stdin
```

***

## delete

Delete an existing instance.

```bash theme={null}
nscale instances delete <instance-id> --org <org-id> [flags]
```

### Flags

| Flag | Description |
| - | - |
| `--id string` | Instance ID |
| `--org string` | Organization ID |
| `--dry-run` | Preview actions and payload without persisting |
| `-y, --yes` | Automatically confirm deletion |

***

## start

Start a stopped instance.

```bash theme={null}
nscale instances start <instance-id> --org <org-id> [flags]
```

### Flags

| Flag | Description |
| - | - |
| `--id string` | Instance ID |
| `--org string` | Organization ID |
| `--dry-run` | Preview actions and payload without persisting |
| `-y, --yes` | Automatically confirm start |

***

## stop

Stop a running instance.

```bash theme={null}
nscale instances stop <instance-id> --org <org-id> [flags]
```

### Flags

| Flag | Description |
| - | - |
| `--id string` | Instance ID |
| `--org string` | Organization ID |
| `--dry-run` | Preview actions and payload without persisting |
| `-y, --yes` | Automatically confirm stop |

***

## reboot

Reboot an instance. Use `--hard` for a hard reboot.

```bash theme={null}
nscale instances reboot <instance-id> --org <org-id> [flags]
```

### Flags

| Flag | Description |
| - | - |
| `--id string` | Instance ID |
| `--org string` | Organization ID |
| `--hard` | Use hard reboot |
| `--dry-run` | Preview actions and payload without persisting |
| `-y, --yes` | Automatically confirm reboot |

***

## snapshot

Create an image snapshot from an instance. Accepts input from a JSON file or stdin; with neither, the CLI prompts for the snapshot name and description.

```bash theme={null}
nscale instances snapshot <instance-id> [flags]
```

### Flags

<table>
  <thead><tr><th>Flag</th><th>Description</th></tr></thead>

  <tbody>
    <tr><td><code>{"--id string"}</code></td><td>Instance ID</td></tr>
    <tr><td><code>{"--org string"}</code></td><td>Organization ID</td></tr>
    <tr><td><code>{"-f, --file string"}</code></td><td>Path to a JSON file</td></tr>
    <tr><td><code>{"--stdin"}</code></td><td>Read JSON from standard input</td></tr>
    <tr><td><code>{"--dry-run"}</code></td><td>Preview actions and payload without persisting</td></tr>
    <tr><td><code>{"-y, --yes"}</code></td><td>Automatically confirm snapshot</td></tr>

    <tr>
      <td>
        <code>
          {"--json"}
        </code>
      </td>

      <td>Emit the full JSON payload (mutually exclusive with <code>-q</code>)</td>
    </tr>

    <tr>
      <td>
        <code>
          {"-q, --query stringArray"}
        </code>
      </td>

      <td>jq filter for value extraction (see <a href="/docs/cli/query-output">Query output with <code>-q</code></a>)</td>
    </tr>
  </tbody>
</table>

### Examples

```bash theme={null}
nscale instances snapshot <instance-id> --file snapshot.json
nscale instances snapshot <instance-id> --stdin < snapshot.json
cat snapshot.json | nscale instances snapshot <instance-id> --stdin
```

***

## ssh

Open an interactive SSH session to an instance using the system SSH client.

```bash theme={null}
nscale instances ssh <instance-id> [flags]
```

### Flags

| Flag | Description |
| - | - |
| `--id string` | Instance ID |
| `--org string` | Organization ID |
| `-l, --ssh-user string` | SSH login user (default: `"root"`) |

### Examples

```bash theme={null}
nscale instances ssh <instance-id>
nscale instances ssh --id <instance-id>
nscale instances ssh --org <org-id>
nscale instances ssh <instance-id> --ssh-user ubuntu
nscale instances ssh <instance-id> -l ubuntu
nscale instances ssh -l ubuntu
nscale instances ssh <instance-id> -- -L 8443:127.0.0.1:443
```

***

## sshkey

Get the SSH key for an instance.

```bash theme={null}
nscale instances sshkey <instance-id> --org <org-id>
```

### Flags

<table>
  <thead><tr><th>Flag</th><th>Description</th></tr></thead>

  <tbody>
    <tr><td><code>{"--id string"}</code></td><td>Instance ID</td></tr>
    <tr><td><code>{"--org string"}</code></td><td>Organization ID</td></tr>

    <tr>
      <td>
        <code>
          {"--json"}
        </code>
      </td>

      <td>Emit the full JSON payload (mutually exclusive with <code>-q</code>)</td>
    </tr>

    <tr>
      <td>
        <code>
          {"-q, --query stringArray"}
        </code>
      </td>

      <td>jq filter for value extraction (see <a href="/docs/cli/query-output">Query output with <code>-q</code></a>)</td>
    </tr>
  </tbody>
</table>

***

## consoleoutput

Retrieve the serial console output of an instance.

```bash theme={null}
nscale instances consoleoutput <instance-id> --org <org-id> [flags]
```

### Flags

<table>
  <thead><tr><th>Flag</th><th>Description</th></tr></thead>

  <tbody>
    <tr><td><code>{"--id string"}</code></td><td>Instance ID</td></tr>
    <tr><td><code>{"--org string"}</code></td><td>Organization ID</td></tr>
    <tr><td><code>{"--length int"}</code></td><td>Output length in bytes (0 uses API default)</td></tr>

    <tr>
      <td>
        <code>
          {"--json"}
        </code>
      </td>

      <td>Emit the full JSON payload (mutually exclusive with <code>-q</code>)</td>
    </tr>

    <tr>
      <td>
        <code>
          {"-q, --query stringArray"}
        </code>
      </td>

      <td>jq filter for value extraction (see <a href="/docs/cli/query-output">Query output with <code>-q</code></a>)</td>
    </tr>
  </tbody>
</table>

***

## consolesession

Get a VNC console session URL for an instance.

```bash theme={null}
nscale instances consolesession <instance-id> --org <org-id>
```

### Flags

| Flag | Description |
| - | - |
| `--id string` | Instance ID |
| `--org string` | Organization ID |

***

## Related

<CardGroup cols={2}>
  <Card title="Instances (Console)" icon="browser" href="/docs/compute/create-new-instances">
    Create and manage instances via the Console UI.
  </Card>

  <Card title="Custom Images" icon="image" href="/docs/storage/custom-images">
    Upload and use custom OS images for instances.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.