corgi db shell
corgi db shell
Open an interactive shell for a db_service
Synopsis
Open an interactive shell inside the running container for a db_service.
Credentials are sourced from the corgi-compose config so you don't have to copy-paste passwords. The shell command is chosen per driver: postgres / postgis / pgvector / timescaledb → psql redis / keydb / dragonfly / redict / valkey → redis-cli mongodb → mongosh mysql / mariadb → mysql mssql → sqlcmd cassandra / scylla → cqlsh
The container must already be running (start it with: corgi run).
Examples: corgi db shell # interactive picker corgi db shell postgres # open psql for "postgres" corgi db shell postgres -e "SELECT count(*) FROM u" # run one query, exit
corgi db shell [service-name] [flags]
Options
-e, --exec string Run a single query/command non-interactively and exit.
For redis-family drivers the query is split on whitespace, so quoted
arguments containing spaces (e.g. SET foo "hello world") are not
preserved — wrap them in a script file or use the interactive shell.
-h, --help help for shell
Options inherited from parent commands
--describe Describe contents of corgi-compose file
--dockerContext string Specify docker context to use, can be default,orbctl,colima (default "default")
-d, --downAll Down all database services, stop and remove all
-l, --exampleList List examples to choose from. Click on any example to download it
-f, --filename string Custom filepath for for corgi-compose
--fromScratch Clean corgi_services folder before running
-t, --fromTemplate string Create corgi service from template url
--fromTemplateName string Create corgi service from template name and url
-g, --global Use global path to one of the services
--interactive Force interactive prompts even when no TTY/agent detected
--json Emit machine-readable JSON output
--privateToken string Private token for private repositories to download files
-r, --removeAll Remove all database services
-o, --runOnce Run corgi once and exit
--seedAll Seed all database services
--silent Hide all welcome messages
-s, --stopAll Stop all database services
-u, --upAll Up all database services, start all
--wait With --upAll: block until each db with a port accepts connections
SEE ALSO
- corgi db - Database action helpers