Stallion CLI
raw JSON → 2.4.3 verified Sat Apr 25 auth: no javascript
Stallion CLI is a unified command-line tool for deploying React Native bundles to Stallion servers. Current stable version is 2.4.3. Released actively on npm. It uses Commander.js for CLI parsing and provides commands for authentication, bundle upload, and configuration management. Key differentiator: purpose-built for Stallion deployment workflow, integrates with Stallion's console and API.
Common errors
error Error: Cannot find module 'stallion-cli' ↓
cause Package not installed or global install not in PATH.
fix
Run 'npm install -g stallion-cli' or install locally with 'npm install stallion-cli' and use npx.
error SyntaxError: Unexpected token 'export' ↓
cause Using require() in CommonJS on an ESM-only package.
fix
Use dynamic import or switch project to ESM: 'type': 'module' in package.json.
error Error: Failed to authenticate. Invalid API key. ↓
cause Missing or incorrect STALLION_API_KEY environment variable.
fix
Set STALLION_API_KEY to your valid Stallion API key. Obtain at https://console.stalliontech.io/settings/api-keys
Warnings
breaking Since v2.0, ESM-only: CommonJS require() no longer works. ↓
fix Use import() or switch to ESM. For CommonJS projects, use dynamic import: const stallion = await import('stallion-cli');
deprecated The 'stallion init' command is deprecated in v2.4.0. ↓
fix Use 'stallion config set' instead.
gotcha Node.js v14 required, v16 recommended. v12 and below not supported. ↓
fix Upgrade Node.js to v14 or higher.
breaking API endpoint changed from /v1 to /v2 in v2.3.0. Old SDK versions will fail. ↓
fix Update stallion-cli to >=2.3.0. If you rely on the URL, update to 'https://api.stalliontech.io/v2'.
Install
npm install stallion-cli yarn add stallion-cli pnpm add stallion-cli Imports
- stallion wrong
const stallion = require('stallion-cli');correctimport stallion from 'stallion-cli' - CLI wrong
import CLI from 'stallion-cli'correctimport { CLI } from 'stallion-cli' - run wrong
const { run } = require('stallion-cli');correctimport { run } from 'stallion-cli'
Quickstart
import stallion from 'stallion-cli';
async function deploy() {
const apiKey = process.env.STALLION_API_KEY ?? '';
await stallion.login({ apiKey });
await stallion.uploadBundle({
platform: 'ios',
bundlePath: './build/main.jsbundle',
appVersion: '1.0.0',
channel: 'production'
});
}
deploy().catch(console.error);