controller-cli
Skill80 starsChanged 7 months agoMITView on GitHub
Guidance for installing and operating the Cartridge Controller CLI (`controller`) to create human-approved sessions and execute Starknet transactions with JSON output, explicit network selection, scoped policies, paymaster control, and error recovery.
- Pipes a download into a shell
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- website/CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- starknet-agentic-skillsSkill
- account-abstractionSkill
- cairo-auditorSkill
- cairo-contract-authoringSkill
- cairo-deploySkill
- cairo-optimizationSkill
- cairo-testingSkill
- huginn-onboardSkill
- snip-36Skill
- starknet-anonymous-walletSkill
- starknet-defiSkill
- starknet-identitySkill
- starknet-jsSkill
- starknet-mini-paySkill
- starknet-network-factsSkill
- starknet-tongoSkill
- starknet-walletSkill
- starkzap-sdkSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Use this skill when you need to run the Cartridge Controller CLI (controller-cli) to create a scoped session (human-approved) and then …
- Very specific: line 44
Always pass --json and treat outputs as JSON.
- Distinctive: line 45
Always be explicit about network.
- Distinctive: line 49
Use least-privilege policies only.
- Very specific: line 76
If .status == "error", prints error_code, message, recovery_hint and exits non-zero.
- Distinctive: line 117
Ask the user to open it and approve.
- Distinctive: line 163
Always be explicit about network.
- Distinctive: line 177
If network is ambiguous:
- Distinctive: line 183
Default behavior uses the paymaster (free execution).
- Very specific: line 213
Always branch on error_code and follow recovery_hint.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cartridge Controller CLI
Use this skill when you need to run the Cartridge Controller CLI (controller-cli) to create a scoped session (human-approved) and then execute Starknet transactions via that session.
When to Use
- Operating Cartridge Controller sessions with explicit network and least-privilege policies.
- Running
controllerorcontroller_safe.pyfor human-approved Starknet transactions.
When NOT to Use
- General Starknet scripting that does not rely on Cartridge Controller.
- Contract authoring, testing, deployment, or security audit workflows.
Related modules: skills catalog.
Non-Negotiable Rules
- Always pass
--jsonand treat outputs as JSON. - Always be explicit about network. Never rely on defaults:
--chain-id SN_MAIN|SN_SEPOLIA, or--rpc-url <explicit url>.
controller registerrequires human browser authorization. Do not automate/bypass it.- Use least-privilege policies only. Do not add token transfer permissions unless explicitly requested.
- Transaction links: use Voyager only:
- Mainnet:
https://voyager.online/tx/0x... - Sepolia:
https://sepolia.voyager.online/tx/0x...
- Mainnet:
Quick Start
curl -fsSL https://raw.githubusercontent.com/cartridge-gg/controller-cli/main/install.sh | bash
export PATH="$PATH:$HOME/.local/bin"
controller --versionSafer Wrapper (Recommended)
This skill includes a small wrapper that enforces the rules above and normalizes output:
python3 scripts/controller_safe.py status
python3 scripts/controller_safe.py register --preset loot-survivor --chain-id SN_MAIN
python3 scripts/controller_safe.py execute 0xCONTRACT entrypoint 0xCALLDATA --rpc-url https://api.cartridge.gg/x/starknet/sepoliaBehavior:
- Adds
--jsonif missing. - Refuses to run
call|execute|register|transactionwithout--chain-idor--rpc-url. - Parses stdout as JSON.
- If
.status == "error", printserror_code,message,recovery_hintand exits non-zero.
Deterministic Workflow
1) Generate Keypair
controller generate --jsonThe private key is stored locally (typically ~/.config/controller-cli/).
2) Check Session Status
controller status --jsonCommon states:
no_session(no keypair)keypair_only(needs registration)active(registered and not expired)
3) Register Session (Human Approval Required)
Requirement: a human must approve in a browser.
Option A (preferred): preset policies:
controller register --preset loot-survivor --chain-id SN_MAIN --jsonOption B: least-privilege policy file:
controller register --file policy.json --rpc-url https://api.cartridge.gg/x/starknet/sepolia --jsonAuthorization output includes short_url and/or authorization_url:
- Display
short_urlif present; otherwise displayauthorization_url. - Ask the user to open it and approve.
- The CLI blocks until approved or timeout (typically ~6 minutes).
4) Execute Transaction
Single call (positional args: contract, entrypoint, calldata):
controller execute 0xCONTRACT transfer 0xRECIPIENT,0xAMOUNT_LOW,0xAMOUNT_HIGH \
--rpc-url https://api.cartridge.gg/x/starknet/sepolia \
--jsonMultiple calls from file:
controller execute --file calls.json --rpc-url https://api.cartridge.gg/x/starknet/sepolia --jsonOptional confirmation wait:
controller execute --file calls.json --rpc-url https://api.cartridge.gg/x/starknet/sepolia --wait --timeout 300 --json5) Read-Only Call (No Session Needed)
controller call 0xCONTRACT balance_of 0xADDRESS --chain-id SN_SEPOLIA --json6) Transaction Status
controller transaction 0xTX_HASH --chain-id SN_SEPOLIA --wait --timeout 300 --json7) Lookup Usernames / Addresses
controller lookup --usernames alice,bob --json
controller lookup --addresses 0x123...,0x456... --jsonNetwork Selection
Always be explicit about network.
Supported networks:
| Chain ID | RPC URL |
SN_MAIN | https://api.cartridge.gg/x/starknet/mainnet |
SN_SEPOLIA | https://api.cartridge.gg/x/starknet/sepolia |
Priority order:
--rpc-urlflag- Stored session RPC URL (from registration)
- Config default (lowest)
If network is ambiguous:
- Run
controller status --json - Match the session
chain_id, or ask the user
Paymaster Control
Default behavior uses the paymaster (free execution). If the paymaster is unavailable, the transaction fails (no silent fallback).
To self-pay with user funds:
controller execute ... --no-paymaster --jsonAmount Encoding (u256)
Many ERC20-style amounts are u256 split into (low, high) u128 limbs.
For values that fit in u128 (most cases): set high = 0x0.
Example calldata:
0xRECIPIENT,0x64,0x0
Error Handling
Errors are JSON:
{
"status": "error",
"error_code": "ErrorType",
"message": "...",
"recovery_hint": "..."
}Always branch on error_code and follow recovery_hint.
Common recoveries:
NoSession: runcontroller generate --jsonSessionExpired: re-runcontroller register ... --jsonManualExecutionRequired: policy does not authorize the call; tighten/adjust policy and re-registerCallbackTimeout: user did not approve quickly enough; re-runregisterand retry
Input Validation
Addresses must be 0x-prefixed hex.
python3 scripts/validate_hex_address.py 0xabc...Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

