# CLI — Bundle Drop Docs

> Bundle Drop CLI reference — log in, initialize your project, and upload OTA bundles to your channels.

Canonical: https://bundledrop.app/docs/cli

## CLI Overview

The Bundle Drop CLI ships with `@gfean/react-native-bundle-drop`. Once the package is installed, run it through `npx bundle-drop` without a separate global installation.

## Bundle Drop Sight

Use [Bundle Drop Sight for React Native bundle analysis](/docs/react-native-bundle-analysis) to inspect JavaScript packages and files, compare Git branches, review emitted assets, and measure Bundle Drop OTA archive size locally.

**Terminal**

```bash
npx bundle-drop sight --platform ios
npx bundle-drop sight --compare origin/main --fetch --platform ios
```

The [Sight CLI guide](/docs/react-native-bundle-analysis) covers setup, comparison options, assets, OTA size, and troubleshooting. For existing React Native or Expo tooling, follow [analysis without the CLI](/docs/react-native-bundle-analysis-without-cli). JavaScript analysis needs no Bundle Drop account; OTA archive measurement requires the analyzed revision's Bundle Drop configuration and app/runtime identity.

## Authentication Commands

**Terminal**

```bash
npx bundle-drop login
npx bundle-drop whoami
npx bundle-drop logout
```

- `login` authenticates the local machine and completes first-time project setup.
- `whoami` shows the active CLI account.
- `logout` removes the local CLI session.

## Project Setup

The normal first-time flow is:

**Terminal**

```bash
npx bundle-drop login
npx bundle-drop doctor
```

`login` creates `bundle.drop.config.js`, detects Expo or bare React Native, previews the complete setup plan, and applies it after confirmation.

If you prefer to integrate without AI-assisted setup, create or copy the project's `bundle.drop.config.js` first, then follow [Manual Setup](/docs/manual-setup). With an existing project config, `login` authenticates and synchronizes the project without running guided setup.

Use `init` to rerun setup or control project detection explicitly:

**Terminal**

```bash
npx bundle-drop init
npx bundle-drop init --project-type expo
npx bundle-drop init --project-type bare
npx bundle-drop init --dry-run
```

Useful setup options include:

- `--token <pat>` authenticates with a Personal Access Token instead of browser login. Other setup prompts can still require interaction.
- `--project-type <expo|bare>` resolves an ambiguous project explicitly.
- `--dry-run` previews setup without applying changes.
- `--prebuild` enables the Expo layered prebuild flow.
- `--migrate-expo-updates` explicitly migrates an Expo project away from `expo-updates` ownership.
- `--yes` accepts supported non-interactive prompts.

Token authentication does not answer setup prompts. `--yes` accepts supported prompts, including sharing the disclosed setup context with the AI service, but cannot approve review-only native or dynamic configuration changes. Run setup interactively when those changes need review.

Setup owns the required Metro, Expo plugin, and native integration changes. Removed legacy commands such as separate Metro or native initialization are not part of the current CLI.

## Runtime Delivery Sync

`login` and `init` synchronize the package-managed runtime-delivery trust bootstrap automatically. Refresh or repair it explicitly with:

**Terminal**

```bash
npx bundle-drop sync
npx bundle-drop sync --dry-run
```

`sync` validates the authenticated project identity and trust configuration, writes or refreshes `.bundle-drop/runtime-delivery.lock.json`, and repairs the matching `.gitignore` rules. It also recreates the file if `.bundle-drop` was accidentally deleted. Projects with the former `runtime-delivery.generated.json` filename remain readable; a successful `sync` validates the new lockfile before removing the legacy file. The lockfile contains public trust material rather than a private secret, so commit it with the app. If it changes, create a new native binary before relying on the new identity or keys. The dry-run form validates and previews the synchronization without changing files.

See [Installation](/docs/installation#pin-the-runtime-delivery-bootstrap) for the commit and backup rules.

## Diagnostics

**Terminal**

```bash
npx bundle-drop doctor
npx bundle-drop doctor --platform ios
npx bundle-drop doctor --project-type expo
```

Doctor checks the current project configuration, Metro integration, native integration, runtime authority, and applicable platform identity.

## Expo Build Receipts

Projects that opt into strict Expo fingerprint authority can import a receipt from EAS Build:

**Terminal**

```bash
npx bundle-drop eas-receipt ios --build-id <eas-build-id>
```

The default literal runtime mode does not require Expo build receipts. See [Expo](/docs/expo#strict-expo-fingerprint-authority).

## Native Fingerprint Inspection

For projects using [Native Fingerprinting](/docs/native-fingerprinting), inspect the current identity without uploading or building the app:

**Terminal**

```bash
npx bundle-drop fingerprint --platform ios
npx bundle-drop fingerprint --platform android
```

Use `--output <path>` to save an optional report, `--compare <path>` to compare source digests with a saved report, and `--json` for machine-readable output. Without `--output`, the command prints the identity without accumulating report files. Normal builds and uploads calculate the identity independently; an inspection report does not override them.

## Upload Commands

Upload syntax differs slightly between Expo and bare React Native. Expo resolves version identity from its project configuration, while bare projects can provide native version files or an explicit version.

See [Uploading](/docs/uploading) for the full command reference.

## Version Flag

**Terminal**

```bash
npx bundle-drop --cli-version
```

## Related Docs

- [Installation](/docs/installation)
- [Manual Setup](/docs/manual-setup)
- [Expo](/docs/expo)
- [Native Fingerprinting](/docs/native-fingerprinting)
- [Uploading](/docs/uploading)
- [CI/CD](/docs/ci-cd)
