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

# Configure Nodes with seictl

> Install and use the seictl CLI to patch Sei node configuration and genesis files safely with merge-patch workflows.

`seictl` is a purpose-built CLI that helps you patch the configuration files of a Sei node. It handles TOML configuration files (`app.toml`, `client.toml`, `config.toml`) and JSON genesis files.

<Info>See the [`seictl` GitHub repository](https://github.com/sei-protocol/seictl).</Info>

## Features

* **Configuration management**: Patch Sei daemon configuration files (`app.toml`, `client.toml`, `config.toml`)
* **Genesis management**: Apply merge patches to genesis JSON files
* **Universal patching**: Apply merge patches to any TOML or JSON file
* **Automatic target detection**: Detects which configuration file to modify from the patch content
* **Output options**: Write to stdout or to a specific file, or modify files in place
* **Atomic writes**: Modifies files safely with atomic write operations
* **Merge patch algorithm**: Merges patches into existing configurations

## Installation

### Pre-built binaries (recommended)

Pre-built binaries are available for Linux, macOS, and Windows. Download the latest release from
the [releases page](https://github.com/sei-protocol/seictl/releases).

#### Quick install

<Accordion title="Linux (x86_64)">
  ```bash theme={null}
  curl -LO https://github.com/sei-protocol/seictl/releases/latest/download/seictl_Linux_x86_64.tar.gz
  tar -xzf seictl_Linux_x86_64.tar.gz
  sudo mv seictl /usr/local/bin/
  ```
</Accordion>

<Accordion title="Linux (ARM64)">
  ```bash theme={null}
  curl -LO https://github.com/sei-protocol/seictl/releases/latest/download/seictl_Linux_arm64.tar.gz
  tar -xzf seictl_Linux_arm64.tar.gz
  sudo mv seictl /usr/local/bin/
  ```
</Accordion>

<Accordion title="Linux (ARMv7)">
  ```bash theme={null}
  curl -LO https://github.com/sei-protocol/seictl/releases/latest/download/seictl_Linux_armv7.tar.gz
  tar -xzf seictl_Linux_armv7.tar.gz
  sudo mv seictl /usr/local/bin/
  ```
</Accordion>

<Accordion title="macOS (Apple Silicon)">
  ```bash theme={null}
  curl -LO https://github.com/sei-protocol/seictl/releases/latest/download/seictl_Darwin_arm64.tar.gz
  tar -xzf seictl_Darwin_arm64.tar.gz
  sudo mv seictl /usr/local/bin/
  ```
</Accordion>

<Accordion title="macOS (Intel)">
  ```bash theme={null}
  curl -LO https://github.com/sei-protocol/seictl/releases/latest/download/seictl_Darwin_x86_64.tar.gz

  tar -xzf seictl_Darwin_x86_64.tar.gz
  sudo mv seictl /usr/local/bin/
  ```
</Accordion>

<Accordion title="Windows (x86_64)">
  ```powershell theme={null}
  # Download from: https://github.com/sei-protocol/seictl/releases/latest/download/seictl_Windows_x86_64.zip
  # Extract and add to PATH
  ```
</Accordion>

#### Verify installation

```bash theme={null}
seictl --version
```

#### Verify download (optional)

All releases include a `checksums.txt` file for verification. For example:

```bash theme={null}
# Download checksums
curl -LO https://github.com/sei-protocol/seictl/releases/latest/download/checksums.txt

# Verify (Linux/macOS)
sha256sum -c checksums.txt 2>&1 | grep seictl_Linux_x86_64.tar.gz
```

### Build from source

Build from source if you prefer this method or need a specific configuration.

#### Prerequisites

* [Go 1.26.0 or later](https://go.dev/doc/install). The commands below build `main`. Its Go requirement is set in [`go.mod`](https://github.com/sei-protocol/seictl/blob/main/go.mod).

<Note>
  This is newer than the Go version needed to build `seid` (1.25.6). The toolchain from
  the [node setup guide](/node) is therefore a minor version behind. With the default
  `GOTOOLCHAIN=auto`, the build still works: the go command downloads the toolchain that
  `go.mod` asks for. If you have set `GOTOOLCHAIN=local` or build without network access,
  install Go 1.26.0 or later, or use a prebuilt binary above.
</Note>

#### Build

```bash theme={null}
git clone https://github.com/sei-protocol/seictl.git
cd seictl
go build -o seictl
```

### Install via Go

```bash theme={null}
go install github.com/sei-protocol/seictl@latest
```

## Usage

```
seictl [global options] command [command options] [arguments...]
```

### Global options

* `--home <path>`: The Sei home directory (default: `~/.sei`). You can also set it with the `SEI_HOME` environment variable.

## Commands

### Patch command

#### `patch`

Apply a merge patch to any TOML or JSON file. This universal patching command works with any file format. It is not
limited to Sei-specific configurations.

```bash theme={null}
seictl patch --target <file-path> [patch-file]
```

**Options:**

* `--target <path>`: Path to the TOML or JSON file to patch (required)
* `-o, --output <path>`: Write the output to the specified file
* `-i, --in-place-rewrite`: Modify the target file in place

**Examples:**

```bash theme={null}
# Patch any TOML file
seictl patch --target /path/to/config.toml patch.toml

# Patch any JSON file from stdin
echo '{"new_key": "value"}' | seictl patch --target /path/to/data.json

# Patch and save to a new file
seictl patch --target myconfig.toml patch.toml -o modified.toml

# Patch and modify in-place
seictl patch --target settings.json patch.json -i
```

**Note:** The format is detected automatically from the file extension (`.toml` or `.json`).

### Genesis commands

#### `genesis patch`

Apply a merge patch to the Sei genesis JSON file.

```bash theme={null}
seictl genesis patch [patch-file]
```

**Options:**

* `-o, --output <path>`: Write the output to the specified file
* `-i, --in-place-rewrite`: Modify the genesis file in place

**Examples:**

```bash theme={null}
# Patch from file and output to stdout
seictl genesis patch patch.json

# Patch from stdin
echo '{"chain_id": "atlantic-2"}' | seictl genesis patch

# Patch and save to a new file
seictl genesis patch patch.json -o genesis-modified.json

# Patch and modify the original file in-place
seictl genesis patch patch.json -i
```

### Config commands

#### `config patch`

Apply a merge patch to a Sei configuration file in TOML format.

```bash theme={null}
seictl config [--target <app|client|config>] patch [patch-file]
```

**Options:**

* `--target <type>`: Specify which configuration file to patch (`app`, `client`, or `config`)
  * If you do not specify a target, it is detected automatically from the patch content
* `-o, --output <path>`: Write the output to the specified file
* `-i, --in-place-rewrite`: Modify the configuration file in place

**Examples:**

```bash theme={null}
# Patch with auto-detection
seictl config patch patch.toml

# Explicitly specify the target config
seictl config --target app patch patch.toml

# Patch from stdin and output to stdout
echo 'minimum-gas-prices = "0.02usei"' | seictl config patch

# Patch and modify in-place
seictl config --target app patch patch.toml -i

# Patch and save to specific location
seictl config patch patch.toml -o /path/to/output.toml
```

## Configuration targets

The `config` command can work with three configuration files:

### `app.toml`

Application-level configuration, including:

* Gas prices and block settings
* State management (state-sync, state-commit, state-store)
* EVM configuration
* Telemetry and monitoring
* API, gRPC, and Rosetta endpoints
* IAVL and WASM settings

### `client.toml`

Client-level configuration, including:

* Chain ID
* Keyring backend
* Output format
* Node endpoint
* Broadcast mode

### `config.toml`

Node-level configuration, including:

* Database settings
* Logging configuration
* RPC and P2P settings
* Mempool and consensus parameters
* State sync and block sync
* Transaction indexing

## Merge patch behavior

The merge patch algorithm uses these rules:

1. **Nested merging**: Patches are merged recursively into nested structures
2. **Null deletion**: Setting a value to `null` removes that key from the configuration
3. **Addition**: New keys in the patch are added to the configuration
4. **Replacement**: Existing scalar values are replaced with patch values

**Example:**

Original:

```toml theme={null}
[api]
enable = true
address = "tcp://0.0.0.0:1317"
```

Patch:

```toml theme={null}
[api]
address = "tcp://0.0.0.0:1318"
swagger = true
```

Result:

```toml theme={null}
[api]
enable = true
address = "tcp://0.0.0.0:1318"
swagger = true
```

## Examples

<Accordion title="Update minimum gas prices">
  ```bash theme={null}
  echo 'minimum-gas-prices = "0.02usei"' | seictl config patch -i
  ```
</Accordion>

<Accordion title="Enable API endpoint">
  ```bash theme={null}
  cat > patch.toml << EOF
  [api]
  enable = true
  address = "tcp://0.0.0.0:1317"
  EOF

  seictl config --target app patch patch.toml -i
  ```
</Accordion>

<Accordion title="Modify genesis chain ID">
  ```bash theme={null}
  echo '{"chain_id": "pacific-1"}' | seictl genesis patch -i
  ```
</Accordion>

<Accordion title="Update multiple configuration sections">
  ```bash theme={null}
  cat > patch.toml << EOF
  minimum-gas-prices = "0.02usei"

  [telemetry]
  enabled = true
  prometheus-retention-time = 60

  [api]
  enable = true
  swagger = true
  EOF

  seictl config patch patch.toml -i
  ```
</Accordion>

<Accordion title="Patch a custom TOML configuration">
  ```bash theme={null}
  # Patch any TOML file outside the Sei directory structure
  cat > custom-patch.toml << EOF
  [database]
  host = "localhost"
  port = 5432
  EOF

  seictl patch --target /etc/myapp/config.toml custom-patch.toml -i
  ```
</Accordion>

<Accordion title="Patch a custom JSON data file">
  ```bash theme={null}
  # Modify any JSON file
  echo '{"version": "2.0", "debug": true}' | seictl patch --target /path/to/settings.json -i
  ```
</Accordion>

<Accordion title="Using custom Sei home directory">
  ```bash theme={null}
  # Via environment variable
  export SEI_HOME=/custom/path/.sei
  seictl config patch patch.toml

  # Via flag
  seictl --home /custom/path/.sei config patch patch.toml
  ```
</Accordion>

## Command comparison

### When to use each command

* **`patch`**: Use it to patch any TOML or JSON file on your system. It requires an explicit `--target` path.
* **`genesis patch`**: Use it specifically for Sei genesis files. It automatically uses `$HOME/.sei/config/genesis.json`.
* **`config patch`**: Use it specifically for Sei configuration files, with automatic target detection. It automatically uses
  files in `$HOME/.sei/config/`.

## File locations

By default, `seictl` looks for configuration files in these locations:

* Genesis: `$HOME/.sei/config/genesis.json`
* App config: `$HOME/.sei/config/app.toml`
* Client config: `$HOME/.sei/config/client.toml`
* Node config: `$HOME/.sei/config/config.toml`

Here, `$HOME` is the value of the `--home` flag or the `SEI_HOME` environment variable.

## Safety features

* **Atomic writes**: All file modifications use atomic write operations (write to a temporary file, then rename it)
* **Permission preservation**: In-place modifications keep the original file permissions
* **Format validation**: Validates file extensions before processing (must be `.toml` or `.json`)
* **Target validation**: Prevents accidental changes to the wrong configuration files
* **Auto-detection safety**: Stops if the patch could apply to more than one target
* **Early validation**: Checks the file format and that the file exists before it reads the patch data


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