tbls
$ tbls Community Low Risktbls introspects PostgreSQL, MySQL, SQLite, BigQuery, Snowflake, and more to generate Markdown docs, Mermaid/SVG ER diagrams, schema drift diffs (tbls diff), lint checks (tbls lint), and machine-readable JSON schemas (tbls out -t json).
brew install tbls tbls out -t json --table <table> dumps exact relational metadata in one command without burning context on interactive SQL queries.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
First-class tbls out -t json with --table filtering, offline json:// DSN support, and CI-friendly exit codes on tbls diff and tbls lint.
- Supports
tbls out -t jsonand--tablescoping tbls diffandtbls lintexit non-zero in CI
Strictly read-only against target databases; only writes local documentation or diagram files when tbls doc or -o is used.
- Never executes DDL/DML mutations against target databases
Single static Go binary available via Homebrew, go install, Docker, and GitHub releases across macOS, Linux, and Windows.
- Zero-dependency Go binary via
brew install tbls
Supports 15+ databases (Postgres, MySQL, SQLite, BigQuery, Snowflake, Redshift, DynamoDB) and outputs JSON, YAML, Mermaid, and SVG.
- Multi-engine introspection and
json://offline analysis
Well-maintained by k1LoW under MIT license (v1.89.0+ resolved earlier AGPL transitive dep).
- Active
k1LoW/tblsrepository under MIT license
Detailed README, .tbls.yml schema examples, and clear --help flags per subcommand.
- Comprehensive usage docs in
k1LoW/tbls
Security, Auth & Guardrails
Reads DSN and rules from .tbls.yml, TBLS_DSN env var, or positional [DSN] argument; supports reading from local json:// schema dumps offline.
MIT open-source CLI (resolved prior dependency issue since v1.89.0); completely free.
# tbls Agent Rules - Prefer `tbls out -t json --table <name>` when inspecting unfamiliar schemas to save context tokens. - Never commit real DSN credentials into `.tbls.yml`; pass `TBLS_DSN` via environment variables.
Agent-Ready Command Recipes
Safe Read-Only Queries
tbls out -t json postgres://user:pass@localhost:5432/mydb
Streams structured JSON containing tables, columns, indexes, and foreign-key relations to stdout.
tbls diff postgres://user:pass@localhost:5432/mydb docs/schema
Exits non-zero and prints schema differences without modifying the database or doc files.
Controlled Writes & Previews
tbls doc --rm-dist postgres://user:pass@localhost:5432/mydb docs/schema
Writes updated Markdown documentation and diagram files into docs/schema.
Strengths for Agents
- +
tbls out -t jsonturns any live database into a clean JSON schema graph for agents. - + Read-only database introspection eliminates accidental schema/data mutation risk.
- +
tbls diffandtbls lintenforce schema documentation hygiene in CI.
Caveats & Pitfalls
- ! DSNs with inline passwords in
.tbls.ymlcan leak secrets if accidentally committed—use env vars. - ! Versions
v1.51.0–v1.88.0had a transitive AGPL-3.0 dependency (fixed inv1.89.0+).