Skip to content

Configuration Reference

The refget CLI uses a TOML configuration file and environment variables to manage settings. This page documents all configuration options.

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

  1. CLI flags - Command-line arguments
  2. Environment variables - System environment
  3. Config file - ~/.refget/config.toml
  4. Defaults - Built-in default values

By default, the configuration file is located at:

~/.refget/config.toml

Override this with the REFGET_CONFIG environment variable:

Terminal window
export REFGET_CONFIG=/path/to/custom/config.toml

View the current config path:

Terminal window
refget config path

The configuration file uses TOML format with these sections:

# 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"

Local RefgetStore settings.

KeyTypeDefaultDescription
pathstring~/.refget/storePath to local RefgetStore directory
[store]
path = "~/.refget/store"

List of sequence collection API servers. Used by refget seqcol commands.

KeyTypeRequiredDescription
urlstringYesServer URL (e.g., https://seqcolapi.databio.org)
namestringNoFriendly name for the server
[[seqcol_servers]]
url = "https://seqcolapi.databio.org"
name = "databio"

Default: [{url: "https://seqcolapi.databio.org", name: "databio"}]

List of remote RefgetStores for sequence retrieval. Used by refget store commands when accessing remote data.

KeyTypeRequiredDescription
urlstringYesStore URL (supports s3://, https://, local paths)
namestringNoFriendly name for the store
[[remote_stores]]
url = "s3://my-bucket/refget-store/"
name = "cloud-store"

Default: [] (empty list)

List of GA4GH refget sequence servers. Used by SequenceClient for raw sequence retrieval.

KeyTypeRequiredDescription
urlstringYesServer URL
namestringNoFriendly name
[[sequence_servers]]
url = "https://www.ebi.ac.uk/ena/cram"
name = "ena"

Default: [] (empty list)

Database connection settings for admin commands (refget admin).

KeyTypeDefaultDescription
postgres_hoststringlocalhostPostgreSQL server hostname
postgres_portstring5432PostgreSQL server port
postgres_dbstringrefgetDatabase name
postgres_userstringpostgresDatabase username
postgres_passwordstring(none)Database password
[admin]
postgres_host = "localhost"
postgres_port = "5432"
postgres_db = "refget"
postgres_user = "postgres"
postgres_password = "secret"

Environment variables override config file values. Use these for deployment or CI/CD.

VariableConfig equivalentDescription
REFGET_CONFIG(file path)Path to config file
REFGET_STOREstore.pathLocal store path
REFGET_STORE_PATHstore.pathLocal store path (explicit form)

These replace the entire server list with a single server:

VariableConfig equivalentDescription
REFGET_SEQCOL_URLseqcol_serversSingle seqcol server URL
REFGET_STORE_URLremote_storesSingle remote store URL
REFGET_SEQUENCE_URLsequence_serversSingle sequence server URL
VariableConfig equivalentDescription
POSTGRES_HOSTadmin.postgres_hostDatabase host
POSTGRES_PORTadmin.postgres_portDatabase port
POSTGRES_DBadmin.postgres_dbDatabase name
POSTGRES_USERadmin.postgres_userDatabase user
POSTGRES_PASSWORDadmin.postgres_passwordDatabase password
Terminal window
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-app

Manage configuration from the command line:

Terminal window
# Initialize config interactively
refget config init
# Show all configuration
refget config show
# Show specific section
refget config show store
refget config show admin
# Get a specific value
refget config get store.path
refget config get admin.postgres_host
# Set a value
refget config set store.path ~/my-store
refget config set admin.postgres_host db.example.com
# Add a server
refget config add seqcol_server https://my-server.org
refget config add remote_store s3://my-bucket/store/
# Remove a server
refget config remove seqcol_server databio
refget config remove remote_store my-store
# Show config file path
refget config path
# Validate config file
refget config validate
[store]
path = "~/.refget/store"
[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]
postgres_host = "db.internal"
postgres_port = "5432"
postgres_db = "seqcol_prod"
postgres_user = "seqcol_app"
# Password via POSTGRES_PASSWORD env var for security
  1. Check the config path: refget config path
  2. Verify file exists and is valid TOML: refget config validate
  3. Check environment overrides: env | grep REFGET
  1. Verify server URLs are correct: refget config show seqcol_servers
  2. Test connectivity: refget seqcol info
  3. Check for environment overrides: echo $REFGET_SEQCOL_URL
  1. Verify settings: refget config show admin
  2. Test connection: refget admin status
  3. Check environment variables are set correctly