Skip to main content

Installation

Prerequisites

  • Node.js 22.0 or higher
  • A package manager: npm, yarn, or pnpm
Try it online first

Want to try Skittles without installing anything? Use the online playground to write TypeScript contracts and see the generated Solidity in real-time.

Get Started

The fastest way to get started is to scaffold a new project. This downloads the compiler, creates an example contract, installs dependencies, and sets up Hardhat for you:

npx skittles@latest init

No separate install step is needed. npx skittles@latest fetches the latest version and runs it directly.

Adding to an Existing Project

If you want to add Skittles to a project that already has a package.json, you can install it as a dependency:

npm install skittles

Or with pnpm:

pnpm add skittles

This installs the Skittles compiler, CLI, and TypeScript type definitions. For testing and deploying your contracts, use Hardhat; skittles init sets this up for you.

Verify Installation

After scaffolding or installing, verify the CLI is available:

npx skittles --help

You should see the available commands:

skittles <command> [options]

Commands:
skittles compile Compile TypeScript contracts to Solidity
skittles clean Remove build artifacts
skittles init Initialize a new Skittles project

Options:
--help Show help
--version Show version number

What Gets Installed

The skittles package provides:

ExportPurpose
address, bytes, bytes32Ethereum primitive types for contract files
msg, block, txBlockchain context (msg.sender, block.timestamp, etc.)
selfThe contract's own address (address(this) in Solidity)
SkittlesEvent<T>, Event<T>Declare contract events
SkittlesError<T>Declare custom errors
Indexed<T>Mark event parameters as indexed
keccak256, sha256, hashBuilt-in hash functions (hash is an alias for keccak256)
ecrecoverRecover signer address from a signature
addmod, mulmodArbitrary precision modular arithmetic
gasleftGet remaining gas for the current transaction
abiABI encoding/decoding namespace
Contract<T>Reference an external contract at an address via its interface
SkittlesConfigConfiguration type for skittles.config.json

For testing compiled contracts, use Hardhat with the setup created by skittles init. See the Testing Guide for details.

The main exports are TypeScript type stubs that provide IDE support (autocomplete, type checking). At compile time, Skittles reads the TypeScript AST directly; the stubs are never executed at runtime.

Next Steps

Continue to Quick Start to scaffold a project and compile your first contract.