@botim/botim-cli
v1.1.1
Published
A CLI tool that scaffolds React applications and manages BOTIM Mini-Program apps and plugins
Downloads
1,372
Keywords
Readme
BOTIM CLI
Internal README — this file is deliberately excluded from the npm package. npm force-includes root
README*files in every tarball, soprepack/postpack(scripts/readme-pack-guard.mjs) temporarily hide it while packing. Don't remove those hooks: this file references internal hosts that must never be published.
@botim/botim-cli is a command-line tool for building and operating BOTIM Mini-Programs and Plugins. It scaffolds React-based Mini-Program projects from templates, registers them on the BOTIM platform, deploys versions across environments, and manages the surrounding platform plumbing — authentication, teams, preview testers, client credentials, and LLM Gateway keys.
What it does
- Scaffold — create a new Mini-Program app (
create-mp-app) or Plugin (create-plugin) from the official React template, interactively or fully non-interactive for CI/AI agents. - Authenticate — QR-code login against the BOTIM platform (
login), with per-environment tokens (status,logout) and team switching without re-scanning (switch-partner). - Deploy — build, zip, and ship new versions of apps (
deploy-mp-app) and plugins (deploy-plugin), with Preview/Production release strategies and automatic version bumping. - Operate — link plugins into an MP (
link-plugins), manage preview testers (add-preview-user), fetch client credentials (client-credentials), list permissions (list-mp-permissions), debug on-device (debug-mp-app), analyze bundles (analyze-build). - LLM Gateway — list models and manage virtual API keys (
llm models|keys|create-key|…) through the botim-gateway server. - AI-native —
botim-cli ai [command] [--json]exposes a machine-readable manifest of every command, its prerequisites, flags, and examples, so coding agents can drive the CLI safely.
Installation
The package is published to the internal Artifactory registry under the @botim scope.
1. One-time registry setup
./setup-npm-config.shor add the scope manually to ~/.npmrc:
@botim:registry=https://artifactory.corp.astratech.ae/artifactory/api/npm/npm-local/
registry=https://registry.npmjs.org/2. Install globally
npm install -g @botim/botim-cli
botim-cli --versionUpdate later with botim-cli update (or npm install -g @botim/botim-cli@latest).
From source (development)
git clone <this repo> && cd botim-cli
npm install
npm run build
npm link # may need sudo; makes `botim-cli` available globallySee INSTALLATION.md for troubleshooting and uninstall steps.
Quick start
botim-cli login # QR login (scan with the BOTIM app)
botim-cli create my-mini-app # interactive project creation
cd my-mini-app
botim-cli deploy # build, upload & release a versionRun botim-cli quick-start or botim-cli examples for guided walkthroughs, and botim-cli <command> --help for full options.
Environments
Every command targets one of three environments: prod (default), uat, or beta.
- Override per invocation with the global flag:
botim-cli --env uat deploy - Tokens are stored per environment;
botim-cli statusshows login state for all three. - Project config files are environment-specific:
botim_config.prod.json,botim_config.uat.json,botim_config.beta.json(apps) andbotim_plugin_config.<env>.json(plugins).
Command overview
| Area | Commands |
|---|---|
| Auth & teams | login, logout, status, switch-partner |
| Create | create, create-mp-app, create-plugin, create-react-app, register-mp-app, init-mp-app, init-plugin |
| Deploy & operate | deploy-mp-app, deploy-plugin, link-plugins, debug-mp-app, analyze-build |
| Platform | add-preview-user, client-credentials, list-mp-permissions, list-mp-options |
| LLM Gateway | llm models, llm keys, llm create-key, llm disable-key, llm enable-key, llm delete-key, llm select-team |
| Tooling | ai, config, gateway, logs, update, clear-template-cache |
The generated reference at .claude/skills/botim-cli-reference.md documents every command in detail (regenerate with npm run docs:ai — never hand-edit it).
Development
npm run build # clean tsup build + ncc bundle → dist/cli.mjs (the shipped entry)
npm run type-check # tsc --noEmit
npm run docs:ai # regenerate the AI command referenceThe shipped binary is bin/cli → dist/cli.mjs (the ncc bundle). The raw tsup output dist/cli.js is not runnable standalone — don't smoke-test that path.
Publishing is guarded: prepublishOnly runs the type check, a clean build, and scripts/check-package-secrets.mjs, which fails the release if anything in the package payload (dist/, bin/, LICENSE) matches secret or internal-host patterns. This README is kept out of the tarball by scripts/readme-pack-guard.mjs (wired into prepack/postpack); verify any packaging change with npm pack --dry-run.
More docs: DEVELOPER-GUIDE.md · USAGE.md · INTERACTIVE-FLOW.md · CHANGELOG.md
License
ISC © Manoj Choudhary
