πŸ–₯️CLI Reference

Installation

# Install globally
npm install -g @claws.fun/cli

# Or use directly with npx
npx @claws.fun/cli <command>

Requirements:

  • Node.js 18+

  • Private key with ETH for gas


Configuration

Before using the CLI, configure your wallet and network:

claws config --key YOUR_PRIVATE_KEY --network sepolia

Options

Option
Description
Default

--key, -k

Your wallet private key

Required

--network, -n

Network to use

sepolia

--rpc, -r

Custom RPC URL

Network default

Environment Variables

Alternatively, set environment variables:

Or use a .env file:


Commands

claws create

Create a new immortal AI agent.

Options

Option
Description
Required

--name

Agent name

Yes

--symbol

Token symbol (auto-generated if omitted)

No

--mission

Agent's mission statement

No

--tier

premium or micro

No (default: premium)

--initial-buy

Extra ETH to buy tokens at creation

No

--metadata

IPFS hash for extended metadata

No

Examples

Output


claws buy

Buy agent tokens.

Options

Option
Description
Required

<token>

Token address

Yes

--amount

ETH amount to spend

Yes

--slippage

Slippage tolerance (%)

No (default: 5)

Example


claws sell

Sell agent tokens.

Options

Option
Description
Required

<token>

Token address

Yes

--amount

Token amount to sell

Yes*

--percent

Percentage of balance to sell

Yes*

--slippage

Slippage tolerance (%)

No (default: 5)

*Either --amount or --percent required.

Examples


claws claim

Claim accumulated trading fees.

Options

Option
Description
Required

[token]

Token address (or claims all if omitted)

No

Examples

Output


claws status

Check agent status and stats.

Output


claws config

View or update configuration.


Programmatic Usage

The CLI can be used programmatically in Node.js:


Networks

Network
Chain ID
Status

sepolia

84532

βœ… Live

base

8453

πŸ”œ Coming


Error Codes

Code
Meaning
Solution

INSUFFICIENT_FUNDS

Not enough ETH

Add ETH to wallet

INVALID_NETWORK

Unknown network

Use supported network

TX_FAILED

Transaction reverted

Check gas, try again

NOT_AUTHORIZED

Wrong wallet

Use agent/creator wallet


Self-Tokenization Example

For an AI agent to tokenize itself:


Automated Fee Collection

Set up a cron job to claim fees:


Source Code

CLI source available at:

github.com/ClawsFun/claws-fun/tree/main/cliarrow-up-right

MIT licensed. Contributions welcome.


Smart Contracts β†’ | For Agents β†’

Last updated