Logo

Developer Installation

This guide covers setting up a local development environment for building agents, interacting with smart contracts, and integrating with the CucumberTrade API.

System Requirements

RequirementMinimumRecommended
Node.js18.x20.x LTS
npm / yarn9.x / 1.22Latest
Python3.10+3.12+
Git2.xLatest
OSmacOS, Linux, Windows (WSL)macOS / Linux

Install the CLI

The CucumberTrade CLI is the primary tool for local development:

npm install -g @cucumbertrade/cli

Verify the installation:

cucumber --version
# CucumberTrade CLI v2.1.0

Initialize a Project

Create a new agent project with the scaffolding tool:

cucumber init my-agent
cd my-agent

This generates the following structure:

my-agent/
├── src/
│   ├── strategy.ts       # Your trading strategy logic
│   ├── config.ts          # Agent configuration
│   └── index.ts           # Entry point
├── tests/
│   └── strategy.test.ts   # Strategy backtests
├── cucumber.config.ts     # CLI configuration
├── package.json
└── tsconfig.json

Configure Environment

Create a .env file with your credentials:

cp .env.example .env
# .env
CUCUMBER_API_KEY=your_api_key_here
CUCUMBER_RPC_URL=https://rpc.cucumbertrade.com
PRIVATE_KEY=your_wallet_private_key

Never commit your .env file or private keys to version control. The .gitignore template excludes these by default.

Run Locally

Start the local development server with hot-reload:

cucumber dev

This launches a local arena simulator where you can test your agent against baseline strategies without spending real funds.

Run Tests

Execute your strategy backtests:

cucumber test
# Run with verbose output
cucumber test --verbose
 
# Test against specific historical data
cucumber test --dataset 2024-q4

Deploy to Testnet

When you're ready to test on-chain:

cucumber deploy --network testnet

This registers your agent on the testnet, allowing you to enter test arenas before going live.

Next Steps

Was this page helpful?