create
Scaffold a new Mini App project.
minikit-cli create [project-name] [options]| Option | Description |
|---|---|
| --no-install | Skip installing dependencies |
| --project-dir | Parent directory for the scaffolded project |
minikit-cli create my-app
minikit-cli create my-app --no-install
minikit-cli create my-app --project-dir /tmp/scaffolds --no-installWhen Auth is selected, the following files are added or modified during the create operation.
| File/Directory | Added/Modified | Purpose & Change |
|---|---|---|
| src/bridge/handlers/get-auth-code.ts | Added | GPBase.getAuthCode bridge handler |
| src/hooks/useAuthCode.ts | Added (conditional) | Custom hook for auth code. Only added with "fetch before render" option |
| src/api/fetch-user-data.ts | Added (conditional) | API layer for user data. Only added with "fetch before render" option |
| src/pages/home.tsx | Modified | Adds an auth handler demo; fully replaced in fetch-before-render mode |
| src/pages/layout.tsx | Modified | Calls useAuthCode() and logs result in development when fetch-before-render is enabled |
JSAPIs Commands
Below are the commands for adding and removing JSAPIs. Refer to view the complete list of available JSAPIs and learn more about each one
Note: className represents the category and starts with the GP prefix. methodName represents the main function being invoked.
jsbridge:add
Add a Host App method to call from your Mini App.
minikit-cli jsbridge:add [className] [methodName] [options]| Argument | Format | Example |
|---|---|---|
| className | PascalCase | GPAuth, GPWallet |
| methodName | camelCase | getToken, getBalance |
Both arguments are optional — omit either to be prompted.
| Option | Alias | Description |
|---|---|---|
| --cache | -c | Cache the result for the session lifetime |
minikit-cli jsbridge:add
minikit-cli jsbridge:add GPAuth getToken --cache
| File/Directory | Added/Modified | Purpose & Change |
|---|---|---|
| src/bridge/ | Added | Core JSBridge module for native communication |
| src/bridge/handlers/ | Added | All bridge handler files (device.ts, and more added by features) |
jsbridge:remove
Remove a previously added JS Bridge method and its generated hook.
minikit-cli jsbridge:remove [className] [methodName]Both arguments are optional — omit either to pick from a list.
minikit-cli jsbridge:remove
minikit-cli jsbridge:remove GPAuth getToken
i18n:add
Add multi-language support.
minikit-cli i18n:add [options]| Option | Values | Description |
|---|---|---|
| --source | json | Translation source. Omit to be prompted. |
minikit-cli i18n:add
| File/Directory | Added/Modified | Purpose & Change |
|---|---|---|
| src/constants/locale.ts | Added | Supported locales configuration |
| project.inlang/ | Added | Inlang project configuration for managing translations |
| messages/ | Added | Paraglide message catalogs for storing translations |
| src/globals.d.ts | Modified | Adds i18n type definitions |
| src/bridge/types.ts | Modified | Adds Locale and LocaleResponse types for bridge communication |
| src/bridge/index.ts | Modified | Registers GPBase.getLocale bridge handler |
| vite.config.ts | Modified | Adds Paraglide Vite plugin for compilation |
| package.json | Modified | Adds compile:messages script and @inlang/paraglide-js dependency |
| src/pages/layout.tsx | Modified | Synchronizes active locale on app load |
snap:add
Add Snap Checkout (Midtrans) payment integration.
minikit-cli snap:add
| File/Directory | Added/Modified | Purpose & Change |
|---|---|---|
| src/snap-checkout/ | Added | Snap Checkout integration module directory |
| src/snap-checkout/fetch-request.ts | Added | Request fetching logic for Snap API |
| src/snap-checkout/use-fetch-request.ts | Added | Custom hook for managing fetch requests |
| src/snap-checkout/types.ts | Added | TypeScript type definitions for Snap Checkout |
| src/snap-checkout/snap-checkout.tsx | Added | Main Snap Checkout component |
| src/snap-checkout/index.ts | Added | Module exports for Snap Checkout |
| src/pages/snap-checkout.tsx | Added | Page component for Snap Checkout flow |
| src/pages/routes.ts | Modified | Registers the /snap-checkout route |
| src/pages/home.tsx | Modified | Adds CTA (Call-to-Action) linking to /snap-checkout |
| .env.example | Modified | Adds VITE_MIDTRANS_SNAPJS_URL and VITE_MIDTRANS_CLIENT_KEY |
| src/vite-env.d.ts | Modified | Adds TypeScript types for Midtrans environment variables |
vconsole:add
Add vConsole, an in-app debug panel.
minikit-cli vconsole:add
| File/Directory | Added/Modified | Purpose & Change |
|---|---|---|
| src/debug/vconsole.ts | Added | vConsole initialization and setup logic |
| src/main.tsx | Modified | Imports and calls initVConsole() before app renders |
| package.json | Modified | Adds vconsole npm dependency |
| .env.example | Modified | Adds VITE_ENABLE_VCONSOLE environment variable |
| src/vite-env.d.ts | Modified | Adds TypeScript type definition for VITE_ENABLE_VCONSOLE |
update
Update the MiniKit CLI itself to the latest published version.
minikit-cli update [options]| Option | Description |
|---|---|
| --check | Report current vs. latest version without installing |
| --tag | dist-tag to resolve. Defaults to beta for prerelease installs, latest for stable. |
minikit-cli update
minikit-cli update --check
minikit-cli update --tag latestRun minikit-cli migrate inside each project after updating, to apply project-level migrations.
docs
List or search documentation links.
minikit-cli docs [keyword]minikit-cli docsSearch is case-insensitive, matches document names and titles.
--help
Every command supports --help for inline usage info:
minikit-cli --help
minikit-cli create --help
minikit-cli jsbridge:add --help
minikit-cli i18n:add --help
minikit-cli litmus:add --help