queryli
v0.1.1
Published
Multi-database CLI query tool
Maintainers
Readme
queryli
queryli is a multi-database CLI for managing connection profiles and running SQL through a persistent local daemon.
It supports PostgreSQL, MySQL, SQLite, and Oracle.
Features
- Manage multiple database connection profiles.
- Keep one active database connection alive through a background daemon.
- Run ad hoc SQL queries or execute
.sqlfiles. - Print query results as table, JSON, or CSV.
- Install a
SKILL.mdhelper for local AI coding agents.
Install
With npm:
npm install -g queryliFrom the repository root:
go install .Make sure your Go binary directory is on PATH. On Windows this is commonly:
%USERPROFILE%\go\binVerify:
queryli --helpAI Agent Skill
Install a queryli skill for supported local coding agents:
queryli install-skillBy default this installs user-level skills for:
- Codex:
~/.agents/skills/queryli/SKILL.md - Claude Code:
~/.claude/skills/queryli/SKILL.md - Cursor:
~/.cursor/skills/queryli/SKILL.md - Gemini CLI:
~/.gemini/skills/queryli/SKILL.md - Windsurf:
~/.codeium/windsurf/skills/queryli/SKILL.md
Install for one agent:
queryli install-skill --agent claude
queryli install-skill --agent cursorInstall into the current project:
queryli install-skill --agent all --scope projectUse a custom skills directory:
queryli install-skill --dir ~/.some-agent/skillsQuick Start
Create a PostgreSQL profile:
queryli profile add --name local-pg --type postgres \
--host localhost --port 5432 --user postgres --db postgres --sslmode disableCreate a SQLite profile:
queryli profile add --name local-sqlite --type sqlite --path ./dev.dbSet the active profile:
queryli profile use local-pgConnect:
QUERYLI_PASSWORD=your-password queryli connectRun a query:
queryli query "SELECT 1" --format jsonExecute a SQL file:
queryli exec ./script.sqlCheck status:
queryli status
queryli pingDisconnect:
queryli disconnectCommands
queryli profile add
queryli profile list
queryli profile remove
queryli profile use
queryli connect [profile]
queryli disconnect
queryli status
queryli ping
queryli query <sql>
queryli exec <file.sql>
queryli install-skillConfiguration
Profiles are stored in:
~/.queryli/config.yamlRuntime daemon files are stored in the same directory:
~/.queryli/daemon.pid
~/.queryli/daemon.sock
~/.queryli/daemon.meta
~/.queryli/daemon.logPasswords are not stored by profile add. Pass credentials at connect time:
QUERYLI_PASSWORD=your-password queryli connect local-pgor:
queryli connect local-pg --password your-passwordOutput Formats
Use --format or -f:
queryli query "SELECT * FROM users LIMIT 5" --format table
queryli query "SELECT * FROM users LIMIT 5" --format json
queryli query "SELECT * FROM users LIMIT 5" --format csvDevelopment
Run checks:
go test ./...Build locally:
go build .Build an amd64 binary compatible with older CPUs:
GOAMD64=v1 go build .Build the npm release binaries:
npm run build:npmThe npm release build pins GOAMD64=v1 for amd64 targets so the binaries do not require AVX-capable CPUs.
Preview the npm package:
npm pack --dry-runPublish to npm:
npm login
npm publish