CLI
A command-line interface for bootstrapping, generating types, compiling, and deploying tasks using Mimic Protocol’s workflow.
1. Initialize
Initializes a new Mimic-compatible project structure in the current directory. This command will create a minimal folder layout, a manifest file, and example AssemblyScript task.
Usage
Options
--force
Overwrite existing files if they already exist
false
Examples
Manifest
This file describes metadata, triggers, inputs, and ABIs for your AssemblyScript task, so the CLI can validate, generate code, compile, and ultimately deploy your task. For example:
2. Codegen
Scans your manifest.yaml
and generates typed interfaces for declared inputs and ABIs. This step is typically used to create or update TypeScript/AssemblyScript types for your project so you can safely reference them in your code.
Usage
Options
--manifest <path>
Specify a custom manifest file path
manifest.yaml
--output <dir>
Output directory for generated types
types
--clean
Remove existing generated types before generating new files
false
Examples
3. Compile
Compiles your AssemblyScript task into a Wasm binary, along with validating your manifest and producing any required runtime artifacts (like inputs.json
). This step ensures you have a complete, ready-to-deploy package of your task logic and metadata.
Usage
Options
--task <path>
Path to the AssemblyScript entry file
src/task.ts
--manifest <path>
Path to the manifest file to validate
manifest.yaml
--output <directory>
Output directory for compiled artifacts
build
Examples
Outputs
After a successful compile, you should see:
task.wasm
– The compiled WebAssembly binary.manifest.json
– A validated version of your manifest.inputs.json
– A list of environment or external dependencies.
4. Deploy
Uploads your compiled task artifacts to IPFS and registers it into the Mimic Registry so others can discover it. This step pins the result under a CID so relayers can discover and execute it.
You must retrieve your deployment key from the Mimic explorer under your account settings. If you don’t have one, create or copy it from there before running deploy
.
Usage
Options
--key <deploymentKey>
Your account deployment key
(no default)
--input <directory>
Directory containing the compiled artifacts
build
--output <directory>
Output directory for deployment CID
build
Examples
Outputs
After a successful deployment, you should see:
CID
– The CID where the task was published.
5. Link
Associates a previously deployed task, identified by its CID, with a specific project under your account. This step lets your project reference and manage the deployed task, making it discoverable to your relayers or team.
The project you specify must be created beforehand in the Mimic explorer. If you don’t have a project yet, create one there before running link
.
Usage
Options
--project <projectKey>
The key to identify the project you want to link this task to
(no default)
--key <deploymentKey>
Your deployment key, used to authenticate the linking operation
(no default)
--task <CID>
The CID where your task artifacts were published
build/CID
Examples
Last updated