@5ive-tech/cli
v1.0.39
Published
High-performance CLI for Five VM development with WebAssembly integration
Maintainers
Readme
5IVE CLI
CLI for building, testing, deploying, and executing 5ive DSL programs.
Mainnet Program ID
Program: 55555SyrYLzydvDMBhAL8uo6h4WETHTm81z8btf6nAVJ
Canonical program ID for the current release train. Use this program ID for production applications once mainnet rollout completes.
Install
npm install -g @5ive-tech/cli
5ive --versionOr run without global install:
npx @5ive-tech/cli --helpUpgrade
# global install
npm install -g @5ive-tech/cli@latest
5ive --version
# no global install
npx @5ive-tech/cli@latest --versionMonorepo/local source validation:
cd five-cli
npm run build:js
node ./dist/index.js --versionRelease history is tracked in CHANGELOG.md.
Quick Start
1) Initialize a project
5ive init my-program
cd my-program5ive init generates an AGENTS.md playbook in every new project so agents can immediately compile, test, deploy, and execute 5ive DSL programs with the same workflow as developers.
2) Compile to a .five artifact (recommended)
5ive buildThe .five artifact contains bytecode and ABI and is the best default for deployment and SDK integration.
3) Run locally
5ive execute build/main.five --local -f 04) Configure on-chain target
5ive config init
5ive config set --target devnet
5ive config set --keypair ~/.config/solana/id.json
5ive config set --program-id 55555SyrYLzydvDMBhAL8uo6h4WETHTm81z8btf6nAVJ --target devnet5) Deploy and execute on-chain
5ive deploy build/main.five --target devnet
5ive execute build/main.five --target devnet -f 0If you already have a deployed script account:
5ive execute --script-account <SCRIPT_ACCOUNT_PUBKEY> --target devnet -f 0Program ID Resolution
For on-chain commands (deploy, execute, namespace), program ID precedence is:
--program-idflagfive.toml[deploy].program_id5ive configstored value for current targetFIVE_PROGRAM_IDenvironment variable
If none are set, on-chain commands fail fast with a program ID setup error.
Standard Workflows
Project build flow
5ive build
5ive deploy build/main.five --project .
5ive execute build/main.five --project . -f 05ive build / --project use five.toml and the generated manifest to resolve artifacts.
Run tests
5ive test --sdk-runner
5ive test --filter "test_*" --verbose
5ive test --on-chain --target local
5ive test tests/ --on-chain --target devnet
5ive test tests/ --on-chain --target mainnet --allow-mainnet-tests --max-cost-sol 0.5Namespace operations
5ive namespace register @your-domain
5ive namespace bind @your-domain/program --script <SCRIPT_ACCOUNT_PUBKEY>
5ive namespace resolve @your-domain/programAdvanced Workflows (Optional)
Compile diagnostics and machine-readable metrics
5ive build \
--analyze \
--metrics-output build/compile-metrics.json \
--metrics-format json \
--error-format jsonProject-aware execution from five.toml context
5ive execute --project . -f 0
5ive execute --project . -f 0 --params params.json --target devnetDeploy large artifacts with chunk/optimization controls
5ive deploy build/main.five --target devnet --optimized --progress
5ive deploy build/main.five --target devnet --force-chunked --chunk-size 900
5ive deploy build/main.five --target devnet --dry-run --format jsonAdvanced test modes
5ive test --sdk-runner --format json
5ive test test-scripts/ --on-chain --target devnet --batch --analyze-costs
5ive test tests/ --on-chain --target mainnet --allow-mainnet-tests --max-cost-sol 0.5
5ive test --watch --parallel 4Namespace manager and lockfile modes
# On-chain manager flow
5ive namespace register @acme --manager <MANAGER_SCRIPT_ACCOUNT>
5ive namespace bind @acme/payments --script <SCRIPT_ACCOUNT_PUBKEY> --manager <MANAGER_SCRIPT_ACCOUNT>
5ive namespace set-price '$' 10000000000 --manager <MANAGER_SCRIPT_ACCOUNT>
5ive namespace get-price '$' --manager <MANAGER_SCRIPT_ACCOUNT>
# Local lockfile-only flow (no manager RPC)
5ive namespace resolve @acme/payments --localNamespace manager default symbol prices:
@: 1 SOL (1_000_000_000lamports)!: 2 SOL (2_000_000_000lamports)#: 1.5 SOL (1_500_000_000lamports)$: 10 SOL (10_000_000_000lamports)%: 1.25 SOL (1_250_000_000lamports)
Migration note: existing deployed namespace manager instances keep their current stored values. To migrate $ pricing, run:
5ive namespace set-price '$' 10000000000 --manager <MANAGER_SCRIPT_ACCOUNT>Config layering and explicit RPC overrides
5ive config set --rpc-url https://api.devnet.solana.com --target devnet
5ive config set --show-config true
5ive deploy build/main.five --target devnet --network https://your-rpc.example.comArtifact and SDK Interop
@5ive-tech/cli and @5ive-tech/sdk work best with .five artifacts.
Import and Interface Syntax
Current authored syntax prefers Rust-like imports and explicit interface paths:
use std::interfaces::spl_token;
use std::interfaces::spl_token::SPLToken;
pub mint_tokens(mint: account, destination: account, authority: account @signer, amount: u64) {
spl_token::SPLToken::mint_to(mint, destination, authority, amount);
SPLToken::transfer(mint, destination, authority, amount);
}Prefer InterfaceName::method(...) or module::InterfaceName::method(...) over the older implicit module::method(...) style.
Common Commands
5ive help <command>
5ive help compile
5ive help deploy
5ive help execute
5ive help configTroubleshooting
Global 5ive is stale vs monorepo source
# Run local CLI dist directly from this repository
node ./dist/index.js --version
node ./dist/index.js init my-programProgram ID required or owner/program mismatch
5ive config set --program-id 55555SyrYLzydvDMBhAL8uo6h4WETHTm81z8btf6nAVJ --target devnet
# or
5ive deploy build/main.five --program-id 55555SyrYLzydvDMBhAL8uo6h4WETHTm81z8btf6nAVJ --target devnetKeypair file not found
5ive config set --keypair ~/.config/solana/id.jsonCommand-specific help
5ive build --help
5ive execute --help
5ive config --help