🤖Open CLI

Ape Church is a fully on-chain, decentralized casino on ApeChain. The Ape Church Open CLI lets you play Ape Church games directly from the terminal permissionlessly.

What that means in practice:

  • No accounts

  • No API keys

  • No approvals

  • Every wager is a smart contract transaction on ApeChain

  • Randomness is provably fair via Chainlink VRF

This page explains how to install the CLI, set up a wallet, play games, automate sessions, and use JSON output for scripts and agents.

Overview

Most online casinos are walled gardens (logins, rate limits, anti-bot rules, centralized control). Ape Church is different:

  • Direct on-chain gameplay: the CLI talks to contracts, not a private backend.

  • Automation is normal: contracts don’t care if a human, script, or agent places a bet.

  • Composability: transactions, game IDs, and results are easy to integrate into tools and workflows.

Prerequisites

  • A terminal environment (local machine, VPS, container, etc.)

  • APE on ApeChain to wager

  • Enough balance to cover wagers + network fees

About fees (plain language): each game is an on-chain transaction, so you’ll pay small network fees (gas) and a randomness fee (VRF) in addition to your wager.

Install the CLI

Verify it’s installed:

Set Up Your Wallet

1. Create a wallet and register a username

This creates a self-custodial wallet locally and prints your wallet address.

2. Fund the wallet with APE on ApeChain

Send/bridge APE to the address shown after install.

Bridge - https://relay.link/bridge/apechain

3. Confirm everything is ready

Quickstart - Play a Game

Play once:

Run an automated session (loop mode):

Supported Games

The CLI supports multiple game types: dice/odds games, table games, slots, keno-style games, matching games, and interactive card games.

List games:

Quick Reference

  • ApeStrong (dice/odds): apechurch play ape-strong 10 50

  • Roulette: apechurch play roulette 10 RED

  • Baccarat: apechurch play baccarat 10 BANKER

  • Jungle Plinko: apechurch play jungle-plinko 10 2 50

  • Keno: apechurch play keno 10

  • Speed Keno: apechurch play speed-keno 10 --picks 5 --games 20

  • Slots (Dino Dough): apechurch play dino-dough 10 10

  • Monkey Match: apechurch play monkey-match 10 --mode 2

  • Bear-A-Dice: apechurch play bear-dice 10 --difficulty 1 --rolls 3

  • Blackjack (auto): apechurch blackjack 10 --auto

  • Video Poker (auto): apechurch video-poker 10 --auto

Automation: Loop Mode (with safety rails)

Loop mode is designed for long-running sessions and unattended play.

Basic loop

Safety Controls (recommended)

Use these to prevent “runaway sessions”:

Options:

  • --target <ape>: stop when balance reaches a target

  • --stop-loss <ape>: stop when balance drops to a limit

  • --max-games <n>: stop after N games

  • --delay <sec>: delay between games (default: 3)

Betting Strategies (bet sizing)

Strategies automatically adjust bet size based on win/loss patterns.

Available strategies:

  • flat (default)

  • martingale (high risk)

  • reverse-martingale

  • fibonacci

  • dalembert (d'Alembert)

Example:

Safety options:

circle-info

Recommendation: always set --max-bet when using progressive strategies (especially martingale).

Blackjack & Video Poker (auto-play)

Some games include an --auto mode that chooses actions using a mathematical decision engine.

Blackjack

Video Poker

JSON Output (for Scripts, Bots, and Agents)

All commands support machine-readable output with --json.

Status

Common fields include:

  • address

  • balance, available_ape, gas_reserve_ape

  • gp

  • paused

  • username, persona

  • can_play

Play

Play output includes:

  • tx (transaction hash)

  • game_url

  • wager + config

  • result (won, payout_ape, pnl_ape)

Errors are returned as:

Costs & Limits

Each game is an on-chain transaction, so you pay:

  • Gas (varies by game complexity)

  • VRF/randomness fees (varies)

Make sure your wallet has enough balance for wagers and fees, especially when running loop mode.

Common Issues (Quick Fixes)

  • “Insufficient balance” / session stops immediately

    • You need enough APE for your wager plus fees (gas + VRF). Add more APE or lower your bet size.

  • Stuck or unexpected loop behavior

    • Add guardrails like --max-games, --stop-loss, and a reasonable --delay.

  • Wallet safety concerns

    • Encrypt your wallet (recommended) and never share/export the private key unless you fully understand the risk.

Security: Protect Your Wallet

Wallet file location:

  • ~/.apechurch/wallet.json

Critical rules:

  • Never share your private key

  • Never paste it into prompts or third-party tools

  • Consider encrypting your wallet:

Updates

Last updated