midnight-tooling:compact-cli

Install, configure, and troubleshoot the Compact CLI compiler toolchain for smart contracts.

37|9|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/devrelaicom/midnight-expert --skill midnight-tooling-compact-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: midnight-tooling:compact-cli
Source: https://github.com/devrelaicom/midnight-expert/tree/main/plugins/midnight-tooling/skills/compact-cli
Command: npx skills add https://github.com/devrelaicom/midnight-expert --skill midnight-tooling-compact-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill removes friction from installing, configuring, and troubleshooting the Compact CLI and compiler toolchain used to build Midnight Compact smart contracts. It addresses PATH and installer issues, missing or mismatched compiler versions, slow compilation due to proving key generation, formatting and fixup failures, and GitHub API rate limits that block version queries.

Core Features & Use Cases

  • Installation and PATH guidance: First-time installer usage, verifying binary location, and uninstall steps.
  • Compiler version management: Install, list, pin, switch, and use project-local compiler versions or compile with an explicit +VERSION without changing defaults.
  • Compile, format, and fixup workflows: Run compile with flags like --skip-zk, configure import search paths, run format and fixup in check mode for CI, and interpret compiler output structure.
  • Troubleshooting and recovery: Diagnose exit codes and parse errors, handle network and GitHub rate limits, recover from corrupt artifacts, and speed up development builds.
  • Use Case: Set up a new developer machine, add the CLI to PATH, download a specific compiler version for a project, and run a fast development compile that skips proving-key generation.

Quick Start

Install the Compact CLI, add its binary directory to your PATH, run compact update 0.30.0 to download and set a compiler, and then confirm the compiler with compact compile --version.

Frequently Asked Questions about midnight-tooling:compact-cli

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

FAQPage Schema
How do I install the Compact CLI and fix PATH issues on a new machine?

To install the Compact CLI, run the first-time installer and add its binary directory to your PATH, then verify the binary location to resolve PATH issues. This setup enables you to execute Compact compiler commands directly from any terminal.

How do I pin or switch Midnight Compact compiler versions for a specific project?

You can pin and switch Compact compiler versions by running compact update with a target version, or compile with an explicit +VERSION flag without changing defaults. This ensures project-local toolchain consistency across different environments.

Why does compiling a Compact smart contract take so long during proving key generation?

Compact smart contract compilation slows down during proving key generation, which you can bypass using the --skip-zk compiler flag. This accelerates development builds by skipping the cryptographic proving key creation process.

How do I run formatting and fixup checks for Compact contracts in CI?

Run the Compact CLI format and fixup commands in check mode to validate code style during CI integration. This verifies formatting compliance without modifying files, ensuring contract code meets project standards before merging.

What should I do when the Compact CLI fails to download compiler versions due to GitHub API rate limits?

When the Compact CLI fails to query or download compiler versions due to GitHub API rate limits, you should troubleshoot network connectivity and configure authentication to raise rate thresholds. This resolves version query blocking and restores toolchain access.

Can I compile multi-file Compact smart contracts with custom import paths?

Yes, you can compile multi-file Compact smart contracts by configuring import search paths with compiler flags like --compact-path. This directs the compiler to locate dependencies correctly across complex contract structures.