controller-cli
0
总安装量
1
周安装量
安装命令
npx skills add https://github.com/cartridge-gg/controller-cli --skill controller-cli
Agent 安装分布
amp
1
opencode
1
cursor
1
kimi-cli
1
codex
1
github-copilot
1
Skill 文档
Controller CLI
Manage Cartridge Controller sessions and execute Starknet transactions through a secure human-in-the-loop workflow.
Prerequisites
Controller CLI must be installed:
curl -fsSL https://raw.githubusercontent.com/cartridge-gg/controller-cli/main/install.sh | bash
Session Workflow
Sessions use keypair-based auth where humans authorize specific contracts/methods via browser, then the agent executes transactions within those constraints.
- Check status â
controller status --json - Generate keypair (if needed) â
controller generate --json - Create policy file â Define allowed contracts and methods
- Register session â
controller register --file policy.json --json(user must authorize via browser URL) - Execute transactions â
controller execute <contract> <entrypoint> <calldata> --json
Commands
Status & Setup
controller status --json # Check session status and expiration
controller generate --json # Generate new session keypair
controller clear --yes # Clear all session data
Register Session
controller register --file policy.json --json
Outputs an authorization URL. Display it to the user and wait â the command polls for up to 6 minutes until the user authorizes in their browser.
Execute Transaction
Single call (positional args):
controller execute <contract> <entrypoint> <calldata> [--wait] [--timeout <secs>] --json
Multiple calls from file:
controller execute --file calls.json [--wait] --json
Read-Only Call (no session required)
controller call <contract> <entrypoint> <calldata> --chain-id SN_SEPOLIA --json
controller call --file calls.json --chain-id SN_SEPOLIA --json
Transaction Status
controller transaction <hash> --chain-id SN_SEPOLIA [--wait] --json
Username/Address Lookup
controller lookup --usernames shinobi,sensei --json
controller lookup --addresses 0x123...,0x456... --json
Calldata Format
- Values are comma-separated, hex with
0xprefix by default - Decimal values: use
u256:100prefix for automatic u256 encoding - String values: use
str:helloprefix for automatic felt encoding - U256 manual encoding: split into low,high â e.g., 100 tokens =
0x64,0x0
Policy File Format
See references/policy-examples.md for complete examples.
{
"contracts": {
"<contract_address>": {
"name": "Contract Name",
"methods": [
{ "name": "transfer", "entrypoint": "transfer", "description": "Transfer tokens" }
]
}
}
}
Multi-Call File Format
{
"calls": [
{
"contractAddress": "<contract_address>",
"entrypoint": "transfer",
"calldata": ["0xRECIPIENT", "0x64", "0x0"]
}
]
}
Common Contracts (Sepolia)
| Token | Address |
|---|---|
| ETH | 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 |
| STRK | 0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d |
Error Handling
| Error | Cause | Fix |
|---|---|---|
| NoSession | No keypair found | Run controller generate |
| SessionExpired | Session expired | Run controller register --file policy.json |
| ManualExecutionRequired | No authorized session | Register session with appropriate policies |
| PolicyViolation | Transaction not in allowed policies | Register new session with expanded policies |
Important Notes
- Always use
--jsonflag for machine-readable output - Sessions expire â always check status before transactions
- Human authorization is required for all sessions (cannot be bypassed)
- Sepolia transactions are automatically subsidized (no gas needed)
- Contract addresses must be 32-byte hex with
0xprefix