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

# Command line interface

## nicos

```bash theme={null}
nix run github:plmercereau/nicos -- [OPTIONS] COMMAND [ARGS]...
```

<ParamField path="Options">
  |          |                             |
  | -------- | --------------------------- |
  | `--help` | Show this message and exit. |
</ParamField>

<ParamField path="Commands">
  |                           |                                         |
  | ------------------------- | --------------------------------------- |
  | [build](#nicos-build)     | Build a machine ISO image.              |
  | [create](#nicos-create)   | Create a new machine in the cluster.    |
  | [deploy](#nicos-deploy)   | Deploy one or several existing machines |
  | [init](#nicos-init)       | Initialise a new cluster.               |
  | [install](#nicos-install) | Install a machine using nixos-anywhere. |
  | [secrets](#nicos-secrets) | Manage the secrets for the cluster      |
</ParamField>

## nicos build

```bash theme={null}
nix run github:plmercereau/nicos -- build [OPTIONS] [MACHINE]
```

Build a machine ISO image.

<ParamField path="Options">
  |                               |                                                                                |
  | ----------------------------- | ------------------------------------------------------------------------------ |
  | `-k, --private-key-path TEXT` | The path to the private key to use. Defaults to ssh\_\<machine>\_ed25519\_key. |
  | `--help`                      | Show this message and exit.                                                    |
</ParamField>

## nicos create

```bash theme={null}
nix run github:plmercereau/nicos -- create [OPTIONS] [NAME]
```

Create a new machine in the cluster.

<ParamField path="Options">
  |                        |                                                             |
  | ---------------------- | ----------------------------------------------------------- |
  | `--rekey / --no-rekey` | Rekey the secrets after creating the machine configuration. |
  | `--stage / --no-stage` | Stage the changes to git.                                   |
  | `--help`               | Show this message and exit.                                 |
</ParamField>

## nicos deploy

```bash theme={null}
nix run github:plmercereau/nicos -- deploy [OPTIONS] [MACHINES]...
```

Deploy one or several existing machines

<ParamField path="Options">
  |                  |                                |
  | ---------------- | ------------------------------ |
  | `--all`          | Deploy all available machines. |
  | `--remote-build` | Build on remote host.          |
  | `--help`         | Show this message and exit.    |
</ParamField>

## nicos init

```bash theme={null}
nix run github:plmercereau/nicos -- init [OPTIONS]
```

Initialise a new cluster.

<ParamField path="Options">
  |                        |                             |
  | ---------------------- | --------------------------- |
  | `--stage / --no-stage` | Stage the changes to git.   |
  | `--help`               | Show this message and exit. |
</ParamField>

## nicos install

```bash theme={null}
nix run github:plmercereau/nicos -- install [OPTIONS] [MACHINE] [IP]
```

Install a machine using nixos-anywhere.

<ParamField path="Options">
  |                  |                                                                                   |
  | ---------------- | --------------------------------------------------------------------------------- |
  | `--user TEXT`    | User that will connect to the machine through nixos-anywhere.                     |
  | `--remote-build` | build the closure on the remote machine instead of locally and copy-closuring it. |
  | `--help`         | Show this message and exit.                                                       |
</ParamField>

## nicos secrets

```bash theme={null}
nix run github:plmercereau/nicos -- secrets [OPTIONS] COMMAND [ARGS]...
```

Manage the secrets for the cluster

<ParamField path="Options">
  |          |                             |
  | -------- | --------------------------- |
  | `--help` | Show this message and exit. |
</ParamField>

<ParamField path="Commands">
  |                                 |                                                           |
  | ------------------------------- | --------------------------------------------------------- |
  | [edit](#nicos-secrets-edit)     | Edit a secret                                             |
  | [export](#nicos-secrets-export) | Export the secrets config in the cluster as a JSON object |
  | [list](#nicos-secrets-list)     | List the secrets in the cluster                           |
  | [rekey](#nicos-secrets-rekey)   | Rekey all the secrets in the cluster.                     |
  | [user](#nicos-secrets-user)     | Edit a user password                                      |
  | [vpn](#nicos-secrets-vpn)       | Add or replace a Wireguard private key of a given host    |
  | [wifi](#nicos-secrets-wifi)     | Edit wifi networks and passwords                          |
</ParamField>

## nicos secrets edit

```bash theme={null}
nix run github:plmercereau/nicos -- secrets edit [OPTIONS] PATH
```

Edit a secret

<ParamField path="Options">
  |                        |                             |
  | ---------------------- | --------------------------- |
  | `--stage / --no-stage` | Stage the changes to git.   |
  | `--help`               | Show this message and exit. |
</ParamField>

## nicos secrets export

```bash theme={null}
nix run github:plmercereau/nicos -- secrets export [OPTIONS]
```

Export the secrets config in the cluster as a JSON object

<ParamField path="Options">
  |          |                             |
  | -------- | --------------------------- |
  | `--help` | Show this message and exit. |
</ParamField>

## nicos secrets list

```bash theme={null}
nix run github:plmercereau/nicos -- secrets list [OPTIONS]
```

List the secrets in the cluster

<ParamField path="Options">
  |          |                             |
  | -------- | --------------------------- |
  | `--help` | Show this message and exit. |
</ParamField>

## nicos secrets rekey

```bash theme={null}
nix run github:plmercereau/nicos -- secrets rekey [OPTIONS]
```

Rekey all the secrets in the cluster.

<ParamField path="Options">
  |                        |                             |
  | ---------------------- | --------------------------- |
  | `--stage / --no-stage` | Stage the changes to git.   |
  | `--help`               | Show this message and exit. |
</ParamField>

## nicos secrets user

```bash theme={null}
nix run github:plmercereau/nicos -- secrets user [OPTIONS] NAME [PASSWORD]
```

Edit a user password

<ParamField path="Options">
  |                        |                                                               |
  | ---------------------- | ------------------------------------------------------------- |
  | `--stage / --no-stage` | Stage the changes to git.                                     |
  | `--force`              | Force the change without prompt if the secret already exists. |
  | `--help`               | Show this message and exit.                                   |
</ParamField>

## nicos secrets vpn

```bash theme={null}
nix run github:plmercereau/nicos -- secrets vpn [OPTIONS] [NAME]
```

Add or replace a Wireguard private key of a given host

<ParamField path="Options">
  |                        |                                                               |
  | ---------------------- | ------------------------------------------------------------- |
  | `--stage / --no-stage` | Stage the changes to git.                                     |
  | `--force`              | Force the change without prompt if the secret already exists. |
  | `--help`               | Show this message and exit.                                   |
</ParamField>

## nicos secrets wifi

```bash theme={null}
nix run github:plmercereau/nicos -- secrets wifi [OPTIONS]
```

Edit wifi networks and passwords

<ParamField path="Options">
  |                        |                             |
  | ---------------------- | --------------------------- |
  | `--stage / --no-stage` | Stage the changes to git.   |
  | `--help`               | Show this message and exit. |
</ParamField>
