/install sql-formatter
SQL Formatter
Format, minify, and lint SQL with zero dependencies.
Commands
All commands use scripts/sql_format.py.
Format SQL
python3 scripts/sql_format.py format --sql "SELECT id, name FROM users WHERE active = true"
python3 scripts/sql_format.py format --input query.sql
python3 scripts/sql_format.py format --input query.sql --output formatted.sql
python3 scripts/sql_format.py format --input query.sql --indent 4 --lowercase
echo "SELECT * FROM t" | python3 scripts/sql_format.py format --input -
Adds line breaks before major clauses (SELECT, FROM, WHERE, JOIN, ORDER BY, etc.), indents AND/OR/ON, and uppercases keywords by default.
Minify SQL
python3 scripts/sql_format.py minify --sql "SELECT id, name FROM users -- comment"
python3 scripts/sql_format.py minify --input query.sql
Strips comments, collapses whitespace, removes unnecessary spaces around parentheses and commas.
Lint SQL
python3 scripts/sql_format.py lint --input query.sql
python3 scripts/sql_format.py lint --sql "SELECT * FROM users WHERE 1=1" --json
Checks for: SELECT *, multiple spaces, tabs, != vs \x3C>, double commas, WHERE 1=1, long lines (>120 chars), trailing whitespace, missing semicolons, inconsistent keyword casing.
Supported SQL
Handles SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, WITH (CTEs), JOINs (all types), subqueries, string literals, double-quoted identifiers, single-line and multi-line comments.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install sql-formatter - After installation, invoke the skill by name or use
/sql-formatter - Provide required inputs per the skill's parameter spec and get structured output
What is Sql Formatter?
Format, minify, and lint SQL queries from the command line. Formats SQL with proper indentation and keyword casing, minifies by removing whitespace and comme... It is an AI Agent Skill for Claude Code / OpenClaw, with 163 downloads so far.
How do I install Sql Formatter?
Run "/install sql-formatter" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Sql Formatter free?
Yes, Sql Formatter is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Sql Formatter support?
Sql Formatter is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Sql Formatter?
It is built and maintained by John Wang (@johnnywang2001); the current version is v1.0.0.