mops-cli
БесплатноБез исполняемых скриптовНе проверенManage Motoko projects with the mops CLI — toolchain pinning, dependency management, type-checking, building, and linting. Use when working with mops.toml…
от jiayaoqijia★ 81 звезда на GitHubОб этом скилле
Mops CLI
Opinionated guide for Motoko projects. Covers project config, dependency management, type-checking, building, and linting.
Key Principles
- No dfx — mops neither invokes nor supports
dfx. There is nomops toolchain init, nomoc-wrapper, and nomops watch --generate/--deploy. Always pinmocin[toolchain]; every command that compiles requires it. Use the newestmocversion. Pinpocket-ictoo if you have replica tests, benchmarks, or--check-deploy— with no pin those commands error, namingmops toolchain use pocket-ic 15.0.0. WhenMOPS_POCKET_IC_URLpoints at an already-running PocketIC server, no pin is needed and an existing pin is ignored with a warning — do not add one to silence it; unset the variable instead. - No
mo:base— it is deprecated. Always usemo:core(import Array "mo:core/Array"). - All config in
mops.toml— canisters, moc flags, toolchain versions, build settings. - Canister-centric workflow — define all canisters in
[canisters]; never pass file paths tomops check. Exception: library packages (no[canisters]) use file paths directly:mops check src/**/*.mo.
Project Setup
Minimal mops.toml
[toolchain]
moc = "1.15.1"
lintoko = "0.11.0"
pocket-ic = "15.0.0" # required for replica tests / benchmarks / --check-deploy
[dependencies]
core = "2.6.1"
[moc]
args = ["--default-persistent-actors", "-W=M0223,M0236,M0237"]
[canisters.backend]
main = "src/backend/main.mo"
[canisters.backend.migrations]
chain = "src/backend/migrations"
# check-limit = 10 # optional — speeds up `mops check` when the chain gets long
[canisters.backend.check-stable]
path = "deployed/backend.most"
[build]
outputDir = "src/backend/dist"
args = ["--release"]
# check-wasm = true # optional: analyze final Wasm complexity
# check-deploy = true # optional: verify fresh PocketIC installation after build
# Opt-in Wasm optimization (Binaryen wasm-opt) for build + bench
[optimize]
# level = "O3" # default
# keep-names = true # default
# wasm-opt pin: [toolchain] wasm-opt = "131" (required when [optimize] is set)
check-stable runs ICP's upgrade-time stable-variable compatibility check locally, so incompatible changes fail in mops check instead of being rejected when upgrading a live canister. It compares the current code against a .most from the deployed version.
Bootstrap that .most: new project → mops deployed init (empty-actor baseline); already-deployed canister → build from the deployed commit, then mops deployed. After every deploy, run mops deployed to promote the just-built .most (see mops deployed below).
Optional canister fields: candid (path to .did for compatibility checking), initArg (Candid-encoded init args).
Warning Flags
-W=M0223,M0236,M0237 — redundant type instantiation (M0223), suggest contextual dot notation (M0236), suggest redundant explicit arguments (M0237). These are allowed (disabled) by default; -W= enables them as warnings.
Moc Args Layering
Flags are applied in this order (later overrides earlier):
[moc].args— global, all commands (check, build, test, bench, etc.)[build].args— build only (e.g.--release)[canisters.<name>.migrations]— auto-injected--enhanced-migration(managed by mops)[canisters.<name>].args— per-canister- CLI
-- <flags>— one-off overrides; supported bymops check,mops build,mops check-stable,mops generate,mops migrate,mops test, andmops bench
Core Commands
mops install
mops install # dev flow: keeps mops.lock in sync, self-heals a broken one
mops install --locked # CI flow: fail if mops.lock is missing or would change
Run after cloning or after manual mops.toml edits. mops.lock is always maintained — there is no flag to opt out, and no --lock flag (removed in v3). A missing, unparseable, legacy-format or mops.toml-inconsistent lock is regenerated by a plain mops install, including locks that still carry absolute local paths from older CLIs, and locks that lost a transitive dependency (a locked package declares a dependency that deps no longer lists — typically a botched merge).
--locked requires an up-to-date lock and never writes it. It is also available on every implicitly-installing command (mops build, mops check, mops check-stable, mops check-candid, mops test, mops bench, mops generate candid), so CI can run mops test --locked with no prior install. mops sources has no --locked (a packtool caller parses its stdout mid-build) — put mops install --locked earlier in the pipeline instead.
The CI env var no longer affects lockfile behavior (removed in v3). Commit mops.lock — for applications and libraries alike.
A lock also goes stale when a local path dependency's own mops.toml changes — including one nested further down the chain. mops install regenerates it; `--loc
Установить mops-cli в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл mops-cli?
Manage Motoko projects with the mops CLI — toolchain pinning, dependency management, type-checking, building, and linting. Use when working with mops.toml, mops.lock, running mops commands, adding/removing packages, pinning moc or lintoko versions, checking or building canisters, configuring moc flags, or setting up a new Motoko project.
Как установить скилл mops-cli?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mops-cli запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic