Skip to main content

Installation

Get up and running with Compose in just a few minutes.

Packages

Compose is published as two npm packages:

Prerequisites

  • Node.js >= 20: required for the CLI and for npm-based Hardhat workflows
  • Foundry (Optional): required if you use a Foundry scaffold or integrate Solidity with Forge
  • Git: used by Foundry dependency installs inside generated projects

Create a new project with Compose CLI

The fastest path is to run the CLI with npx (no global install):

npx @perfect-abstractions/compose-cli init

Manual Installation

To install the CLI globally:

npm install -g @perfect-abstractions/compose-cli
compose init

Add Compose to an existing project (Manual Installation)

Foundry

forge install Perfect-Abstractions/Compose@tag=compose@0.0.3

Create a remappings.txt file in the root of your project with the following content:

@perfect-abstractions/compose/=lib/Compose/src/

Hardhat / NPM

npm install @perfect-abstractions/compose

Import Compose in your project

import {DiamondMod} from "@perfect-abstractions/compose/diamond/DiamondMod.sol";

Getting Help

Having trouble with installation?

Development Environment

We recommend using VSCode with the Solidity extension by Juan Blanco for the best development experience.

Newsletter

Get notified about releases, feature announcements, and technical deep-dives on building smart contracts with Compose.

No spam. Unsubscribe anytime.