Anvil is a CLI tool that transpiles Anchor-based Solana programs to Pinocchio, native (solana-program), or Quasar Rust dialects, producing cargo-buildable projects from a single typed IR. Current stable version is 0.3.4, released with a weekly cadence. Key differentiators: deterministic emit with a validator, portability linting, CU benchmarking, and a migration safety analysis tool. Requires Bun >=1.0.0 and depends on litesvm, @solana/web3.js, and @noble/hashes as peer dependencies. Supports three targets with regression gates (21+ MUST_PASS for pinocchio and native).
npm install anvil-solNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows installation, transpilation to Pinocchio, parsing to IR, portability linting, CU benchmarking, snapshotting, diffing, and migration analysis.
Install Bun from https://bun.sh before using anvil-sol.
Use import syntax or run via Bun which supports ESM.
Use pinocchio or native targets for production.
Upgrade to >=0.3.0 for migration support.
Run 'curl -fsSL https://bun.sh/install | bash' to install Bun.
Install globally with 'bun install -g anvil-sol' or run with 'bunx anvil-sol'.
Use named imports like '{ compile }' instead of default import.