Skip to main content

CLI Overview

The JetStart CLI provides a simple yet powerful interface for Android development. With just 6 commands, you can create projects, run development servers, build APKs, and manage your development environment.

Quick Command Reference

CommandDescriptionExample
createCreate a new JetStart projectjetstart create my-app --package com.example.app
devStart development server with hot reloadjetstart dev --port 8765
buildBuild production APKjetstart build --release --sign
logsStream application logsjetstart logs --follow --level info
install-auditCheck development dependenciesjetstart install-audit --json
android-emulatorManage Android Virtual Devicesjetstart android-emulator

Global Options

These options work with all commands:

--version, -v      # Show version number
--help, -h # Show help information
--no-color # Disable colored output
--verbose # Enable verbose logging

Common Workflows

Creating a New Project

# Basic project creation
jetstart create my-app --package com.example.app

# With automatic dependency installation
jetstart create my-app --package com.example.app --full-install

# Skip dependency checks
jetstart create my-app --package com.example.app --skip-install

Development Workflow

# Terminal 1: Start dev server
jetstart dev

# Terminal 2: Watch logs
jetstart logs --follow

# Make changes to your code...
# See them update in <100ms on your device!

Building for Production

# Debug build (unsigned)
jetstart build

# Release build (unsigned)
jetstart build --release

# Release build (signed)
jetstart build --release --sign

Managing Dependencies

# Check what's installed
jetstart install-audit

# Get JSON output for CI/CD
jetstart install-audit --json

# Create project with auto-install
jetstart create test-app --package com.test --full-install

Working with Emulators

# Interactive emulator management
jetstart android-emulator

# This opens a menu where you can:
# - List existing emulators
# - Start/stop emulators
# - Create new emulators
# - Delete emulators

Command Structure

All JetStart commands follow a consistent structure:

jetstart <command> [arguments] [options]

Example:

jetstart create my-app --package com.example.app --full-install
│ │ └─────────────┬──────────────────────┘
command │ options/flags
argument

Output Formatting

JetStart uses consistent, colorful output for better readability:

  • ✓ Green - Success messages
  • ⚠ Yellow - Warnings
  • ✗ Red - Errors
  • 🚀 Orange - Progress/status
  • ℹ Blue - Information

Example Output

$ jetstart create my-app --package com.example.app

🚀 Creating JetStart project...

✓ Project structure created
✓ Gradle configuration generated
✓ Android manifest created
✓ Dependencies configured

📦 Installing npm dependencies...

✓ Dependencies installed (12.5s)

✅ Project created successfully!

Next steps:
cd my-app
jetstart dev

Configuration

Project-Level Configuration

Create jetstart.config.json in your project root:

{
"name": "my-app",
"package": "com.example.app",
"minSdkVersion": 24,
"targetSdkVersion": 34,
"port": 8765,
"wsPort": 8766,
"logLevel": "info",
"autoOpenBrowser": true,
"enableQRCode": true
}

User-Level Configuration

Create ~/.jetstart/config.json for global defaults:

{
"defaultPort": 8765,
"defaultPackage": "com.mycompany",
"logLevel": "info",
"autoOpenBrowser": true,
"theme": "dark"
}

Environment Variables

Override settings with environment variables:

JETSTART_PORT=8765           # Development server port
JETSTART_LOG_LEVEL=debug # Log verbosity
JETSTART_NO_QR=true # Disable QR code display
DEBUG=1 # Enable debug mode

Error Handling

JetStart provides clear error messages with solutions:

$ jetstart dev

✗ Error: No jetstart.config.json found

This doesn't look like a JetStart project.

Solutions:
• Run this command from a JetStart project directory
• Create a new project: jetstart create my-app
• Check if jetstart.config.json exists in current directory

For more help: jetstart --help

Exit Codes

JetStart uses standard exit codes for scripting:

CodeMeaning
0Success
1General error
2Invalid arguments
126Command cannot execute
127Command not found

Use in scripts:

#!/bin/bash

if jetstart build --release; then
echo "Build successful!"
exit 0
else
echo "Build failed!"
exit 1
fi

Shell Completion

Enable tab completion for your shell:

Bash

# Add to ~/.bashrc
eval "$(jetstart completion bash)"

Zsh

# Add to ~/.zshrc
eval "$(jetstart completion zsh)"

Fish

# Add to ~/.config/fish/config.fish
jetstart completion fish | source

Scripting with JetStart

JetStart works great in automated workflows:

CI/CD Example

# .github/workflows/build.yml
name: Build APK

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install JetStart
run: npm install -g @jetstart/cli

- name: Check dependencies
run: jetstart install-audit --json

- name: Build APK
run: jetstart build --release

Automated Testing

#!/bin/bash
# test.sh

# Check environment
jetstart install-audit || exit 1

# Build app
jetstart build || exit 1

# Run tests
./gradlew test || exit 1

echo "All tests passed!"

Getting Help

Command-Specific Help

# General help
jetstart --help

# Command-specific help
jetstart create --help
jetstart dev --help
jetstart build --help

Verbose Mode

Get detailed output for debugging:

jetstart dev --verbose

Debug Mode

Enable full debug logging:

DEBUG=1 jetstart dev

Next Steps

Explore individual commands:

Additional Resources