mops-cli

Manages Motoko projects with mops CLI for toolchain pinning, dependencies, checking, and building.

Updated Apr 3, 2026
One-click install
npx skills add https://github.com/phukrit7171/Relationship-Smart-Contract-ICP --skill mops-cli-phukrit7171
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mops-cli
Source: https://github.com/phukrit7171/Relationship-Smart-Contract-ICP/tree/main/.agents/skills/mops-cli
Command: npx skills add https://github.com/phukrit7171/Relationship-Smart-Contract-ICP --skill mops-cli-phukrit7171

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Motoko developers on the Internet Computer need consistent toolchain versions, dependency management, and reliable canister builds without relying on dfx. This Skill provides an opinionated workflow for configuring mops.toml, pinning moc and lintoko versions, managing packages, and running checks and builds. ## Core Features & Use Cases - Toolchain Pinning: Pin moc, lintoko, and pocket-ic versions in mops.toml so every build uses the same compiler. - Dependency Management: Add, remove, update, and sync Motoko packages with mops.lock tracking, using mo:core instead of the deprecated mo:base. - Canister Checks and Builds: Run mops check with stable-variable compatibility verification against deployed .most baselines, lint with lintoko, and build wasm, .did, and .most artifacts. - Use Case: After cloning a Motoko canister project, run mops install, pin the latest moc toolchain, add the core package, then run mops check to verify types, stable compatibility, and lint before building deployable wasm. ## Quick Start Ask the assistant to set up a new Motoko project with mops, pin the latest moc toolchain, add the core dependency, and run mops check on the backend canister.

Frequently Asked Questions about mops-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pin the moc compiler version in a Motoko project?

Pin moc by adding a [toolchain] section in mops.toml with moc = "1.7.0", or run mops toolchain use moc latest for the newest version. Always pass a version or latest, since running without one opens an interactive picker unsuitable for scripts.

How do I add and update Motoko dependencies with mops?

Run mops add core to install the latest version or mops add [email protected] for a specific one, which updates mops.toml and mops.lock. Use mops update to bump within caret bounds, mops update --major to cross major versions, and mops outdated to list stale packages.

Should I use mo:base or mo:core in new Motoko projects?

Use mo:core, since mo:base is deprecated. Import modules with paths like import Array "mo:core/Array" and add the core package via mops add core.

What does mops check do before building a canister?

mops check runs moc type-checking, then check-stable if configured, then lintoko linting. The check-stable step compares your code against a deployed .most baseline so incompatible stable-variable changes fail locally instead of during a live upgrade.

Why does mops test warn about the deprecated dfx replica?

Replica-mode tests, benchmarks, and watch mode fall back to the deprecated dfx replica when pocket-ic is not pinned. Pin pocket-ic in the [toolchain] section of mops.toml to silence the warning and use a supported replica.

Can I pass file paths to mops check instead of canister names?

No, mops check expects canister names defined in the [canisters] section of mops.toml so per-canister args apply automatically. The exception is library packages without canisters, where you pass file paths like mops check src/**/*.mo.