A VSCode extension that formats SQL files using the Sleek CLI tool.
- Format SQL documents with
Shift+Alt+F - Format SQL selections
- Check formatting status
- Status bar indicator showing format status
- Configurable options for indentation, casing, and spacing
- Format on save/paste (optional)
- Automatic CLI download - downloads Sleek CLI automatically if not found
- Auto-update checking - checks for Sleek CLI updates every 24 hours
- Version management - view current version and update notifications
The extension will automatically download the Sleek CLI tool when needed.
Alternatively, you can install it manually:
cargo install sleek- Open a
.sqlfile - Press
Shift+Alt+Fto format (extension will download Sleek CLI if needed) - Or use Command Palette → "Sleek: Format Document"
Available settings in VSCode preferences:
sleek.executable- Path to sleek executable (default: "sleek")sleek.indentSpaces- Number of spaces for indentation (default: 4)sleek.uppercase- Convert keywords to UPPERCASE (default: true)sleek.linesBetweenQueries- Line breaks between queries (default: 2)sleek.trailingNewline- Add trailing newline (default: false)sleek.formatOnSave- Auto-format on save (default: false)sleek.formatOnPaste- Auto-format on paste (default: false)
Sleek: Format Document- Format entire SQL fileSleek: Format Selection- Format selected SQL textSleek: Check Formatting- Check if SQL is properly formattedSleek: Download CLI- Manually download/update Sleek CLISleek: Check for Updates- Check for available CLI updatesSleek: Show Version Info- Display current Sleek CLI version
Before:
select id, name from users where status = 'active'After:
SELECT
id,
name
FROM
users
WHERE
STATUS = 'active'MIT
Contributing? For development, CI/CD, and testing details, see the project releases guide.
To build and test the extension locally:
npm install
npm run compile # Build the extension
npm test # Run tests
npm run tdd # Watch mode for tests- Source:
src/ - Tests:
src/*.test.ts - Build output:
out/ - Package:
npm run package(creates.vsixfile for manual install or publishing)