Skip to main content

CLI

Pebble comes with a command-line interface(CLI) for working with smart contracts.

The pebble command-line tool is the official utility for working with Pebble projects.

Now, let's see how you can use the Pebble CLI.

# if installed globally
npm install -g @harmoniclabs/pebble-cli

# then
pebble <command>

# or, use `npx` / direct node invocation if you prefer not to install globally
npx pebble <command> # if the package is published that way

Commands

help

Display help for pebble commands

Usage

pebble help

version

Output the pebble CLI and language versions

Alternative: --version

Usage

pebble version
pebble --version

init

Creates a new directory with a fresh pebble project

Usage

pebble init

compile

Compiles a Pebble project

Usage

pebble compile [options]

Options

  • -c <string> : The config file path. Default: ./pebble.config.json. Alternative: --config

  • --entry <string> : The entry file path (a .pebble file). Used only if it is missing from the configuration. Default: ./index.pebble.

  • -o <string> : The output file path. Used only if it is missing from the configuration. Default: ./out.flat. Alternative: --output

Example

pebble compile --config ./pebble.config.json

# or with explicit entry and output
pebble compile --entry ./src/contracts/MyContract.pebble -o ./build/MyContract.flat