The official command-line interface for AnyFlow operations. This CLI allows you to interact with the AnyFlow ecosystem, deploy smart contracts, and manage your projects.
- Installation
- Usage
- First Use and Authentication
- Commands
- Configuration
- New Features
- Contributing
- License
npm install -g anyflow-cli
After installation, you can use the CLI with the anyflow
command:
anyflow [command] [options]
To get started with the AnyFlow CLI, you'll need to authenticate your session. Follow these steps:
-
Initialize Your Project: If you are starting a new project, navigate to your project directory:
mkdir my-anyflow-project cd my-anyflow-project
-
Run the Init Command: This command will create the necessary environment variables:
anyflow init
-
Run the Install Command: This will update your
hardhat.config.js
with the necessary configuration:anyflow install
-
Authenticate: Run the following command to authenticate your session:
anyflow auth
This command will prompt you for your API key and may attempt to open your browser. Enter your API key when prompted to complete the authentication process.
-
Verify Authentication: After successful authentication, you can verify that you are logged in by running:
anyflow check-auth
If you see a confirmation message, you are successfully authenticated and ready to use the CLI.
Available commands:
help
: Show help information for AnyFlow CLI.init
: Create the necessary environment variables.install
: Update yourhardhat.config.js
with the necessary configuration.auth
: Authenticate your session with AnyFlow.check-auth
: Check your authentication status.deploy
: Upload your artifacts to the AnyFlow platform and deploy your project.--networks <network...>
: Specify networks to deploy to--deterministic-addresses
or-da
: Use deterministic addresses
logout
: Clear your authentication credentials.fix
: Fix failed deployments.version:check
: Check for newer versions of the CLI.
The CLI can be configured through environment variables. You can create a .env
file in your project root with the following variables:
# API Configuration
API_URL=https://api.anyflow.pro
# Bugsnag Error Reporting (only active in production)
BUGSNAG_API_KEY=your_bugsnag_key
# Node Environment
NODE_ENV=development
The CLI now automatically checks for updates when running commands. If a new version is available, it will notify you. You can also manually check for updates:
anyflow version:check
The CLI now includes error reporting via Bugsnag to help us identify and fix issues faster. This is only active in production environments and doesn't collect any sensitive data.
The CLI now has improved logging with color-coded output and different log levels:
- DEBUG: Detailed debugging information
- INFO: General operational information
- SUCCESS: Successful operations
- WARNING: Potential issues that don't prevent operation
- ERROR: Error conditions
The CLI now validates environment variables to prevent runtime errors due to missing or invalid configuration.
We welcome contributions to the AnyFlow CLI! Please see the CONTRIBUTING.md file for details on how to contribute.
This project is licensed under the ISC License.