diff --git a/docs/build/guides/flow-cli.md b/docs/build/guides/flow-cli.md deleted file mode 100644 index 4d4a31cc1c..0000000000 --- a/docs/build/guides/flow-cli.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: Flow CLI -sidebar_label: Install Flow CLI -description: Guide to installing and using Flow CLI -sidebar_position: 5 ---- - -## MacOS - -### Homebrew - -```sh -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: - -```sh -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: - -```sh -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). - -```sh -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](../../tools/flow-cli/install.md#installing-versions-before-0420) below. - -## Windows - -### From a pre-built binary - -_This installation method only works on Windows 10, 8.1, or 7 (SP1, with [PowerShell 3.0](https://www.microsoft.com/en-ca/download/details.aspx?id=34595)), on x86-64._ - -1. Open PowerShell ([Instructions](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-7#finding-powershell-in-windows-10-81-80-and-7)) -2. In PowerShell, run: - - ```powershell - 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: -``` -> flow setup hello-world --scaffold - -🔨 General Scaffolds - [1] Empty Cadence Project - Empty project containing only basic folder structure and flow.json configuration. - [2] Simple Cadence Project - Scaffold contains required folder structure as well as some example Cadence code. - [3] Cadence NFT Project - Scaffold contains the ExampleNFT sample NFT contract. - [4] Hybrid Custody Project - Starter for exploring & implementing Hybrid Custody. - -💻 Web Scaffolds - [5] FCL Web Dapp - Simple TypeScript web application using next.js, FCL, and Cadence. - -📱 Mobile Scaffolds - [6] Swift iOS simple example - iOS example demonstrating usage of FCL and Flow interactions. - [7] Android simple example - Android example demonstrating usage of FCL and Flow interactions. - [8] FCL React Native Mobile Dapp - React Native (Expo) mobile dapp example demonstrating FCL and Flow interactions. - -🏀 Unity Scaffolds - [9] Simple Unity - Simple example demonstrating how to interact with the Flow network using Unity SDK. - [10] Mobile Unity Game - Example words game built on Flow using the Unity SDK. -``` - -After you have created your new project, you can proceed to writing contracts. Once your contracts have been written, run the `flow dev` command the CLI will deploy them to the Flow emulator. Flow emulator is -a simplified version of Flow network that runs locally. It makes writing, deploying and testing contracts easier. - -So proceed by starting the emulator: - -``` -> flow emulator -``` - -And then the flow dev: -``` -> flow dev -``` - -### Next steps - -As part of the next steps you can read more about [flow dev command](../../tools/flow-cli/super-commands.md). diff --git a/docs/build/guides/fungible-token.md b/docs/build/guides/fungible-token.md index 46da1c5999..82da4605af 100644 --- a/docs/build/guides/fungible-token.md +++ b/docs/build/guides/fungible-token.md @@ -80,15 +80,14 @@ please follow [the installation guide here](https://developers.flow.com/tools/fl > 💡 Note: Here is [a link to the completed code](https://github.com/chasefleming/FooToken) if you want to skip ahead or reference as you follow along. -Once you have the Flow CLI installed, you can set up a new project -using the `flow setup` command. This command initializes -the necessary directory structure and a `flow.json` configuration file -(a way to configure your project for contract sources, deployments, accounts, and more): +Once you have the Flow CLI installed, you can set up a new project using the `flow init` command. This command initializes the necessary directory structure and a `flow.json` configuration file (a way to configure your project for contract sources, deployments, accounts, and more): ```bash -flow setup FooToken +flow init FooToken ``` +> Note: Select "No" when it asks you to install core contracts for the purposes of this tutorial. + Upon execution, the command will generate the following directory structure: ``` diff --git a/docs/build/guides/nft.md b/docs/build/guides/nft.md index 3e61de2002..83665d70bc 100644 --- a/docs/build/guides/nft.md +++ b/docs/build/guides/nft.md @@ -39,15 +39,14 @@ please follow [the installation guide here](../../tools/flow-cli/install.md). > 💡 Note: Here is [a link to the completed code](https://github.com/chasefleming/foobar-nft) if you want to skip ahead or reference as you follow along. -Once you have the Flow CLI installed, you can set up a new project -using the `flow setup` command. This command initializes -the necessary directory structure and a `flow.json` configuration file -(a way to configure your project for contract sources, deployments, accounts, and more): +Once you have the Flow CLI installed, you can set up a new project using the `flow init` command. This command initializes the necessary directory structure and a `flow.json` configuration file (a way to configure your project for contract sources, deployments, accounts, and more): ```bash -flow setup foobar-nft +flow init foobar-nft ``` +> Note: Select "No" when it asks you to install core contracts for the purposes of this tutorial. + Upon execution, the command will generate the following directory structure: ``` diff --git a/docs/build/smart-contracts/deploying.md b/docs/build/smart-contracts/deploying.md index 6a332bc5dd..4db112fe87 100644 --- a/docs/build/smart-contracts/deploying.md +++ b/docs/build/smart-contracts/deploying.md @@ -25,7 +25,7 @@ Anyone can deploy and update contracts on mainnet. Audits are encouraged but not ### Create and deploy a mainnet project The tool of choice is Flow CLI, there are quickstarts and guides that use Flow CLI, [Getting Started](../getting-started/flow-cli) - It is highly encouraged to test your contracts, transactions and scripts on Testnet, have strong smart contract test coverage and follow any additional guidelines set out here: [Smart Contract Testing Guidelines](./testing.md). -- Follow the Flow CLI instructions to [Create a Project](../../tools/flow-cli/index.md). You have the Flow CLI installed and ran `flow init` or `flow setup` in your project folder and generating a `flow.json` file +- Follow the Flow CLI instructions to [Create a Project](../../tools/flow-cli/index.md). You have the Flow CLI installed and ran `flow init` in your project folder and generating a `flow.json` file - Mainnet account: You completed the mainnet account setup, (see above) and have your key pair and mainnet address ready. - [Deploy your project](../../tools/flow-cli/deployment/deploy-project-contracts.md), notice that your account now has contracts deployed on mainnet. - [Deploy a contract](../../tools/flow-cli/accounts/account-add-contract.md) to mainnet. You can deploy contracts individually using the `account-add-contract` command. diff --git a/docs/tools/flow-cli/index.md b/docs/tools/flow-cli/index.md index 6d982cd48e..1ba77e66b9 100644 --- a/docs/tools/flow-cli/index.md +++ b/docs/tools/flow-cli/index.md @@ -8,6 +8,8 @@ The **Flow Command Line Interface (CLI)** is a powerful tool that enables develo With Flow CLI, developers can: +- **Initialize Projects**: Quickly set up new Flow projects using the `flow init` command, which creates the necessary files and directories, sets up your project configuration, and installs any core contract dependencies. +- **Manage Contract Dependencies**: Use the [Dependency Manager](dependency-manager.md) to install and manage smart contract dependencies effortlessly, simplifying the integration of external contracts into your project. - **Manage Accounts**: Create and manage Flow accounts, configure keys, and handle account-related operations. - **Send Transactions**: Build, sign, and submit transactions to the Flow network, allowing for contract interaction and fund transfers. - **Query Chain State**: Retrieve data from the Flow blockchain, including account balances, event logs, and the status of specific transactions. @@ -23,49 +25,6 @@ The Flow CLI is essential for developers looking to build, test, and maintain de Follow [these steps](../flow-cli/install.md) to install the Flow CLI on macOS, Linux, and Windows. -## Create your first project -The Flow CLI is Flow’s primary development and testing environment, similar to Hardhat and Foundry for developers familiar with writing in Solidity. 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. - -``` -> flow setup hello-world --scaffold - -🔨 General Scaffolds - [1] Empty Cadence Project - Empty project containing only basic folder structure and flow.json configuration. - [2] Simple Cadence Project - Scaffold contains required folder structure as well as some example Cadence code. - [3] Cadence NFT Project - Scaffold contains the ExampleNFT sample NFT contract. - [4] Hybrid Custody Project - Starter for exploring & implementing Hybrid Custody. - -💻 Web Scaffolds - [5] FCL Web Dapp - Simple TypeScript web application using next.js, FCL, and Cadence. - -📱 Mobile Scaffolds - [6] Swift iOS simple example - iOS example demonstrating usage of FCL and Flow interactions. - [7] Android simple example - Android example demonstrating usage of FCL and Flow interactions. - [8] FCL React Native Mobile Dapp - React Native (Expo) mobile dapp example demonstrating FCL and Flow interactions. - -🏀 Unity Scaffolds - [9] Simple Unity - Simple example demonstrating how to interact with the Flow network using Unity SDK. - [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: - -``` -> flow emulator -``` - -After creating your new project you are ready to start writing contracts. The Flow emulator is a simplified local simulation of the Flow network. Running the dev command in the CLI ensures that the contracts are deployed to the Flow emulator for you. - -And then the flow dev: -``` -> flow dev -``` - -### Next steps - -As part of the next steps you can read more about [flow dev command](super-commands.md). +## Create Your First Project +To get started with creating your first Flow project and to learn more about how to use the Flow CLI super commands, please refer to the [Super Commands documentation](super-commands.md). These commands simplify the setup and development process, allowing you to focus on building your application without worrying about the underlying configurations. diff --git a/docs/tools/flow-cli/super-commands.md b/docs/tools/flow-cli/super-commands.md index 9e3226a7b3..c99a613e9a 100644 --- a/docs/tools/flow-cli/super-commands.md +++ b/docs/tools/flow-cli/super-commands.md @@ -7,7 +7,9 @@ sidebar_position: 2 Flow CLI Super commands are set of commands that can be used during development of your dApp to greatly simplify the workflow. The result is you can focus on writing the contracts and the commands will take care of the rest. ## Init -The initial command to start your new Flow project is `flow init`. It will ask you a few questions about how you'd like to configure your project and then create the necessary files and folders, setup the configuration file, and install any core contracts dependencies you might need. +The initial command to start your new Flow project is flow init. It will ask you a few questions about how you'd like to configure your project and then create the necessary files and folders, set up the configuration file, and install any core contract dependencies you might need. + +During the initialization process, `flow init` will prompt you if you want to install any core smart contracts (e.g. `NonFungibleToken`) and set them up in your project. If you choose to install core contracts, the CLI will use the [Dependency Manager](dependency-manager.md) under the hood to automatically install any required smart contract dependencies. > Note: If you just want the `flow.json` configured without creating any folders or files, you can run `flow init --config-only`. diff --git a/vercel.json b/vercel.json index 71067480bc..ce81d39761 100644 --- a/vercel.json +++ b/vercel.json @@ -1252,6 +1252,11 @@ "source": "build/smart-contracts/cadence", "destination": "https://cadence-lang.org/docs/", "permanent": true + }, + { + "source": "/build/guides/flow-cli", + "destination": "/tools/flow-cli/install", + "permanent": true } ] } \ No newline at end of file