Installation
Prerequisites
- Node.js 20.19.0 or higher — Check your version:
node --version
Package Managers
npm
npm install -g anchorspec@latest
pnpm
pnpm add -g anchorspec@latest
yarn
yarn global add anchorspec@latest
bun
bun add -g anchorspec@latest
Nix
Run AnchorSpec directly without installation:
nix run github:AnchorSpec/AnchorSpec -- init
Or install to your profile:
nix profile install github:AnchorSpec/AnchorSpec
Or add to your development environment in flake.nix:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
anchorspec.url = "github:AnchorSpec/AnchorSpec";
};
outputs = { nixpkgs, anchorspec, ... }: {
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
buildInputs = [ anchorspec.packages.x86_64-linux.default ];
};
};
}
Verify Installation
anchorspec --version
Next Steps
After installing, initialize AnchorSpec in your project:
cd your-project
anchorspec init
See Getting Started for a full walkthrough.