Skip to content

CLI Reference

dev-mondoshawan edited this page Apr 24, 2026 · 1 revision

CLI Reference

Complete reference for every ScarpShield CLI command, option, and example.


Global Usage

python main.py <command> [options]

Get help at any time:

python main.py --help
python main.py <command> --help

Contract Commands

add <address>

Add a smart contract address to the watchlist.

Option Short Type Default Description
--label -l string "" Friendly name for the contract
--chain -c string ethereum Blockchain network

Supported chains: ethereum, polygon, bsc, arbitrum, base

Example:

python main.py add 0xdAC17F958D2ee523a2206206994597C13D831ec7 --label "USDT" --chain ethereum

Output:

[+] Added USDT on ethereum

The address is automatically validated and EIP-55 checksummed.


remove <address>

Remove a contract from the watchlist by address (case-insensitive).

Example:

python main.py remove 0xdAC17F958D2ee523a2206206994597C13D831ec7

Output:

[-] Removed 0xdAC17F958D2ee523a2206206994597C13D831ec7

list

Display all monitored contracts in a numbered list.

Example:

python main.py list

Output:

==================================================
  ScarpShield v1.0.1
  Powered by CounterScarp.io
==================================================
  1. [ethereum] USDT - 0xdAC17F958D2ee523a2206206994597C13D831ec7
  2. [polygon] QuickSwap - 0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff

Alert Commands

alerts

Show the current status of all alert channels.

Example:

python main.py alerts

Output:

==================================================
  ScarpShield v1.0.1
  Powered by CounterScarp.io
==================================================
  Alert Channels:
    console      [ON]
    email        [OFF]
    discord      [OFF]
    slack        [OFF]
    telegram     [OFF]

enable-alert <channel>

Enable a specific alert channel.

Valid channels: console, email, discord, slack, telegram

Example:

python main.py enable-alert discord

Output:

[+] discord alerts enabled

disable-alert <channel>

Disable a specific alert channel.

Valid channels: console, email, discord, slack, telegram

Example:

python main.py disable-alert email

Output:

[-] email alerts disabled

setup-email

Interactively configure SMTP email alerts. You will be prompted for each setting.

Prompt Default Notes
SMTP host e.g., smtp.gmail.com
SMTP port 587 Common ports: 587 (TLS), 465 (SSL), 25
SMTP user Usually your email address
SMTP password Hidden input; use app passwords for Gmail
Recipient email(s) Comma-separated for multiple recipients

Example session:

python main.py setup-email
SMTP host: smtp.gmail.com
SMTP port [587]: 587
SMTP user: alerts@mydomain.com
SMTP password:
Recipient email(s), comma-separated: admin@mydomain.com,ops@mydomain.com
[+] Email alerts configured -> admin@mydomain.com,ops@mydomain.com

Note: You can also set credentials via .env variables (SCARPSHIELD_SMTP_*) for better security.


setup-discord

Interactively configure a Discord webhook for alerts.

Example session:

python main.py setup-discord
Discord webhook URL: https://discord.com/api/webhooks/123456789/abcdef...
[+] Discord alerts configured

Create a webhook in your Discord server: Server Settings → Integrations → Webhooks.


setup-slack

Interactively configure a Slack incoming webhook for alerts.

Example session:

python main.py setup-slack
Slack webhook URL: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
[+] Slack alerts configured

Create a webhook in your Slack workspace: Apps → Incoming Webhooks → Add to Slack.


setup-telegram

Interactively configure Telegram bot alerts.

Prompt Description
Bot token From @BotFather
Chat ID Numeric ID of the chat or channel (e.g., -1001234567890)

Example session:

python main.py setup-telegram
Bot token: 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
Chat ID: -1001234567890
[+] Telegram alerts configured

Note: Telegram alerts are optional. This tool is completely separate from the CounterScarp.io Telegram community channel.


test-alerts

Send a test alert to every enabled channel to verify connectivity and credentials.

Example:

python main.py test-alerts

Output:

[+] Test alert sent to all enabled channels.

You should receive a test message on every channel you have enabled (console, email, Discord, Slack, Telegram).


Monitoring Commands

start

Start the monitoring loop. ScarpShield will poll the blockchain at the configured interval and dispatch alerts for any detected events.

Example:

python main.py start

Output:

==================================================
  ScarpShield v1.0.1
  Powered by CounterScarp.io
==================================================
Monitoring 2 contract(s) on ethereum, polygon...
(Press Ctrl+C to stop)

Press Ctrl+C to gracefully stop the monitor.


status

Show a summary of the current configuration.

Example:

python main.py status

Output:

==================================================
  ScarpShield v1.0.1
  Powered by CounterScarp.io
==================================================
  Contracts:  2
  Alerts:     console, discord
  Poll rate:  15s
  Chains:     ethereum, polygon

Config Commands

init

Generate a fresh config.json with default values. Safe to run — it will not overwrite an existing config without reloading it first.

Example:

python main.py init

Output:

[+] config.json created with defaults
    Edit it or use CLI commands to configure.

GUI Command

gui

Launch the ScarpShield web dashboard.

Option Short Type Default Description
--port -p int 8050 Port to bind the server
--host -h string 127.0.0.1 Host interface to bind
--no-browser flag False Do not open the browser automatically

Example — default launch:

python main.py gui

Output:

╔══════════════════════════════════════════╗
║       ScarpShield Web Dashboard          ║
║   THE OUTER WALL OF DEFENSE              ║
╠══════════════════════════════════════════╣
║   Running at: http://127.0.0.1:8050      ║
║   Press Ctrl+C to stop                   ║
╚══════════════════════════════════════════╝

Example — custom port, no browser:

python main.py gui --port 8080 --host 0.0.0.0 --no-browser

The dashboard features: real-time event feed (SSE), contract management, alert channel toggling, inline settings editing, and log browsing with JSON export.


Command Quick Reference

Command Purpose
add <address> Add a contract to the watchlist
remove <address> Remove a contract
list Show all monitored contracts
alerts Show alert channel status
enable-alert <channel> Turn on an alert channel
disable-alert <channel> Turn off an alert channel
setup-email Configure SMTP email
setup-discord Configure Discord webhook
setup-slack Configure Slack webhook
setup-telegram Configure Telegram bot
test-alerts Send test alert to all enabled channels
start Begin monitoring loop
status Show config summary
init Create default config.json
gui Launch web dashboard

Clone this wiki locally