Back to Superset

apache-superset-extensions-cli

superset-extensions-cli/README.md

2021.41.03.7 KB
Original Source
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->

apache-superset-extensions-cli

Official command-line interface for building, bundling, and managing Apache Superset extensions. This CLI tool provides developers with everything needed to create, develop, and package extensions for the Superset ecosystem.

šŸš€ Features

  • Extension Scaffolding - Generate initial folder structure and scaffold new extension projects
  • Validation - Validate extension structure and configuration before building
  • Development Server - Automatically rebuild extensions as files change during development
  • Build System - Build extension assets for production deployment
  • Bundle Packaging - Package extensions into distributable .supx files

šŸ“¦ Installation

bash
pip install apache-superset-extensions-cli

šŸ› ļø Quick Start

Available Commands

bash
# Scaffold a new extension project (interactive prompts, or pass options directly)
superset-extensions init [--publisher <publisher>] [--name <name>] [--display-name <name>]
                         [--version <version>] [--license <license>]
                         [--frontend/--no-frontend] [--backend/--no-backend]

# Validate extension structure and configuration
superset-extensions validate

# Build extension assets for production (runs validate first)
superset-extensions build

# Package extension into a distributable .supx file (runs build first)
superset-extensions bundle [--output/-o <path>]

# Automatically rebuild extension as files change during development
superset-extensions dev

šŸ“‹ Extension Structure

The CLI scaffolds extensions with the following structure:

{publisher}.{name}/             # e.g., my-org.dashboard-widgets/
ā”œā”€ā”€ extension.json              # Extension configuration and metadata
ā”œā”€ā”€ .gitignore
ā”œā”€ā”€ frontend/                   # Optional frontend code
│   ā”œā”€ā”€ src/
│   │   └── index.tsx           # Frontend entry point
│   ā”œā”€ā”€ package.json
│   ā”œā”€ā”€ webpack.config.js
│   └── tsconfig.json
└── backend/                    # Optional backend code
    ā”œā”€ā”€ src/
    │   └── {publisher}/        # e.g., my_org/
    │       └── {name}/         # e.g., dashboard_widgets/
    │           └── entrypoint.py
    └── pyproject.toml

šŸ“„ License

Licensed under the Apache License, Version 2.0. See LICENSE for details.