Skip to content

dfinity/icp-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

280 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

icp-cli

A command-line tool for building and deploying applications on the Internet Computer.

Quick Start

Prerequisites: Node.js (LTS)

Install:

# icp-cli and ic-wasm (required)
npm install -g @icp-sdk/icp-cli @icp-sdk/ic-wasm

# Motoko toolchain (for Motoko projects)
npm install -g ic-mops && mops toolchain init

Alternative methods: See the Installation Guide for Homebrew, shell script, Rust setup, or platform-specific instructions.

Then follow the Quickstart to deploy your first canister in under 5 minutes.

For dfx Users

If you're coming from dfx (the previous Internet Computer SDK), see the Migration Guide for command mappings, workflow differences, and how to migrate existing projects.

Documentation

πŸ“š Full Documentation Site β€” Complete guides, tutorials, and reference

Or browse the markdown docs directly:

  • Quickstart β€” Deploy a canister in under 5 minutes
  • Tutorial β€” Learn icp-cli step by step
  • Guides β€” How to accomplish common tasks
  • Concepts β€” Understand how icp-cli works
  • Reference β€” Complete CLI and configuration reference

Examples

The examples/ directory contains example projects to help you get started:

  • icp-motoko/ β€” Motoko canister
  • icp-rust/ β€” Rust canister
  • icp-static-assets/ β€” Static website
  • icp-environments/ β€” Multi-environment setup

View all examples β†’

Getting Help

Contributing

Contributions are welcome! See CONTRIBUTING.md for detailed guidelines.

Prerequisites

Platform Install
macOS xcode-select --install
Ubuntu/Debian sudo apt install build-essential pkg-config libssl-dev
Fedora/RHEL sudo dnf install gcc pkg-config openssl-devel
Arch Linux sudo pacman -S base-devel openssl
Windows VS build tools (see Rustup's guide)

Tests additionally depend on wasm-tools, mitmproxy, and SoftHSM2.

Build and Test

git clone https://github.com/dfinity/icp-cli.git
cd icp-cli
cargo build
cargo test

Development

# Run the CLI during development
cargo run -- <command>

# Build release binary
cargo build --release
# Binary is at target/release/icp

# Format and lint
cargo fmt && cargo clippy

# Generate CLI docs (after changing commands)
./scripts/generate-cli-docs.sh

# Update config schemas (after changing manifest types)
./scripts/generate-config-schemas.sh

Working with Documentation

# Preview documentation site locally
cd docs-site && npm install && npm run dev
# Opens at http://localhost:4321

# Prepare docs for build (runs automatically during build)
./scripts/prepare-docs.sh

Documentation structure follows the DiΓ‘taxis framework:

See docs/README.md for documentation writing guidelines.

License

Apache-2.0

About

The command-line interface for the ICP SDK.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 12