Complete reference for the Flash command-line interface. The Flash CLI provides tools for creating, developing, building, and deploying distributed inference applications.
- Getting Started Guide - Your first Flash project in 5 minutes
- Command Reference - Exhaustive documentation for all commands
- Workflows - Common development workflows
- Troubleshooting - Solutions to common problems
flash --help # Show all available commands
flash --version # Show Flash version
flash <command> --help # Show help for specific command| Command | Purpose |
|---|---|
flash login |
Authenticate with Runpod |
flash init |
Create new Flash project |
flash run |
Run development server |
flash build |
Build application package |
flash deploy |
Build and deploy application |
flash undeploy |
Delete deployed endpoints |
| Command | Purpose |
|---|---|
flash env |
Manage deployment environments |
flash app |
Manage Flash applications |
New to Flash? Follow this progression:
-
Start Here: Getting Started Guide
- Create your first project
- Run locally and test
- Deploy to Runpod
-
Deep Dive: Command Reference
- Understand all options and parameters
- Learn advanced features
- Master build configuration
-
Real Workflows: Workflows Guide
- Local development workflow
- Multi-environment management
- Testing strategies
-
When Issues Arise: Troubleshooting
- Common error solutions
- Build size optimization
- Deployment debugging
Authenticate with Runpod. Opens a browser for authentication and saves credentials locally.
flash login- Opens your default browser to Runpod's authentication page
- After you authenticate, saves credentials securely
- Environment variables persist across sessions
Authenticate with Runpod:
flash login
# Opens browser for authenticationIf flash login doesn't work in your environment, you can set the API key manually:
# Set environment variable
export RUNPOD_API_KEY=your-key-here
# Or add to .env file
echo "RUNPOD_API_KEY=your-key-here" > .envGet your API key from Runpod Settings.
flash run- Run development server (requires authentication)flash deploy- Deploy to Runpod (requires authentication)
Create a new Flash project with the correct structure and boilerplate code.
flash init [PROJECT_NAME] [OPTIONS]PROJECT_NAME- Name for the project directory, or.for current directory
| Option | Description |
|---|---|
--force, -f |
Overwrite existing files without prompting |
Create new project in subdirectory:
flash init my-api
cd my-apiInitialize in current directory:
mkdir my-api && cd my-api
flash init .Overwrite existing files:
flash init my-api --forcegpu_worker.py- GPU worker template with@Endpointdecoratorpyproject.toml- Project dependencies.env.example- Environment variable template.gitignore- Git ignore patterns.flashignore- Build ignore patternsREADME.md- Project documentation
flash run- Run the initialized project locally- Getting Started Guide - Full tutorial
Run the Flash development server locally with hot reloading.
flash run [OPTIONS]| Option | Default | Description |
|---|---|---|
--host |
localhost |
Host to bind to (env: FLASH_HOST) |
--port, -p |
8888 |
Port to bind to (env: FLASH_PORT) |
--reload |
enabled | Auto-reload on file changes (use --no-reload to disable) |
--auto-provision |
disabled | Auto-provision deployable resources on startup |
FLASH_HOST- Default host (overrides default, overridden by--host)FLASH_PORT- Default port (overrides default, overridden by--port)
Basic local development:
flash run
# Server runs at http://localhost:8888
# Visit http://localhost:8888/docs for Swagger UICustom host and port:
flash run --host 0.0.0.0 --port 3000
# Accessible from network at http://<your-ip>:3000Disable auto-reload:
flash run --no-reload
# Useful for debugging or production-like testingAuto-provision resources:
flash run --auto-provision
# Automatically creates Runpod endpoints on startupUsing environment variables:
export FLASH_HOST=0.0.0.0
export FLASH_PORT=9000
flash run- Discovers all
.pyfiles (excluding.venv/,.flash/,.runpod/,__init__.py) and finds@Endpointdecorated functions via AST parsing - Generates a FastAPI application with routes for each discovered function
- Starts uvicorn development server with hot reload
- Provides interactive API documentation at
/docs - Optionally provisions remote resources if
--auto-provisionis enabled
After starting the server, test your endpoints:
Swagger UI (recommended):
Visit http://localhost:8888/docs for interactive API testing
curl:
curl -X POST http://localhost:8888/your-endpoint \
-H "Content-Type: application/json" \
-d '{"input": "test"}'flash init- Create a project to runflash build- Build for deployment- Local Development Workflow
Build the Flash application into a deployable package without deploying.
flash build [OPTIONS]| Option | Description |
|---|---|
--no-deps |
Skip transitive dependencies (only install direct dependencies) |
--output, -o |
Custom archive name (default: artifact.tar.gz) |
--exclude |
Comma-separated packages to exclude (e.g., torch,torchvision) |
--use-local-flash |
Bundle local runpod_flash source instead of PyPI version |
Standard build:
flash build
# Creates artifact.tar.gzCustom archive name:
flash build -o my-app-v1.0.tar.gzExclude packages present in base image:
flash build --exclude torch,torchvision,torchaudio
# Reduces archive size by excluding packages already in Runpod base imagesSkip transitive dependencies:
flash build --no-deps
# Only installs packages listed in pyproject.toml, not their dependenciesDevelopment build with local Flash:
flash build --use-local-flash
# Uses your local runpod_flash source for testing changes- Creates
.build/directory (kept for inspection) - Installs dependencies via pip for Linux x86_64
- Generates
flash_manifest.jsonwith resource configurations - Creates handler files for each
@Endpointfunction - Packages everything into
artifact.tar.gz - Reports archive size (max 500MB for deployment)
If your build exceeds 500MB:
- Identify large packages:
du -sh .build/lib/* | sort -h | tail -10- Exclude packages in base image:
flash build --exclude torch,torchvision,torchaudio,transformers- Check base image packages: See Troubleshooting: Archive Size Limit
The .build/ directory is preserved for inspection. Check:
.build/lib/- Installed dependencies.build/flash_manifest.json- Resource configurations.build/handler_*.py- Generated handlers
flash deploy- Build and deploy in one step- Build and Deploy Workflow
- Troubleshooting: Build Failures
Build and deploy the Flash application to Runpod in a single command.
flash deploy [OPTIONS]| Option | Description |
|---|---|
--env, -e |
Target environment name |
--app, -a |
Flash app name |
--preview |
Build and launch local preview instead of deploying |
| Build Options | (same as flash build) |
--no-deps |
Skip transitive dependencies |
--exclude |
Comma-separated packages to exclude |
--use-local-flash |
Bundle local runpod_flash source |
--output, -o |
Custom archive name |
RUNPOD_API_KEY- Required for deployment (get from https://runpod.io/console/user/settings)
Auto-select environment:
flash deploy
# Deploys to the only environment, or prompts if multiple existDeploy to specific environment:
flash deploy --env productionDeploy different app:
flash deploy --app my-app --env stagingDeploy with size optimization:
flash deploy --env prod --exclude torch,torchvisionLocal preview without deploying:
flash deploy --preview
# Builds and runs in Docker locally for testing- Runs
flash buildwith specified options - Validates
RUNPOD_API_KEYenvironment variable - Selects target environment (auto or via
--env) - Uploads artifact to Runpod
- Creates/updates serverless endpoints for each resource
- Displays endpoint URLs and access information
- Provides next steps for testing
- One environment: Used automatically
- Multiple environments: Prompts for selection (or use
--env) - No environments: Error (create with
flash env create)
After successful deployment:
# Test endpoints
curl -X POST https://<endpoint-id>.runpod.io/run \
-H "Authorization: Bearer $RUNPOD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": {"your": "data"}}'
# View deployment status
flash env get production
# Update deployment
flash deploy --env production # Redeploy with changesflash build- Build without deployingflash env- Manage environmentsflash undeploy- Delete endpoints- Build and Deploy Workflow
Delete deployed Runpod serverless endpoints.
flash undeploy [NAME] [OPTIONS]NAME- Endpoint name to undeploy, orlistto show all endpoints
| Option | Description |
|---|---|
--all |
Undeploy all endpoints (with confirmation) |
--interactive, -i |
Interactive selection with checkboxes |
--cleanup-stale |
Remove endpoints already deleted externally |
--force, -f |
Skip confirmation prompts |
List all endpoints:
flash undeploy list
# Shows all deployed endpoints with statusUndeploy specific endpoint:
flash undeploy my-api
# Prompts for confirmation before deletionUndeploy all endpoints:
flash undeploy --all
# Prompts for confirmation, then deletes allForce undeploy without confirmation:
flash undeploy my-api --force
# Deletes immediately, no promptsInteractive selection:
flash undeploy --interactive
# Shows checkbox UI to select endpoints to deleteCleanup stale tracking:
flash undeploy --cleanup-stale
# Removes endpoints from local tracking that were deleted externally- Lists tracked endpoints (from
.runpod/directory) - Verifies endpoints exist on Runpod
- Prompts for confirmation (unless
--force) - Deletes endpoints via Runpod API
- Removes local tracking files
Development cleanup:
flash undeploy --all --force
# Quick cleanup of all test deploymentsSelective cleanup:
flash undeploy --interactive
# Choose which endpoints to keep/deleteFix tracking inconsistencies:
flash undeploy --cleanup-stale
# If endpoints deleted manually via Runpod consoleflash deploy- Deploy endpointsflash env- View environment status- Cleanup Workflow
Manage deployment environments. Environments represent different deployment targets (e.g., staging, production).
flash env list- Show all environmentsflash env create- Create new environmentflash env get- Show environment detailsflash env delete- Delete environment
Show all available deployment environments.
flash env list [OPTIONS]| Option | Description |
|---|---|
--app, -a |
Filter by Flash app name |
List all environments:
flash env list
# Shows all environments across all appsList environments for specific app:
flash env list --app my-appCreate a new deployment environment.
flash env create NAME [OPTIONS]NAME- Environment name (e.g.,staging,production)
| Option | Description |
|---|---|
--app, -a |
Flash app name to create environment in |
Create environment:
flash env create stagingCreate environment in specific app:
flash env create production --app my-app- Environment entry in Flash configuration
- Deployment target for
flash deploy --env <name> - Isolated namespace for endpoints
Show detailed information about a deployment environment.
flash env get ENV_NAME [OPTIONS]ENV_NAME- Name of environment to inspect
| Option | Description |
|---|---|
--app, -a |
Flash app name |
Get environment details:
flash env get production
# Shows deployed endpoints, resource configs, statusGet environment in specific app:
flash env get staging --app my-appDelete a deployment environment and all its endpoints.
flash env delete ENV_NAME [OPTIONS]ENV_NAME- Name of environment to delete
| Option | Description |
|---|---|
--app, -a |
Flash app name |
Delete environment:
flash env delete staging
# Prompts for confirmation, deletes all endpoints in environmentDelete environment in specific app:
flash env delete production --app my-appThis deletes all endpoints in the environment. Ensure you have backups or can redeploy.
flash deploy- Deploy to environmentflash undeploy- Delete individual endpoints- Multi-Environment Workflow
Manage Flash applications. Apps provide namespace isolation for environments and endpoints.
flash app list- Show all appsflash app create- Create new appflash app get- Show app detailsflash app delete- Delete app
List all Flash applications under your account.
flash app listflash app list
# Shows all apps with environment countsCreate a new Flash application.
flash app create APP_NAMEAPP_NAME- Name for the new Flash app
Create app:
flash app create my-new-app- App namespace for environments and endpoints
- Configuration entry for app-scoped operations
Get detailed information about a Flash app.
flash app get APP_NAMEAPP_NAME- Name of app to inspect
flash app get my-app
# Shows environments, endpoints, resource usageDelete a Flash app and all associated resources.
flash app delete [OPTIONS]| Option | Required | Description |
|---|---|---|
--app, -a |
Yes | Flash app name to delete |
Delete app:
flash app delete --app my-app
# Prompts for confirmation, deletes all environments and endpointsThis deletes the entire app including all environments and endpoints. This operation cannot be undone.
flash env- Manage environments within appsflash deploy- Deploy to app environments
Flash CLI respects these environment variables:
| Variable | Purpose | Used By |
|---|---|---|
RUNPOD_API_KEY |
Runpod API authentication | deploy, undeploy, env, app |
FLASH_HOST |
Default development server host | run |
FLASH_PORT |
Default development server port | run |
Bash/Zsh:
export RUNPOD_API_KEY=your-key-here
export FLASH_PORT=9000.env file:
# .env (loaded into os.environ for CLI and local development)
RUNPOD_API_KEY=your-key-here
FLASH_HOST=0.0.0.0
FLASH_PORT=8888Note:
.envvalues populateos.environlocally. They are not carried to deployed endpoints. To pass env vars at deploy time, declare them on the resource:env={"KEY": os.environ["KEY"]}.
Flash uses these configuration files:
| File | Purpose | Location |
|---|---|---|
.env |
Environment variables | Project root |
.runpod/ |
Deployment tracking | Project root |
flash_manifest.json |
Build artifact metadata | .build/ (auto-generated) |
.flashignore |
Files to exclude from build | Project root |
See the Workflows Guide for detailed step-by-step instructions:
- Local Development - Create, run, test, iterate
- Build and Deploy - Package and deploy to Runpod
- Multi-Environment - Manage staging and production
- Testing - Validate before production
- Cleanup - Remove unused resources
- Troubleshooting - Debug deployment issues
- Command-specific help:
flash <command> --help - Getting Started: docs/cli/getting-started.md
- Troubleshooting: docs/cli/troubleshooting.md
- Flash Documentation: https://docs.runpod.io
- Report Issues: https://github.com/runpod/flash/issues
- New to Flash? Start with the Getting Started Guide
- Ready to deploy? Follow the Build and Deploy Workflow
- Need help? Check the Troubleshooting Guide