Configuration Reference
The refget CLI uses a TOML configuration file and environment variables to manage settings. This page documents all configuration options.
Configuration priority
Section titled “Configuration priority”Settings are resolved in this order (highest priority first):
- CLI flags - Command-line arguments
- Environment variables - System environment
- Config file -
~/.refget/config.toml - Defaults - Built-in default values
Config file location
Section titled “Config file location”By default, the configuration file is located at:
~/.refget/config.tomlOverride this with the REFGET_CONFIG environment variable:
export REFGET_CONFIG=/path/to/custom/config.tomlView the current config path:
refget config pathConfig file format
Section titled “Config file format”The configuration file uses TOML format with these sections:
Complete example
Section titled “Complete example”# Local RefgetStore path[store]path = "~/.refget/store"
# Seqcol API servers for remote queries[[seqcol_servers]]url = "https://seqcolapi.databio.org"name = "databio"
[[seqcol_servers]]url = "https://my-internal-server.org"name = "internal"
# Remote RefgetStores for sequence retrieval[[remote_stores]]url = "s3://my-bucket/refget-store/"name = "s3-store"
# Sequence servers (GA4GH refget sequences API)[[sequence_servers]]url = "https://www.ebi.ac.uk/ena/cram"name = "ena"
# Database settings for admin commands[admin]postgres_host = "localhost"postgres_port = "5432"postgres_db = "refget"postgres_user = "postgres"postgres_password = "secret"Configuration sections
Section titled “Configuration sections”Local RefgetStore settings.
| Key | Type | Default | Description |
|---|---|---|---|
path | string | ~/.refget/store | Path to local RefgetStore directory |
[store]path = "~/.refget/store"seqcol_servers
Section titled “seqcol_servers”List of sequence collection API servers. Used by refget seqcol commands.
| Key | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Server URL (e.g., https://seqcolapi.databio.org) |
name | string | No | Friendly name for the server |
[[seqcol_servers]]url = "https://seqcolapi.databio.org"name = "databio"Default: [{url: "https://seqcolapi.databio.org", name: "databio"}]
remote_stores
Section titled “remote_stores”List of remote RefgetStores for sequence retrieval. Used by refget store commands when accessing remote data.
| Key | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Store URL (supports s3://, https://, local paths) |
name | string | No | Friendly name for the store |
[[remote_stores]]url = "s3://my-bucket/refget-store/"name = "cloud-store"Default: [] (empty list)
sequence_servers
Section titled “sequence_servers”List of GA4GH refget sequence servers. Used by SequenceClient for raw sequence retrieval.
| Key | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Server URL |
name | string | No | Friendly name |
[[sequence_servers]]url = "https://www.ebi.ac.uk/ena/cram"name = "ena"Default: [] (empty list)
Database connection settings for admin commands (refget admin).
| Key | Type | Default | Description |
|---|---|---|---|
postgres_host | string | localhost | PostgreSQL server hostname |
postgres_port | string | 5432 | PostgreSQL server port |
postgres_db | string | refget | Database name |
postgres_user | string | postgres | Database username |
postgres_password | string | (none) | Database password |
[admin]postgres_host = "localhost"postgres_port = "5432"postgres_db = "refget"postgres_user = "postgres"postgres_password = "secret"Environment variables
Section titled “Environment variables”Environment variables override config file values. Use these for deployment or CI/CD.
General settings
Section titled “General settings”| Variable | Config equivalent | Description |
|---|---|---|
REFGET_CONFIG | (file path) | Path to config file |
REFGET_STORE | store.path | Local store path |
REFGET_STORE_PATH | store.path | Local store path (explicit form) |
Server overrides
Section titled “Server overrides”These replace the entire server list with a single server:
| Variable | Config equivalent | Description |
|---|---|---|
REFGET_SEQCOL_URL | seqcol_servers | Single seqcol server URL |
REFGET_STORE_URL | remote_stores | Single remote store URL |
REFGET_SEQUENCE_URL | sequence_servers | Single sequence server URL |
Database settings
Section titled “Database settings”| Variable | Config equivalent | Description |
|---|---|---|
POSTGRES_HOST | admin.postgres_host | Database host |
POSTGRES_PORT | admin.postgres_port | Database port |
POSTGRES_DB | admin.postgres_db | Database name |
POSTGRES_USER | admin.postgres_user | Database user |
POSTGRES_PASSWORD | admin.postgres_password | Database password |
Example: Docker deployment
Section titled “Example: Docker deployment”docker run -e POSTGRES_HOST=db \ -e POSTGRES_DB=refget \ -e POSTGRES_USER=app \ -e POSTGRES_PASSWORD=secret \ -e REFGET_SEQCOL_URL=https://seqcolapi.databio.org \ my-refget-appCLI config commands
Section titled “CLI config commands”Manage configuration from the command line:
# Initialize config interactivelyrefget config init
# Show all configurationrefget config show
# Show specific sectionrefget config show storerefget config show admin
# Get a specific valuerefget config get store.pathrefget config get admin.postgres_host
# Set a valuerefget config set store.path ~/my-storerefget config set admin.postgres_host db.example.com
# Add a serverrefget config add seqcol_server https://my-server.orgrefget config add remote_store s3://my-bucket/store/
# Remove a serverrefget config remove seqcol_server databiorefget config remove remote_store my-store
# Show config file pathrefget config path
# Validate config filerefget config validateCommon configurations
Section titled “Common configurations”Minimal config (local only)
Section titled “Minimal config (local only)”[store]path = "~/.refget/store"Research server
Section titled “Research server”[store]path = "/data/refget/store"
[[seqcol_servers]]url = "https://seqcolapi.databio.org"name = "databio"
[[remote_stores]]url = "s3://lab-bucket/refget-store/"name = "lab-store"Admin/server deployment
Section titled “Admin/server deployment”[admin]postgres_host = "db.internal"postgres_port = "5432"postgres_db = "seqcol_prod"postgres_user = "seqcol_app"# Password via POSTGRES_PASSWORD env var for securityTroubleshooting
Section titled “Troubleshooting”Config not being read
Section titled “Config not being read”- Check the config path:
refget config path - Verify file exists and is valid TOML:
refget config validate - Check environment overrides:
env | grep REFGET
Server connection issues
Section titled “Server connection issues”- Verify server URLs are correct:
refget config show seqcol_servers - Test connectivity:
refget seqcol info - Check for environment overrides:
echo $REFGET_SEQCOL_URL
Database connection issues
Section titled “Database connection issues”- Verify settings:
refget config show admin - Test connection:
refget admin status - Check environment variables are set correctly