CLI Reference
Complete reference for the CLAWING command-line interface. The CLI provides full control over the mining process, from initialization to automated mining.
Installation
git clone https://github.com/Cliai21/clawing.git
cd clawing
npm installAll commands are run via npx claw <command>.
Commands
claw init
claw initInitialize the miner configuration. Creates a .env file with the required template.
npx claw initBehavior:
Creates
.envfrom the default template if it doesn't existPrompts for required values (private key, AI API key) in interactive mode
Sets secure file permissions (
chmod 600 .env)Validates the Ethereum RPC connection
Options:
--non-interactive
Skip prompts; use defaults and env vars
--rpc <url>
Set a custom Ethereum RPC URL
--model <name>
Override the default AI model
Example:
claw status
claw statusDisplay the current mining status for your configured wallet.
Output:
Options:
--json
Output in JSON format
--no-oracle
Skip Oracle health check
Example:
claw mine
claw mineExecute a single mining claim. Generates AI content, obtains an Oracle attestation, and submits the on-chain transaction.
Process:
Check cooldown status — abort if not ready
Check epoch claim limit — abort if 14 claims reached
Request nonce from Oracle
Generate AI content using the configured model
Submit content to Oracle for attestation
Receive signed attestation
Estimate gas and submit on-chain transaction
Wait for transaction confirmation
Report minted $CLAW amount
Output:
Options:
--dry-run
Simulate the mining process without submitting on-chain
--gas-limit <gwei>
Set maximum gas price (overrides MAX_GAS_GWEI)
--verbose
Show detailed logging including API responses
--no-wait
Submit transaction without waiting for confirmation
Example:
claw auto
claw autoStart automated mining mode. Continuously monitors cooldown and claims when ready.
Behavior:
Polls cooldown status at regular intervals
Automatically initiates a claim when the cooldown has elapsed
Respects the 14-claim epoch limit
Logs all activity to
./logs/mining.logGracefully handles errors and retries
Output:
Options:
--poll-interval <sec>
Polling interval in seconds (default: 60)
--max-gas <gwei>
Maximum gas price — skip claim if gas exceeds this
--log-file <path>
Custom log file path
--quiet
Minimal console output
Example:
Environment Variables
All configuration is managed via the .env file or system environment variables. Environment variables take precedence over .env values.
Required Variables
PRIVATE_KEY
Ethereum wallet private key
0xabcd...1234
AI_API_KEY
API key for the mining AI model
xai-...
Optional Variables
ETH_RPC_URL
Public endpoint
Ethereum RPC provider URL
ORACLE_URL
https://oracle.minewithclaw.com
Oracle server URL
AI_MODEL
grok-4.1-fast
AI model identifier
GAS_STRATEGY
auto
Gas pricing: auto, fast, standard, slow
MAX_GAS_GWEI
50
Maximum gas price in gwei
LOG_LEVEL
info
Logging verbosity: debug, info, warn, error
LOG_FILE
./logs/mining.log
Log file path
POLL_INTERVAL
60
Auto-mine polling interval (seconds)
Gas Strategies
auto
Use the provider's suggested gas price
fast
Priority fee for faster confirmation (~15 seconds)
standard
Normal fee for typical confirmation (~30 seconds)
slow
Minimum fee; may take several minutes
Exit Codes
0
Success
1
General error
2
Configuration error (missing env vars)
3
Cooldown not met
4
Epoch claim limit reached
5
Oracle error
6
On-chain transaction failed
7
Insufficient ETH for gas
8
AI API error
Logging
All mining activity is logged to ./logs/mining.log by default. Log entries include:
Configure log level with the LOG_LEVEL environment variable:
debug
Everything including API payloads
info
Claims, rewards, errors
warn
Warnings and errors only
error
Errors only
Scripting Examples
Cron Job (Mine Every 12 Hours)
Check Status from Script
Monitor with Watch
Next Steps
Installation — Full setup guide
Quick Start — Get started quickly
Oracle API — API endpoints the CLI uses
Architecture — System design overview
Last updated