backed-cli is the command-line interface for the Backed protocol contracts defined in backend.
It resolves configuration from the active frontend deployment manifests, exposes the current protocol operations, and is intended to be used as a shell command named backed.
This CLI covers three contract areas:
factory: project creation, approval, metadata, operational status, and global configurationsale: sale status, commitments, claim/refund flows, and collateral approvalallowlist: executor target management
When you create a raise, the CLI also lets you configure a fund term lockup. Investors can claim shares right after a successful finalization, but they cannot redeem those shares back into collateral until the fund term has ended and the treasury has finalized settlement.
npm installnpm linkbacked --helpbacked network- Node.js
>= 24 - npm
- access to the target RPC endpoint
- a private key only for write operations
By default, the CLI reads deployment data from:
frontend/config/deployment.testnet.jsonfrontend/config/deployment.mainnet.json
Backend mirrors are also kept in:
backend/deployments/megaeth-testnet.jsonbackend/deployments/megaeth-mainnet.json
SafeModuleSetup:0x7b6EbB0ede8ac0224a176663e6c07Dece0a37010ContractAllowlist:0x54459A9431bD98c754180DEB32B067Cf31bDfF33AgentRaiseFactory:0x577be362178d20A3370722807d0294fA5D8A5a2AUSDM:0x9f5A17BD53310D012544966b8e3cF7863fc8F05f
SafeModuleSetup:0x54459A9431bD98c754180DEB32B067Cf31bDfF33ContractAllowlist:0x577be362178d20A3370722807d0294fA5D8A5a2AAgentRaiseFactory:0x45179eE92887e5770E42CD239644bc7b662673afUSDM:0xFAfDdbb3FC7688494971a79cc65DCa3EF82079E7
backed \
--network testnet \
--rpc-url https://example-rpc \
--factory 0x... \
--allowlist 0x... \
<command>The CLI automatically loads a local .env file before parsing commands.
BACKED_NETWORKBACKED_RPC_URLBACKED_FACTORYBACKED_ALLOWLISTBACKED_PRIVATE_KEYPRIVATE_KEY(BACKED_PRIVATE_KEYtakes precedence)
For write commands, set the key once in your shell instead of passing --private-key every time:
export BACKED_PRIVATE_KEY=0x...testnetmainnet
Example:
backed --network testnet networkThis section covers the most common tasks in the order you will usually need them.
Use this first to verify RPC, chain, contract addresses, and default collateral:
backed network
backed factory infobacked --network testnet factory create \
--agent-id 0 \
--name "Backed Demo" \
--description "Initial validation raise" \
--categories "defi,infra" \
--token-name BACKED \
--token-symbol BACKED \
--duration-minutes 60 \
--lockup-minutes 1440 \
--launch-in-minutes 5Notes:
--collateralis optional if the deployment file already defines a default collateral--launch-in-minutesis optional; default is0--lockup-minutesis optional; default is0
The sale cannot accept commitments until the project is approved:
backed --network testnet factory approve 0backed --network testnet factory project 0
backed --network testnet factory snapshot 0You must approve the sale contract before committing ERC-20 collateral:
backed --network testnet sale approve-collateral \
--project-id 0 \
100backed --network testnet sale commit \
--project-id 0 \
100The CLI checks allowance and token balance before sending the transaction.
backed --network testnet sale finalize --project-id 0Claim after a successful sale:
backed --network testnet sale claim --project-id 0claim transfers fund shares into the wallet. Those shares become redeemable for collateral only after the treasury unwinds and finalizes settlement at the end of the configured fund term.
Refund when the sale failed:
backed --network testnet sale refund --project-id 0Inspect the current admin:
backed allowlist infoAllow a target:
backed --network testnet allowlist add \
0x3333333333333333333333333333333333333333If you do not want the global command yet:
node ./src/bin/backed.ts --helpnpm run dev -- --help
npm run check
npm run buildCurrent behavior:
npm run devruns the CLI entrypoint directlynpm run checkperforms a smoke testnpm run buildvalidates the executable entrypoint in the current runtimefactory create --lockup-minutes <n>configures how long the fund term lasts after the raise ends before settlement and redemption can open
Show the resolved runtime configuration:
backed networkFactory summary:
backed factory infoGlobal configuration:
backed factory globalCollateral inspection:
backed factory collateral 0x9f5A17BD53310D012544966b8e3cF7863fc8F05fPaginated project list:
backed factory list --from 0 --limit 20Project details:
backed factory project 0Raise snapshot:
backed factory snapshot 0User commitment via factory:
backed factory commitment 0 0x1111111111111111111111111111111111111111Projects for an agent id:
backed factory agent-projects 0Approve:
backed factory approve 0Revoke:
backed factory revoke 0Update metadata:
backed factory update-metadata \
--project-id 0 \
--description "Updated description" \
--categories "defi,ai"Update status:
backed factory set-status \
--project-id 0 \
--status operating \
--status-note "Treasury live"Set collateral:
backed factory set-collateral \
0x9f5A17BD53310D012544966b8e3cF7863fc8F05f trueSet global config:
backed factory set-global \
--min-raise 100 \
--max-raise 100000 \
--platform-fee-bps 100 \
--platform-fee-recipient 0x1111111111111111111111111111111111111111 \
--min-duration-seconds 3600 \
--max-duration-seconds 2592000 \
--min-launch-delay-seconds 0 \
--max-launch-delay-seconds 604800Sale commands support either:
--sale <sale-address>--project-id <project-id>
Status:
backed sale status --project-id 0Claimable:
backed sale claimable --project-id 0 0x1111111111111111111111111111111111111111Refundable:
backed sale refundable --project-id 0 0x1111111111111111111111111111111111111111Commitment:
backed sale commitment --project-id 0 0x1111111111111111111111111111111111111111Approve collateral:
backed sale approve-collateral --project-id 0 100Commit:
backed sale commit --project-id 0 100Finalize:
backed sale finalize --project-id 0Claim:
backed sale claim --project-id 0Refund:
backed sale refund --project-id 0Emergency refund:
backed sale emergency-refund --project-id 0sale approve-collateral and sale commit accept human-readable amounts by default.
Example:
backed sale commit --project-id 0 100.5Use --raw to pass raw uint256 values:
backed sale commit --project-id 0 100500000 --rawAdmin:
backed allowlist infoCheck target:
backed allowlist is-allowed 0x3333333333333333333333333333333333333333Add target:
backed allowlist add 0x3333333333333333333333333333333333333333Remove target:
backed allowlist remove 0x3333333333333333333333333333333333333333Transfer admin:
backed allowlist transfer-admin 0x4444444444444444444444444444444444444444Run:
npm linkIf needed, verify that the npm global bin directory is in PATH.
Provide one of:
--private-keyBACKED_PRIVATE_KEYPRIVATE_KEY
Override the relevant values:
--rpc-url--factory--allowlist--sale
The deployment manifest is usually out of sync with the active contracts.
Recommended action:
- update
frontend/config/deployment.*.json - mirror the same values into
backend/deployments/*.json - or pass explicit addresses through CLI flags
Verify:
- selected network
- RPC reachability
- deployment RPC value
src/
bin/
backed.ts
cli/
help.ts
parser.ts
types.ts
commands/
allowlist.ts
factory.ts
network.ts
sale.ts
chain/
abis.ts
client.ts
contracts.ts
config/
runtime.ts
lib/
output.ts
utils.ts
types/
project.ts