@vanviolet/gluex
v0.1.1
Published
Official SDK and CLI for creating Gluttony extensions
Downloads
7
Maintainers
Readme
gluex
Official SDK and CLI for building Gluttony desktop extensions.
Features
- TypeScript SDK — Full type definitions for the Gluttony Extension API
- DOM Helpers — Pre-styled UI components that match the Gluttony theme
- CSS Variables — Complete reference to all 100+ theme variables
- CLI Tool — Scaffold, build, validate, and package extensions
- Templates — Start with a basic, sidebar, or theme template
- esbuild Powered — Fast builds with tree-shaking and minification
Quick Start
# Install globally
npm install -g gluex
# Create a new extension
gluex create my-extension --template sidebar
# Build and package
cd my-extension
npm install
npm run build
# The .glx file is ready to install in Gluttony!Extension Entry Point
import type { GluttonyAPI } from '@vanviolet/gluex';
export function activate(api: GluttonyAPI) {
// Register a command
api.commands.register('hello', 'Hello World', () => {
api.ui.showNotification('Hello from my extension!');
});
// Create a sidebar panel
api.ui.registerSidebarPanel('main', {
title: 'My Extension',
render(container) {
container.innerHTML = '<div style="padding:16px">Hello!</div>';
},
});
// Add a status bar item
api.ui.registerStatusBarItem('info', {
text: 'My Ext',
alignment: 'right',
tooltip: 'My Extension is active',
});
}
export function deactivate() {
// Called on extension deactivation
}API Overview
| Namespace | Description |
|-----------|-------------|
| api.commands | Register/execute Command Palette commands |
| api.ui | Sidebar panels, panel tabs, status bar items, notifications |
| api.theme | Get/set theme, read/write CSS variables |
| api.layout | Toggle sidebar, panel, activity bar, status bar |
| api.contextMenu | Show context menus |
| api.fs | File system operations (read, write, list, create, delete) |
| api.http | HTTP requests (GET, POST, etc.) |
| api.system | System info, environment variables |
| api.window | Minimize, maximize, close window |
| api.storage | Extension-scoped persistent key-value storage |
| api.extension | Extension ID, path, subscriptions |
CLI Commands
| Command | Description |
|---------|-------------|
| gluex create [name] | Scaffold a new extension |
| gluex build | Bundle and package as .glx |
| gluex dev | Watch mode for development |
| gluex validate | Validate manifest.json |
| gluex help | Show help |
DOM Helpers
Build themed UI easily:
import {
createPanel, createHeading, createButton,
createInput, createList, cssVar, CSS_VARS,
} from '@vanviolet/gluex/helpers';Documentation
License
MIT
