CLI Usage & API Reference

This section contains usage and APIs provided by the CLI

Login

Before accessing any features, you must log in to the CLI while ensuring you are in a React Native project directory.

npx stallion login

Executing this command will launch a web browser where you need to log in. Once logged in, click Copy Access Token, then return to the terminal and paste the token.

Publish Bundle

Prerequisite:

Every published bundle is stored in a Bucket. Before publishing your first bundle, make sure a Bucket is created in the Stallion Console

After successfully logging in, you can use the publish-bundle command to deploy packages for both Android and iOS.

npx stallion publish-bundle --upload-path=<orgname>/<project-name>/<bucket-name> --platform=<android/ios> --release-note="<notes>"

Tip:

You can access <orgname>/<project-name>/<bucket-name> required in command above using the Copy bundle path shortcut in Stallion Console inside your bucket's lising page.

Params

  1. --upload-path

Specifies the target location for uploading the current bundle:

--upload-path=testorg/firstproject/featurebucket
# testorg is org name
# firstproj is project name
# featurebucket is bucket name

You can find and copy the upload path from the Bucket Overview page in the Stallion Dashboard Console.

  1. --platform

Defines the platform for which the bundle will be published (android or ios):

--platform=android
  1. --release-note (Optional)

Allows you to add release notes for the bundle:

--release-note="changed something"
  1. --hermes-disabled (Optional) This flag is set to false by default, but you can enable it if needed.

Info:

Hermes is enabled by default in Stallion CLI. If you want to disable hermes then set this flag to true.

--hermes-enabled=true
  1. --ci-token (Optional)

Used for overriding the user token, especially recommended for CI pipelines:

--ci-token="your-CI-token"

You can generate CI Token from the dashboard under project settings.

  1. --bundle-name (Optional)

Default bundle name for android index.android.bundle and for ios main.jsbundle. You can override these defaults:

--bundle-name="ios.bundle"
  1. --entry-file (Optional)

The default entry file is index.js, but you can specify a different file:

--entry-file="index.debug.js"

Logout

To switch accounts, you can log out of the CLI at any time.

npx stallion logout