Skip to main content
Version: Next

Flow CLI


Installation

macOS

Homebrew


_10
brew install flow-cli

From a pre-built binary

This installation method only works on x86-64.

This script downloads and installs the appropriate binary for your system:


_10
sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"

To update, simply re-run the installation command above.

It is currently not possible to install earlier versions of the Flow CLI with Homebrew.

Linux

From a pre-built binary

This installation method only works on x86-64.

This script downloads and installs the appropriate binary for your system:


_10
sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"

To update, simply re-run the installation command above.

Install a specific version

To install a specific version of Flow CLI newer than v0.42.0, append the version tag to the command (e.g. the command below installs CLI version v0.44.0).


_10
sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" -- v0.44.0

To install a version older than v0.42.0, refer to Installing versions before 0.42.0 below.

Windows

From a pre-built binary

This installation method only works on Windows 10, 8.1, or 7 (SP1, with PowerShell 3.0), on x86-64.

  1. Open PowerShell (Instructions)

  2. In PowerShell, run:


    _10
    iex "& { $(irm 'https://raw.githubusercontent.com/onflow/flow-cli/master/install.ps1') }"

To update, simply re-run the installation command above.

Create your first project

With the Flow CLI super commands, initiating your new project becomes effortless. Execute the flow setup command and make a selection from a variety of accessible scaffolds:


_19
> flow setup hello-world --scaffold
_19
_19
🔨 General Scaffolds
_19
[1] Empty Cadence Project - Empty project containing only basic folder structure and flow.json configuration.
_19
[2] Simple Cadence Project - Scaffold contains required folder structure as well as some example Cadence code.
_19
[3] Cadence NFT Project - Scaffold contains the ExampleNFT sample NFT contract.
_19
[4] Hybrid Custody Project - Starter for exploring & implementing Hybrid Custody.
_19
_19
💻 Web Scaffolds
_19
[5] FCL Web Dapp - Simple TypeScript web application using next.js, FCL, and Cadence.
_19
_19
📱 Mobile Scaffolds
_19
[6] Swift iOS simple example - iOS example demonstrating usage of FCL and Flow interactions.
_19
[7] Android simple example - Android example demonstrating usage of FCL and Flow interactions.
_19
[8] FCL React Native Mobile Dapp - React Native (Expo) mobile dapp example demonstrating FCL and Flow interactions.
_19
_19
🏀 Unity Scaffolds
_19
[9] Simple Unity - Simple example demonstrating how to interact with the Flow network using Unity SDK.
_19
[10] Mobile Unity Game - Example words game built on Flow using the Unity SDK.

After you have created your new project you can proceed writing contracts and by running dev command the CLI will make sure they are deployed to the Flow emulator for you. Flow emulator is a simplified version of Flow network you can use locally to develop.

So proceed by starting the emulator:

Once you've established your new project, you can begin writing your own Cadence contracts. By utilizing the flow dev command, the CLI will take care of deploying them to the Flow emulator on your behalf. The Flow emulator serves as a simple version of the Flow network, enabling you to carry out local development.

Start the emulator by running:


_10
> flow emulator

And then the flow dev:


_10
> flow dev

Next steps

As part of the next steps you can read more about flow dev command.