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

# rtk config

> View and manage RTK configuration

## Overview

Displays RTK configuration from `~/.config/rtk/config.toml` or creates a default configuration file.

## Syntax

```bash theme={null}
rtk config [OPTIONS]
```

## Options

**--create** `flag`

Create default configuration file at `~/.config/rtk/config.toml`

## Configuration File

**Location:** `~/.config/rtk/config.toml`

### Default Configuration

```toml theme={null}
[tracking]
enabled = true
history_days = 90
# Optional: custom database path
# database_path = "/custom/path/tracking.db"

[display]
colors = true
emoji = true
max_width = 120

[filters]
ignore_dirs = [
  ".git",
  "node_modules",
  "target",
  "__pycache__",
  ".venv",
  "vendor"
]
ignore_files = [
  "*.lock",
  "*.min.js",
  "*.min.css"
]

[tee]
enabled = true
mode = "failures"  # "always", "failures", "never"
directory = "~/.local/share/rtk/tee"
max_files = 20
max_size_bytes = 1048576  # 1MB
skip_small = 500  # Skip outputs < 500 chars
```

## Configuration Sections

### Tracking

Controls token savings tracking and database behavior.

**tracking.enabled** `boolean` (default: true)

Enable/disable token tracking

**tracking.history\_days** `number` (default: 90)

Days to retain tracking data before auto-cleanup

**tracking.database\_path** `string`

Custom path for tracking database. Defaults to `~/.local/share/rtk/tracking.db`.

Can also be set via environment variable: `RTK_DB_PATH=/custom/path.db`

### Display

Controls terminal output formatting.

**display.colors** `boolean` (default: true)

Enable ANSI color codes in output

**display.emoji** `boolean` (default: true)

Use emoji in output (📊, ✅, ❌, etc.)

**display.max\_width** `number` (default: 120)

Maximum output width for table formatting

### Filters

Controls automatic filtering behavior for `ls`, `find`, and other commands.

**filters.ignore\_dirs** `string[]`

Directories to exclude from listings (unless `-a` flag used)

**filters.ignore\_files** `string[]`

File patterns to exclude (glob syntax)

### Tee (Output Recovery)

Controls automatic saving of full command output on failure.

**tee.enabled** `boolean` (default: true)

Enable tee functionality

**tee.mode** `string` (default: failures)

When to save output:

* `failures` - Only on non-zero exit codes
* `always` - Save all command output
* `never` - Disable tee

**tee.directory** `string` (default: \~/.local/share/rtk/tee)

Directory for saved output files

**tee.max\_files** `number` (default: 20)

Maximum files to keep (oldest deleted first)

**tee.max\_size\_bytes** `number` (default: 1048576)

Maximum size per output file (1MB default)

**tee.skip\_small** `number` (default: 500)

Skip saving outputs smaller than N characters

## Environment Variables

Environment variables take precedence over config file:

* `RTK_DB_PATH` - Override tracking database path
* `RTK_TEE` - Override tee mode (`always`, `failures`, `never`)
* `RTK_TEE_DIR` - Override tee directory

## Usage

### View Current Config

```bash theme={null}
rtk config
```

**Output:**

```
Config: /Users/you/.config/rtk/config.toml

[tracking]
enabled = true
history_days = 90

[display]
colors = true
emoji = true
max_width = 120

[filters]
ignore_dirs = ['.git', 'node_modules', 'target', '__pycache__', '.venv', 'vendor']
ignore_files = ['*.lock', '*.min.js', '*.min.css']

[tee]
enabled = true
mode = 'failures'
directory = '~/.local/share/rtk/tee'
max_files = 20
max_size_bytes = 1048576
skip_small = 500
```

### Create Default Config

```bash theme={null}
rtk config --create
```

**Output:**

```
Created: /Users/you/.config/rtk/config.toml
```

### Edit Config

```bash theme={null}
vim ~/.config/rtk/config.toml
```

## Example Customizations

### Disable Tracking

```toml theme={null}
[tracking]
enabled = false
```

### Custom Database Location

```toml theme={null}
[tracking]
database_path = "/mnt/data/rtk.db"
```

Or via environment:

```bash theme={null}
export RTK_DB_PATH="/mnt/data/rtk.db"
rtk gain
```

### No Colors (CI/CD)

```toml theme={null}
[display]
colors = false
emoji = false
```

### Always Save Output

```toml theme={null}
[tee]
mode = "always"
max_files = 100
```

### Add Custom Ignore Patterns

```toml theme={null}
[filters]
ignore_dirs = [
  ".git",
  "node_modules",
  "target",
  "__pycache__",
  ".venv",
  "vendor",
  "build",      # Added
  ".turbo"      # Added
]
ignore_files = [
  "*.lock",
  "*.min.js",
  "*.min.css",
  "*.d.ts"      # Added
]
```

```bash Example: View config theme={null}
rtk config
# Shows current configuration
```

```bash Example: Create default theme={null}
rtk config --create
# Creates ~/.config/rtk/config.toml
```

```bash Example: Custom DB path theme={null}
export RTK_DB_PATH="/mnt/data/rtk.db"
rtk gain
# Uses custom database location
```

```bash Example: Edit config theme={null}
vim ~/.config/rtk/config.toml
# Manual editing
```

## Exit Codes

* `0` - Success
* `1` - Error creating config file

## Related Commands

* `rtk init --show` - View installation status
* `rtk gain` - View token savings (uses tracking config)
* `rtk verify` - Verify hook integrity


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