@konversi-sdk/cli
v0.9.0
Published
The official CLI tool for scaffolding and packaging Konversi packages.
Readme
@konversi-sdk/cli
The official CLI tool for scaffolding, developing, and packaging Konversi packages to extend and interact with the Konversi ERP system.
Features
- 🚀 Zero-Config Scaffolding: Create custom Konversi packages with a single command.
- 🏢 Konversi ERP Integration: Seamlessly connect custom UI views and serverless edge handlers to your Konversi ERP system.
- ⚡ Vite-Powered: Built on top of React 19 and Vite for instant HMR and lightning-fast builds.
- 📦 One-Command Packaging: Package UI views, edge functions, and manifests into a deployable
.kpkgarchive. - 🦕 Deno Edge Functions: Built-in support for serverless backend function handlers out of the box.
Quickstart
1. Scaffold a New Konversi Package
You can run the CLI directly with npx without installing it globally:
npx @konversi-sdk/cli newOr install it globally:
npm install -g @konversi-sdk/cli
kcli newFollow the interactive prompts to set your package name and first page name:
Welcome to Konversi One CLI
◆ What is your project named?
│ my-awesome-package
└
◆ What is the name of your first page?
│ analytics
└
✔ Project scaffolded successfully!
✔ Dependencies installed successfully!Commands
kcli new
Scaffolds a new Konversi package project with interactive prompts.
# Interactive mode
kcli newThis creates a structured Konversi package project:
my-awesome-package/
├── manifest.yaml # Root package manifest (name, label, version)
├── package.json # Workspace script aliases
├── web/ # Frontend UI components for Konversi ERP
│ ├── manifest.yaml # Page route registrations
│ ├── vite.config.ts # Configured with @konversi-sdk/vite-plugin
│ ├── package.json
│ └── src/
│ └── Analytics.tsx # React page component
└── functions/ # Deno Edge Functions
├── manifest.yaml # Serverless function handlers map
└── hello-world.ts # Sample Deno HTTP functionDevelopment
Navigate to your scaffolded package directory and start the local development server:
cd my-awesome-package
npm run devThis launches the Vite dev server inside web/ with Hot Module Replacement (HMR).
kcli build
Builds the Konversi package and bundles it into a .kpkg (Konversi Package) archive ready for deployment to the Konversi ERP platform.
# Run from project root or web/ directory
kcli buildWhat kcli build does:
- Runs
vite buildto compile frontend UI components intoweb/dist/. - Reads package metadata (
name,version) frommanifest.yaml. - Creates a production package archive in the
build/directory:build/my-awesome-package-v0.0.1.kpkg
Inside the .kpkg archive:
manifest.yaml(Package Root Manifest)web/manifest.yaml(UI Route Manifest)web/dist/(Bundled UI assets)functions/(Edge Function source files)
Package Configuration
Root manifest.yaml
Defines the overall Konversi package metadata:
name: "my-awesome-package"
label: "My Awesome Package"
version: "0.0.1"UI Manifest web/manifest.yaml
Registers custom UI pages and their entry components to embed inside Konversi ERP:
modules:
- name: "my-awesome-package"
pages:
- name: "analytics"
component: "web/dist/analytics.js"Functions Manifest functions/manifest.yaml
Registers serverless edge function handlers to execute custom business logic:
functions:
- name: "hello-world"
handler: "hello-world.ts"
runtime: "deno"
trigger: "http"Binary Executables
The CLI registers two command aliases for convenience:
kclikonversi
License
MIT © Konversi One
