Skip to content

beeman/solana-mobile

Repository files navigation

solana-mobile

CLI for Solana Mobile development.

Features

  • Command help — show available subcommands when no command is provided
  • Create projects — scaffold Solana Mobile apps from the template catalog
  • Doctor checks — local dependency checks with recommendations
  • Emulator helpers — create, delete, list, start, status, and stop local Android emulators

Usage

Run the CLI without installing it:

bun x solana-mobile --help
npx solana-mobile --help
pnpx solana-mobile --help

Examples below use npx; replace it with pnpx or bun x if you prefer pnpm or Bun.

Manage Android emulators

# Create or update an emulator by answering prompts
npx solana-mobile emulator create

# Create or update a named emulator
npx solana-mobile emulator create local_phone --device pixel_9

# Delete by choosing from installed emulators
npx solana-mobile emulator delete

# Delete emulators by name
npx solana-mobile emulator delete local_phone

# List installed Android system images
npx solana-mobile emulator images

# Install a compatible Google Play system image by choosing from available packages
npx solana-mobile emulator images install

# Install a specific Google Play system image
npx solana-mobile emulator images install system-images/android-36.1/google_apis_playstore/arm64-v8a

# List installed emulators
npx solana-mobile emulator list

# Start by choosing from installed emulators
npx solana-mobile emulator start

# Start an emulator by name
npx solana-mobile emulator start local_phone

# Show status for all installed and running emulators
npx solana-mobile emulator status

# Show status for one emulator by name or serial
npx solana-mobile emulator status local_phone

# Stop by choosing from running emulators
npx solana-mobile emulator stop

# Stop a running emulator by name or serial
npx solana-mobile emulator stop local_phone

# Use the short alias
npx solana-mobile emu list

Create a project

# Create a project interactively
npx solana-mobile create

# Create a project with the minimal template
npx solana-mobile create my-app --minimal

# Create a project with a package manager
npx solana-mobile create my-app --package-manager pnpm

# Create a project with a specific template
npx solana-mobile create my-app --template kit-expo-wallet

# List template ids as JSON
npx solana-mobile create --list-template-ids

# List templates
npx solana-mobile create --list-templates

Check your environment

npx solana-mobile doctor
npx solana-mobile doctor --json
npx solana-mobile doctor --verbose

Doctor checks the system, JavaScript tooling, Java/JDK, Android SDK components, emulators, and physical Android devices. It reports separate readiness for project creation, Android builds, emulator workflows, and physical-device workflows.

The command is diagnostic only and never installs or modifies dependencies. Missing required dependencies produce exit code 1; warnings do not.

Show command help

npx solana-mobile

Create options

  • --dry-run — Print the resolved creation arguments without writing files
  • --list-template-ids — List available template ids as a JSON array
  • --list-templates — List available templates
  • --list-versions — Verify local Anchor, AVM, Rust, and Solana versions
  • --minimal — Use the minimal Solana Mobile template
  • --package-manager <packageManager> — Use bun, npm, pnpm, or yarn
  • --skip-git — Skip git initialization
  • --skip-init — Skip the template init script
  • --skip-install — Skip dependency installation
  • --template <templateName> — Use a specific template
  • --verbose — Print verbose output

Development

Install dependencies and run checks:

bun install
bun run ruler:apply  # apply AI agent rules
bun run check-types
bun run lint
bun test

Test the local CLI

Run the source CLI while developing:

bun dev create --help
bun dev doctor
bun dev emulator list

Build and test the package artifact:

bun run build
node dist/cli.mjs create --help
node dist/cli.mjs doctor

Testing

Unit tests (bun test) run without any external dependencies.

License

MIT – see LICENSE.

About

CLI for Solana Mobile development.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors