@mimicprotocol/cli
v0.0.1-rc.41
Published
<h1 align="center"> <a href="https://mimic.fi"><img src="https://www.mimic.fi/logo.png" alt="Mimic Protocol" width="200"></a> </h1>
Readme
Content
The mimic CLI is a command-line interface to:
- Initialize a Mimic-compatible function project
- Generate types from your function manifest and ABIs
- Compile your AssemblyScript functions to WebAssembly
- Test your functions
- Deploy compiled functions to IPFS and the Mimic Registry
- Link functions to a project in the Mimic explorer
Setup
To set up this project you'll need git and yarn installed.
Install the CLI from the root of the monorepo:
# Clone this repository
$ git clone https://github.com/mimic-protocol/tooling
# Go into the repository
$ cd tooling
# Install dependencies
$ yarnUsage
Here's a quick overview of common commands:
USAGE
$ mimic [COMMAND]
COMMANDS
login Authenticate with Mimic by storing your API key locally
logout Remove stored credentials for a profile
profiles List all configured authentication profiles
codegen Generates typed interfaces for declared inputs and ABIs from your manifest.yaml file
compile Compiles the function
test Tests your functions
deploy Uploads your compiled function artifacts to IPFS and registers it into the Mimic Registry
init Initializes a new Mimic-compatible project structure in the specified directoryAuthentication
Before deploying functions, you need to authenticate with your Mimic API key:
# Interactive login (recommended)
$ mimic login
# Non-interactive login (for CI/CD)
$ mimic login --api-key YOUR_API_KEY
# Login with a specific profile
$ mimic login --profile staging -api-key YOUR_API_KEYManaging Profiles
The CLI supports multiple authentication profiles. Credentials are stored in ~/.mimic/credentials.
# List all configured profiles
$ mimic profiles
# Login with a specific profile
$ mimic login --profile production
# Deploy using a specific profile
$ mimic deploy --profile production
# Remove credentials for a profile
$ mimic logout --profile stagingCredential Storage
Credentials are stored in an INI-style format at ~/.mimic/credentials:
[default]
api_key=YOUR_DEFAULT_KEY
[staging]
api_key=YOUR_STAGING_KEY
[production]
api_key=YOUR_PRODUCTION_KEYDeploy with Authentication
The deploy command now supports profile-based authentication:
# Deploy using default profile
$ mimic deploy
# Deploy using a specific profile
$ mimic deploy --profile staging
# Deploy with explicit API key (overrides profile)
$ mimic deploy --api-key YOUR_API_KEYFor full CLI documentation and examples please visit docs.mimic.fi
Security
To read more about our auditing and related security processes please refer to the security section of our docs site.
However, if you found any potential issue in any of our smart contracts or in any piece of code you consider critical for the safety of the protocol, please contact us through [email protected].
License
This project is licensed under the GNU General Public License v3.0.
See the LICENSE file for details.
Third-Party Code
This project includes code from The Graph Tooling, licensed under the MIT License.
See the LICENSE-MIT file for details.
Their original license and attribution are preserved.
Website mimic.fi · Docs docs.mimic.fi · GitHub @mimic-fi · Twitter @mimicfi · Discord mimic
