@five-vm/cli
Version:
High-performance CLI for Five VM development with WebAssembly integration
65 lines (46 loc) • 1.98 kB
Markdown
# Five CLI (v1.2.2)
Ultra-fast CLI for the Five VM with local WASM execution, bytecode compilation, deployment, testing, and a growing library of ready-to-use templates.
## Install / Build
- Local build (from repo):
- `cd five-cli && npm install && npm run build`
- Run locally: `node dist/index.js help`
- Global link (optional):
- `cd five-cli && npm link`
- Then use `five` from your shell
## Core Commands
- Compile: `five compile src/contract.v -o build/contract.bin`
- Local WASM execute: `five execute build/contract.bin --local`
- Deploy (mainnet): `five deploy build/contract.bin --target mainnet`
- Execute on-chain: `five execute --script-account <ACCOUNT_ID> -f 0 --target mainnet`
- Donate: `five donate 1 --network mainnet` (or testnets)
## Templates
Generate starter contracts in Five DSL.
- Types: `vault`, `escrow`, `amm`, `token`, `nft`, `nft-globals`, `multisig`, `vesting`, `auction-english`, `staking`, `airdrop-merkle`, `system-lamports`, `interface`, `spl-token`.
### Quickstart (Token)
```
five template --type token -o templates
five compile templates/token.v -o build/token.bin
five execute build/token.bin --local # Local WASM execution
# Deploy (mainnet)
five deploy build/token.bin --target mainnet
five execute --script-account <ACCOUNT_ID> -f 0 --target mainnet
```
### Quickstart (AMM)
```
five template --type amm -o templates
five compile templates/amm.v -o build/amm.bin
five execute build/amm.bin --local
```
### Quickstart (NFT)
```
five template --type nft -o templates
five compile templates/nft.v -o build/nft.bin
five execute build/nft.bin --local
```
## Notes
- Inline template fallbacks in the CLI are synced with file templates and compile cleanly.
- Local WASM runs stop at system calls; use on-chain execution for CPI/system-program paths.
- Mainnet deployment requires a funded keypair and RPC endpoint.
## Support
- Donate: `five donate <amount>`
- Issues: https://github.com/five-vm/five-cli/issues