A modern command-line interface for Apache Superset and Preset workspaces
Brought to you and fully compatible with Preset β’ For power users and AI agents
π§ͺ Beta Release: This is an experimental beta release for Preset customers and the Superset community. We welcome feedback and contributions! Please report issues at https://github.com/preset-io/superset-sup/issues
'sup is a solid CLI for Apache Superset power users and their agents. It provides sectioned help, rich terminal formatting, and git-like workflows for managing Superset and Preset workspaces efficiently.
[Screenshot of beautiful ASCII art and sectioned help will go here]
- Run any SQL through Superset's data access layer - get results as rich tables, CSV, YAML or JSON
- Backup and restore charts, dashboards, and datasets with full dependency tracking
- Synchronize assets across Superset instances with Jinja2 templating for customization
- Enrich metadata to/from dbt Core/Cloud - more integrations to come
- Automate workflows and integrate with CI/CD pipelines
- Perfect for scripting and AI-assisted data exploration
pip install superset-supOR
pip install git+https://github.com/preset-io/superset-sup.gitThe beautiful sectioned help guides you through the perfect workflow:
# π§ Configuration & Setup
sup config auth # Set up authentication credentials
sup config show # Verify current settings
# π Direct Data Access
sup sql "SELECT COUNT(*) FROM users" # Beautiful Rich table
sup sql "SELECT * FROM sales" --json # JSON for agents
sup sql "SELECT * FROM sales" --csv # CSV export
# π Manage Assets
sup workspace list # Find your workspace
sup workspace use 123 # Set default workspace
sup chart list --mine # Your charts with server-side search
sup chart data 3628 --csv # Export chart data directly
# π Synchronize Assets Across Workspaces
sup sync create ./my_sync --source 123 --targets 456,789 # Git-ready sync
sup sync run ./my_sync --dry-run # Preview operations
sup sync run ./my_sync # Execute syncsup config- Beautiful configuration guide with sources, settings, and setup stepssup config auth- Set up authentication credentialssup config show- Display current configurationsup config set workspace-id 123- Set default workspace
sup sql "query"- Execute SQL with beautiful outputsup sql --interactive- Interactive SQL session (coming soon)sup sql "query" --json- JSON output for automationsup sql "query" --porcelain- Machine-readable output
sup workspace list- List available workspacessup database list- Database operationssup dataset list --search="users"- Server-side search by table namesup chart list --mine --search="revenue"- Multi-field chart searchsup chart sql 3628- Get compiled SQL behind any chartsup chart data 3628 --csv- Export actual chart datasup dashboard list --search="exec"- Dashboard title/slug searchsup query list --mine- Discover saved queriessup user list- User management
sup sync create- Create sync configuration with templatingsup sync run --dry-run- Preview sync operationssup sync validate- Validate sync configuration- Enterprise cross-workspace workflows with Jinja2 templating
Commands are organized in logical sections that guide your workflow:
- Configuration & Setup β Direct Data Access β Manage Assets β Synchronize
- Rich Tables: Colorful, clickable tables with emerald green Preset branding
- JSON: Perfect for AI agents and automation (
--json) - CSV: Direct data export (
--csv) - YAML: Configuration-friendly format (
--yaml) - Porcelain: Machine-readable, no decorations (
--porcelain)
Every entity command supports powerful, consistent filters:
--mine # Objects owned by current user
--name "pattern*" # Name pattern matching with wildcards
--limit 50 # Result pagination (default: 50)
--search "revenue" # Server-side search (charts, dashboards,
# datasets)
--json # JSON output for automationPerfect for AI assistants and automation:
sup chart data 3628 --json --limit=100 # Structured data access
sup sql "SELECT COUNT(*) FROM users" --json # Direct SQL with JSON
sup dashboard list --search="exec" --porcelain # Machine-readable output# Pull charts + dependencies to filesystem
sup chart pull --mine # Pull your charts + datasets +
# databases
sup chart pull --name="*revenue*" # Pull revenue charts +
# dependencies
sup chart pull --id=3586 # Pull specific chart +
# dependencies
# Push from filesystem to workspace
sup chart push # Push to configured target
# workspace
sup chart push --workspace-id=456 # Push to specific workspace
sup chart push --overwrite --force # Push with overwrite, skip
# confirmations# Multi-target synchronization with templating
sup sync create ./templates --source 123 --targets 456,789,101
sup sync run ./templates --option env=prod # Jinja2 templating for
# environments
sup sync run --bidirectional # Two-way sync with conflict
# resolution- Typer 0.12+: Type-safe CLI with automatic help generation
- Rich 13+: Beautiful terminal formatting and tables
- Pydantic 2.0+: Configuration validation and type safety
- Pandas: Data processing and multiple output formats
- Global:
~/.sup/config.ymlfor user preferences - Project:
.sup/state.ymlfor project-specific settings - Environment:
SUP_*variables override everything - Priority: Environment β Global β Project
- Cross-workspace sync: Source workspace β multiple target workspaces
- Asset dependencies: Automatic resolution of charts β datasets β databases
- Jinja2 templating: Environment-specific customization
- Git-ready: YAML-based assets work perfectly with version control
Get the compiled SQL behind any chart - business logic included:
sup chart sql 3628
# Output: Complex SQL with filters, aggregations, joins - the actual query
# Superset runsAccess actual chart results as structured data:
sup chart data 3628 --json # Perfect for analysis, reporting, AI
# models
sup chart data 3628 --csv # Direct CSV exportEfficient search across all entity types:
- Charts:
--searchuses multi-field search (title, description, etc.) - Dashboards:
--searchsearches title and slug - Datasets:
--searchsearches table names - All searches work with
--limitfor performance
'sup is primarily designed for Preset-hosted Superset instances and has been extensively tested with Preset workspaces. All features work seamlessly with Preset's multi-workspace environment.
Does it work with my Superset instance? Most functionality should work, but depending on your authentication setup, you may need to tweak the code. We welcome contributions from the broader Superset community to improve compatibility.
Preset-free mode: A future version could remove multi-workspace constructs for single-instance Superset deployments. If you're interested in this, please contribute or open an issue.
We're open to contributions that enable 'sup for the entire Superset community. Areas that likely need work for self-hosted instances:
- Authentication methods beyond Preset API tokens
- Single-instance mode (removing workspace concepts)
- Different API endpoint structures
Multiple authentication methods supported:
sup config auth # Interactive setup
# Or set environment variables:
export SUP_PRESET_API_TOKEN="your-token"
export SUP_PRESET_API_SECRET="your-secret"SUP_WORKSPACE_ID=123 # Default workspace
SUP_DATABASE_ID=5 # Default database
SUP_TARGET_WORKSPACE_ID=456 # Cross-workspace sync target
SUP_ASSETS_FOLDER=./assets # Asset storage location'sup is designed to be AI-friendly:
- Consistent patterns: All commands follow the same filter patterns
- Structured output: JSON and porcelain modes for automation
- Server-side filtering: Efficient data access
- Minimal tokens: Optimized for AI context windows
# In your CI pipeline:
sup chart pull --mine --skip-dependencies # Pull only charts
sup chart push --workspace-id=$PROD_WS --force # Deploy to production
sup sync run ./deploy --option env=production # Multi-environment deployThis package includes three command-line tools:
sup- The modern, recommended CLI with beautiful UX (π focus of development)preset-cli- Legacy CLI for Preset workspaces (maintenance mode)superset-cli- Legacy CLI for standalone Superset (maintenance mode)
All three CLIs are installed together, ensuring backward compatibility with existing
workflows while providing a smooth migration path to the modern sup experience.
'sup replaces and modernizes the legacy tools while maintaining full compatibility:
- Beautiful UX: Rich formatting vs plain text
- Logical organization: Sectioned help vs long command lists
- Git-like workflows: Intuitive pull/push vs complex export/import
- Agent-optimized: Perfect for AI assistants
- Type-safe: Modern Python with full type hints
For users still using preset-cli or superset-cli, please refer to the
original preset-cli repository for
comprehensive documentation. We recommend migrating to sup for the best experience,
but the legacy CLIs will continue to work.
Migration path: Most commands have direct equivalents in sup. For example:
# Legacy preset-cli
preset-cli --workspaces=https://workspace.preset.io/ superset export
# Modern sup
sup workspace use 123
sup chart pull --mine