Skip to content

rsmenon/subzero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SubZero

SubZero (sz) is an app for quick data explorations in Snowflake from the terminal. Explore your Snowflake catalog, execute queries with an embedded neovim editor, and visualize simple line and bar charts.

Installation

Note

This has only been tested on macOS, but it should work on Linux with appropriate changes to the package manager commands.

Install dependencies via Homebrew

brew install rust neovim snowflake-cli

Verify both are on your PATH:

nvim --version
snow --version

Configure Snowflake

If you haven't already, set up a connection in ~/.snowflake/connections.toml:

[connections.default]
account = "your-account"
user = "your-user"
authenticator = "externalbrowser"  # or other auth method
warehouse = "YOUR_WH"
database = "YOUR_DB"
role = "YOUR_ROLE"

Test it:

snow sql -q "SELECT 1"

Install subzero via Cargo

cargo install --git https://github.com/rsmenon/subzero.git

Launch the binary by running sz in your terminal. Data is stored in ~/.subzero/ (catalog cache, query history, saved queries, logs).

Documentation

Basic Navigation

Subzero has three pages — Explore, Query, and Settings — accessible from the top bar. The active pane is highlighted with a blue border.

Action Key
Enter Explore mode E
Enter Query mode Q
Enter Settings mode S
Focus next pane Tab
Focus previous pane Shift+Tab
Return focus to top bar Esc
Quit Ctrl+D

Explore

The Explore tab lets you browse your Snowflake catalog — databases, schemas, tables, and views — and inspect column definitions and sample data without writing any SQL.

Tree pane (left): Navigate the catalog hierarchy.

Action Key
Move up / down / or k / j
Expand / collapse node Enter
Collapse / go to parent
Fuzzy search catalog /
Refresh catalog from Snowflake R
Move focus to detail pane Tab

The catalog is cached locally for speed. On first launch, press R to populate it. Refreshes run in the background — you can keep working while they complete.

Detail pane (right): Shows metadata for the selected table or view. Two tabs:

  • Columns — column names, types, and nullability. Press / to filter by name.
  • Preview — first rows of the table, fetched on demand. Press h / l to scroll horizontally. Press Enter on any row to open a full row detail popup.

Switch tabs with C (Columns) or P (Preview).


Query

The Query tab is where you write and run SQL. The editor is a fully embedded Neovim instance, so all normal Vim motions, registers, and undo history work as expected. Autocomplete is context-aware and draws from the cached catalog — trigger it with the standard Neovim Ctrl-XCtrl-O.

Editor pane (top):

Action Key
Run query Ctrl+R
Save query Ctrl+S
Export results to CSV Ctrl+E
New query (clear editor + results) Ctrl+N
Open query history Ctrl+P
Open saved queries Ctrl+L
Move focus to results pane Tab

Results pane (bottom): Displays query output as a scrollable table.

Action Key
Navigate rows / or k / j
Scroll columns / or h / l
Page up / down PageUp / PageDown
Jump to first / last row Home / End
Open row detail popup Enter
Move focus to editor Tab

Charts: After running a query, press Ctrl+N (from the results pane) to add a chart tab. Select a chart type, X-axis, and Y-axis in the settings panel, then choose Generate to render. You can have up to 9 chart tabs per query. Switch between tabs with number keys (19) or return to the table with T.

Saved queries: Press Ctrl+S to save the current query with a name. Ctrl+L opens the saved queries overlay where you can load, rename (e), or delete (d) entries. Ctrl+P opens run history (all previously executed queries, filterable).


Settings

The Settings tab has three panes: Connection, Cache, and Theme. Navigate between them with Tab / Shift+Tab.

Connection pane: Switch the active Snowflake connection. Press Enter to open a picker listing all connections defined in ~/.snowflake/connections.toml. Selecting one updates the warehouse, database, and role fields automatically and applies immediately.

Cache pane: Manage the local catalog cache.

  • Clear Cache — removes cached data; the tree will be empty until you refresh.
  • Refresh Now — triggers a background fetch from Snowflake to rebuild the cache.

Use h / l to move between buttons, Enter to activate.

Theme pane: Customize the color palette. Each UI element is listed with its current hex color. Navigate with j / k, press Enter to edit a value, and type a valid hex code (e.g., #ebdbb2). Press Enter to confirm or Esc to cancel. Use Reset to restore Gruvbox dark defaults, or Save to save the current theme to ~/.subzero/theme.yaml for persistence across restarts.

About

An app for quick data explorations in Snowflake from the terminal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors