docs/pages/documentation/guides/basic-commands.mdx
import { Cards, Card } from "nextra/components"; import { DeviceFloppyIcon, DownloadIcon, TrashIcon, TerminalIcon, GlobeIcon, ListIcon, EyeIcon, ArrowRightOnRectangleIcon, PlayIcon, } from "@radix-ui/react-icons";
Complete reference for FVM commands to manage Flutter SDK versions efficiently.
Sets a Flutter SDK version for the current project. Creates project configuration and ensures environment consistency.
fvm use [version] [options]
version - Flutter SDK version, channel, or commit hash (optional)
3.19.0, stable, fa345b1-f, --force - Bypasses Flutter project validation checks-p, --pin - Pins the latest release of a channel (not for master)--flavor <name>, --env <name> - Sets version for a specific project flavor-s, --skip-setup - Skips SDK setup after installation--skip-pub-get - Skips dependency resolution after switching# Set specific version
fvm use 3.19.0
# Pin latest stable release
fvm use stable --pin
# Set version for production flavor
fvm use 3.19.0 --flavor production
# Use a specific commit
fvm use fa345b1
.fvm directory with SDK symlink.fvmrc configurationflutter pub get (unless skipped)Downloads and caches a Flutter SDK version for future use. Runs setup by default to ensure SDK is ready to use.
fvm install [version] [options]
version - Flutter SDK version to install (optional)
-s, --setup - Downloads SDK dependencies after install (default: true)--no-setup - Skip downloading SDK dependencies for faster caching--skip-pub-get - Skips dependency resolutionfvm i - Short form# Install with setup (default behavior)
fvm install 3.19.0
# Skip setup for faster caching
fvm install 3.19.0 --no-setup
# Install from project config
fvm install
Displays all installed Flutter SDK versions.
fvm list
fvm ls - Short formShows all cached SDK versions with their installation paths.
Shows available Flutter SDK releases for installation.
fvm releases [options]
-c, --channel <name> - Filter by channel: stable, beta, dev, all (default: stable)# Show stable releases
fvm releases
# Show beta channel releases
fvm releases --channel beta
# Show all releases
fvm releases --channel all
Removes Flutter SDK versions from cache.
fvm remove [version] [options]
version - SDK version to remove (prompts if omitted)-a, --all - Removes all cached versions# Remove specific version
fvm remove 3.19.0
# Remove all versions
fvm remove --all
Sets a default Flutter SDK version for the system.
fvm global [version]
version - SDK version to set as global-f, --force - Bypasses SDK validation-u, --unlink - Removes global version setting# Set global version
fvm global 3.19.0
# Remove global version
fvm global --unlink
Runs Flutter commands with a specific SDK version.
fvm spawn <version> <flutter_command> [args...]
version - SDK version to use (required)flutter_command - Flutter command to executeargs - Additional command arguments# Build with specific version
fvm spawn 3.19.0 build apk
# Run tests with different version
fvm spawn 3.16.0 test
Executes commands using the project's configured Flutter SDK.
fvm exec <command> [args...]
command - Command to executeargs - Command arguments# Run melos with project SDK
fvm exec melos bootstrap
# Execute custom script
fvm exec ./scripts/build.sh
Runs Flutter commands using the project's configured SDK.
fvm flutter <command> [args...]
command - Flutter command to runargs - Command arguments# Common Flutter commands
fvm flutter doctor
fvm flutter build apk
fvm flutter test
fvm flutter run
Prevents flutter upgrade on release versions. Use channels for upgrades.
Runs Dart commands using the project's configured SDK.
fvm dart <command> [args...]
command - Dart command to runargs - Command arguments# Common Dart commands
fvm dart pub get
fvm dart analyze
fvm dart format .
fvm dart run build_runner build
Removes the entire FVM cache and all installed versions.
fvm destroy [options]
-f, --force - Bypasses confirmation prompt (use with caution)# Remove cache with confirmation prompt
fvm destroy
# Remove cache without confirmation (dangerous)
fvm destroy --force
This action is irreversible and removes all cached Flutter SDKs.
Executes Flutter commands using a flavor-specific SDK version.
fvm flavor <flavor> <flutter_command> [args...]
flavor - Project flavor nameflutter_command - Flutter command to executeargs - Command arguments# Build with development flavor
fvm flavor development build apk
# Test with staging flavor
fvm flavor staging test
Manages Flutter fork aliases for custom repositories.
Adds a fork alias for a custom Flutter repository.
fvm fork add <alias> <url>
Arguments:
alias - Short name for the forkurl - Git repository URL (must end with .git)Example:
fvm fork add mycompany https://github.com/mycompany/flutter.git
Removes a fork alias.
fvm fork remove <alias>
Example:
fvm fork remove mycompany
Shows all configured fork aliases.
fvm fork list
After adding a fork, use it with any version:
# Install fork version
fvm install mycompany/stable
fvm install mycompany/3.19.0
# Use fork version
fvm use mycompany/stable
Manages global FVM settings.
fvm config [options]
--cache-path <path> - Sets custom cache directory--flutter-url <url> - Sets Flutter repository URL--use-git-cache - Enables Git cache for faster installs (default: true)--no-use-git-cache - Disables Git cache--git-cache-path <path> - Sets Git cache directory--update-check - Enables FVM update notifications (default: true)--no-update-check - Disables update notifications# View current configuration
fvm config
# Set custom cache location
fvm config --cache-path ~/custom/flutter/cache
# Disable update checks
fvm config --no-update-check
# Use custom Flutter repository
fvm config --flutter-url https://github.com/mycompany/flutter.git
Shows detailed FVM environment information and diagnostics.
fvm doctor
Useful for troubleshooting configuration issues.
Provides JSON output for integration with other tools.
-c, --compress - Outputs compact JSONReturns cached Flutter versions as JSON.
fvm api list [options]
Options:
-s, --skip-size-calculation - Skips cache size calculationReturns available Flutter releases as JSON.
fvm api releases [options]
Options:
--limit <number> - Limits results--filter-channel <channel> - Filters by channel (stable, beta, dev)Returns FVM environment information as JSON.
fvm api context
Returns project configuration as JSON.
fvm api project [options]
Options:
-p, --path <path> - Project directory path# Get cached versions
fvm api list
# Get stable releases (limit 10)
fvm api releases --filter-channel stable --limit 10
# Get project info for specific path
fvm api project --path /projects/myapp
# Get compact JSON output
fvm api context --compress
When using proxy commands (flutter, dart, exec), FVM searches for the SDK in this order:
This ensures the correct SDK version is always used.