Configuration

Configure Metaphori CLI to match your workflow with persistent settings and environment variables.

Config Management

View Configuration

Show all settings:

metaphori config show

Show specific value:

metaphori config show default_model

Set Configuration Values

Set default model:

metaphori config set default_model gpt-4o-mini

Set compression level:

metaphori config set default_compression_level highest

Enable verbose output:

metaphori config set verbose true

Unset Configuration Values

metaphori config unset default_model

Available Configuration Options

api_key

Your Metaphori API key

metaphori config set api_key mph-sk-xxxxx

api_url

API endpoint URL (default: https://api.metaphori.dev)

metaphori config set api_url https://custom.api.url

default_model

Default AI model for operations

metaphori config set default_model claude-3-5-sonnet

Available models: gpt-4o, gpt-4o-mini, claude-3-5-sonnet, etc.

default_compression_level

Default compression level

metaphori config set default_compression_level highest

Options: high, higher, highest

verbose

Enable detailed output

metaphori config set verbose true

output_dir

Directory for saving compressions

metaphori config set output_dir ~/Documents/compressions

Environment Variables

Environment variables override config file settings:

# Core settings
export METAPHORI_API_KEY=mph-sk-xxxxx
export METAPHORI_API_URL=https://custom.api.url

# Defaults
export METAPHORI_DEFAULT_MODEL=claude-3-5-sonnet
export METAPHORI_DEFAULT_COMPRESSION_LEVEL=highest

# Behavior
export METAPHORI_VERBOSE=true
export METAPHORI_OUTPUT_DIR=~/compressions

Tip: Add these to your shell profile (~/.bashrc, ~/.zshrc) for persistence.

Configuration File Location

The configuration file is stored at:

Mac/Linux: ~/.config/metaphori/config.json
Windows: %APPDATA%\metaphori\config.json

Priority Order

Settings are applied in this order (highest priority first):

  1. Command-line flags (e.g., --api-key)
  2. Environment variables
  3. Config file settings
  4. Default values

Global Flags

These flags work with all commands and override other settings:

--api-key

metaphori compress --api-key mph-sk-different-key document.txt

--verbose

metaphori list --verbose

--help

metaphori compress --help

Example Configurations

Development Setup

# Verbose output for debugging
metaphori config set verbose true
metaphori config set default_model gpt-4o-mini
metaphori config set default_compression_level high

Production Setup

# Optimized for quality
metaphori config set verbose false
metaphori config set default_model gpt-4o
metaphori config set default_compression_level highest

CI/CD Setup

# Use environment variables
export METAPHORI_API_KEY=$SECRET_METAPHORI_KEY
export METAPHORI_VERBOSE=false
export METAPHORI_DEFAULT_MODEL=gpt-4o-mini

Ready to use the OpenAI-compatible API?

Learn how to integrate Metaphori with any OpenAI-compatible tool.

Continue to OpenAI API Drop-in →