Sql Formatter

v1.0.0

Format, minify, and lint SQL queries from the command line. Formats SQL with proper indentation and keyword casing, minifies by removing whitespace and comme...

0· 166·0 current·0 all-time
byJohn Wang@johnnywang2001

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for johnnywang2001/sql-formatter.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Sql Formatter" (johnnywang2001/sql-formatter) from ClawHub.
Skill page: https://clawhub.ai/johnnywang2001/sql-formatter
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install sql-formatter

ClawHub CLI

Package manager switcher

npx clawhub@latest install sql-formatter
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
Name/description match the included Python script and SKILL.md. The skill formats, minifies, and lints SQL using a local Python script; no unexpected services, credentials, or binaries are required.
Instruction Scope
SKILL.md instructs the agent/user to run scripts/sql_format.py against provided SQL (files or stdin). The instructions reference only input/output paths and formatting options — they do not ask the agent to read unrelated files, environment variables, or contact external endpoints.
Install Mechanism
No install spec; this is instruction-only with an included Python script. That is proportionate for a pure-Python, zero-dependency tool.
Credentials
No environment variables, credentials, or config paths are requested. The script imports only standard-library modules (argparse, re, sys, json) and processes supplied files/STDIN — proportional to the stated functionality.
Persistence & Privilege
Skill does not request always:true and does not modify other skills or system settings. It runs on-demand using a local script, which is appropriate.
Assessment
This skill appears to be a local, dependency-free SQL formatter/linter and is internally consistent with that purpose. Before installing or running it, (1) review the full scripts/sql_format.py file (the prompt showed a truncated tail) to ensure there are no hidden network calls or file-system operations you don't expect; (2) run the script on non-sensitive sample files first or inside a sandbox if you are unsure of the source; and (3) prefer installing only skills from authors you trust or with a published homepage/repository if you plan to run them on sensitive data.

Like a lobster shell, security has layers — review code before you run it.

latestvk97ft2cyweyb04a04pvt3a9f8x836jve
166downloads
0stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

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 <>, 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.

Comments

Loading comments...