/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.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install sql-formatter - 安装完成后,直接呼叫该 Skill 的名称或使用
/sql-formatter触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 163 次。
如何安装 Sql Formatter?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install sql-formatter」即可一键安装,无需额外配置。
Sql Formatter 是免费的吗?
是的,Sql Formatter 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Sql Formatter 支持哪些平台?
Sql Formatter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Sql Formatter?
由 John Wang(@johnnywang2001)开发并维护,当前版本 v1.0.0。