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

# rig ssh add

> Register an SSH public key and set up `ssh <workspace>` on this machine

Available **local**. Reference source: CLI `0.13.0-rc.5` (`824aefd6ad16`).

Use this command from your local terminal. Registers a public key on your account and sets up `ssh <workspace>` on this machine: a `Host` entry per workspace in `~/.config/rigbox/ssh_config`, which `~/.ssh/config` includes. Without `--file` it uses `~/.ssh/id_ed25519.pub`, then `~/.ssh/id_rsa.pub`, and creates an ed25519 key when you have neither. Without `--name` the key is named `laptop-` followed by your host name. A key that is already on your account is reported, not added again.

## Examples

Register your default key, creating one if needed, and set up `ssh <workspace>` for your workspaces.

```bash theme={null}
rig ssh add
```

Register a specific public key under a name you choose.

```bash theme={null}
rig ssh add --name work-laptop --file ~/.ssh/work_ed25519.pub
```

Inspect the supported arguments before running this command. Help is offline and does not modify resources.

```bash theme={null}
rig ssh add --help
```

## Local syntax

```text theme={null}
Usage: rigbox ssh add [OPTIONS]
```

### Arguments and flags

| Argument | Description | Details |
| - | - | - |
| `-n, --name` | Key name (default: laptop-\<hostname>) | Value: NAME |
| `-f, --file` | Path to public key file (default: \~/.ssh/id\_ed25519.pub, created if you have no key) | Value: FILE |
| `--output` | Output format \[default: human, or `rig config set output …`] | Global; Value: OUTPUT; Choices: human, json, yaml, text, table |
| `--query` | Filter output with a JMESPath expression | Global; Value: JMESPATH |
| `--cli-input-json` | Read inputs from a JSON file or '-' (stdin) | Global; Value: FILE |
| `--cli-input-yaml` | Read inputs from a YAML file or '-' (stdin) | Global; Value: FILE; Conflicts: cli\_input\_json |
| `--generate-cli-skeleton` | Print a fillable input template, then exit | Global; Default: false |
| `--no-pager` | Do not pipe help output through a pager | Global; Default: false |
| `-v, --verbose` | Verbose diagnostics on stderr: per-phase deploy tracing, job-poll status, and transport commands. Useful for debugging a slow or stuck `rig deploy` | Global; Default: false |
| `-h, --help` | Print help | |

> **Complete command help**
>
> ```text theme={null}
> Register an SSH public key and set up `ssh <workspace>` on this machine
>
> Usage: rigbox ssh add [OPTIONS]
>
> Options:
>   -n, --name <NAME>
>           Key name (default: laptop-<hostname>)
>
>       --output <OUTPUT>
>           Output format [default: human, or `rig config set output …`]
>
>           [possible values: human, json, yaml, text, table]
>
>   -f, --file <FILE>
>           Path to public key file (default: ~/.ssh/id_ed25519.pub, created if you have no key)
>
>       --query <JMESPATH>
>           Filter output with a JMESPath expression
>
>       --cli-input-json <FILE>
>           Read inputs from a JSON file or '-' (stdin)
>
>       --cli-input-yaml <FILE>
>           Read inputs from a YAML file or '-' (stdin)
>
>       --generate-cli-skeleton
>           Print a fillable input template, then exit
>
>       --no-pager
>           Do not pipe help output through a pager
>
>   -v, --verbose
>           Verbose diagnostics on stderr: per-phase deploy tracing, job-poll status, and transport commands. Useful for debugging a slow or stuck `rig deploy`
>
>   -h, --help
>           Print help
> ```


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