安装 PostgreSQL 插件
从 gemini-cli-extensions/postgres 安装 postgres@postgres,通过 POSTGRES_* 参数连接数据库。本地 MCP 服务名为 postgresql。
export POSTGRES_DATABASE=YOUR_POSTGRES_DATABASE
export POSTGRES_USER=YOUR_POSTGRES_USER
export POSTGRES_PASSWORD=YOUR_POSTGRES_PASSWORD
codex plugin marketplace add gemini-cli-extensions/postgres
codex plugin add postgres@postgres
codex mcp list
# 可选:
# export POSTGRES_HOST=YOUR_POSTGRES_HOST
# export POSTGRES_PORT=YOUR_POSTGRES_PORT
# export POSTGRES_QUERY_PARAMS=YOUR_POSTGRES_QUERY_PARAMS
# codex plugin marketplace upgrade postgres
# 不要:
# plugin install postgres@postgres
# plugin add postgres@data-agent-kit
# /plugin install postgres@postgres
# gemini extensions install https://github.com/gemini-cli-extensions/postgres
# plugin add cloud-sql-postgresql@data-agent-kit
# plugin add alloydb@data-agent-kit
# export POSTGRES_PROJECT
# export CLOUD_SQL_POSTGRES_PROJECT
# codex mcp login postgresql
# command = "./PATH/TO/toolbox"