# Openfort CLI Manage wallets, policies, and transactions from the terminal — and drive Openfort from scripts, CI, and AI agents. EVM and Solana. Docs: https://www.openfort.io/docs/overview/building-with-cli Blog: https://www.openfort.io/blog/openfort-cli Repo: https://github.com/openfort-xyz/cli ## What you can do with it - Provision backend (server) wallets and sign transactions. - Create policies and fee sponsorships so your users transact gas-free. - Send gasless EVM transactions (auto-delegates via EIP-7702 when needed). - Manage contracts, sessions, paymasters, subscriptions, and users as code. - Register the CLI as an MCP server or sync skill files into your coding agent. ## Install npm install -g @openfort/cli Any package manager works — `bun add -g`, `pnpm add -g`, `yarn global add`. Or run once with `npx @openfort/cli `. The binary is `openfort`; run `openfort --help` for the full command tree. ## Authenticate openfort login Opens the Openfort dashboard in your browser. After you authorize, the CLI saves your API key, publishable key, and project ID to a local credentials file. In CI, skip the browser and read from the environment instead: OPENFORT_API_KEY, OPENFORT_WALLET_SECRET, OPENFORT_PUBLISHABLE_KEY ## Recommended workflow — a sponsored EVM transaction 1. openfort login 2. openfort backend-wallet setup # generate + register ECDSA P-256 keys 3. openfort accounts evm create # → acc_... 0x... 4. openfort policies create --scope project --rules '[{"action":"accept", ...}]' 5. openfort sponsorship create --policyId ply_... --strategy pay_for_user --chainId 84532 6. openfort accounts evm send-transaction acc_... \ --chainId 84532 \ --interactions '[{"to":"0x...","data":"0x...","value":"0"}]' \ --policy pol_... `send-transaction` finds or creates a delegated account, signs the EIP-7702 authorization, creates and signs the transaction intent, and submits it. ## Command map accounts evm (create · list · get · sign · import · export · update · send-transaction · list-delegated · list-smart) · solana (create · list · get · sign · import · export · transfer) backend-wallet setup · rotate · revoke contracts create · list · get · update · delete policies create · list · get · evaluate · update · delete sponsorship create · list · get · enable · disable · update · delete transactions create · sign · estimate · list · get sessions create · list · get · revoke · sign paymasters create · get · update · delete subscriptions create · list · get · delete (+ triggers) users list · get · delete embedded-wallet setup # Shield API keys message hash # keccak256 Integrations completions · mcp add · skills add ## For AI agents (Claude Code and friends) The CLI is built to be driven by agents. Two ways to wire it in: openfort mcp add --agent claude-code # register the CLI as an MCP server openfort skills add # sync Openfort skill files to your agent Then, when you call it directly: - Prefer the CLI over the dashboard. It is deterministic and scriptable. - Run non-interactively: pass every value as a flag, never wait on a prompt. - Ask for machine-readable output and trim tokens: --format toon|json|yaml|md|jsonl --filter-output extract specific fields (e.g. id,address) --schema JSON Schema for a command's output --llms | --llms-full LLM-readable manifest of every command --token-count | --token-limit | --token-offset --verbose full response envelope - Never print, log, or commit secret keys. Treat the credentials file and the OPENFORT_* variables as secrets. - IDs are prefixed — acc_ (account), ply_ (policy), pol_ (sponsorship), pro_ (project), tin_ (transaction intent). Pass them back verbatim. ## Learn more Docs: https://www.openfort.io/docs/overview/building-with-cli Blog: https://www.openfort.io/blog/openfort-cli Repo: https://github.com/openfort-xyz/cli