Installation
System requirements
Section titled “System requirements”- Node.js 20+ or Bun v1.2+
- macOS or Linux (Windows not yet supported)
- Bun and a source checkout for SQLite persistence (
--cache): it needs@refract-org/persistence, which usesbun:sqliteand is not published to npm. Analysis-only workflows work with Node.js.
Zero install
Section titled “Zero install”No download needed — runs directly from npm:
npx @refract-org/cli analyze "Earth" --depth briefWith bun (if installed):
bunx @refract-org/cli analyze "Earth" --depth briefLocal install
Section titled “Local install”# with bunbun add -g @refract-org/cli
# with npmnpm install -g @refract-org/cliThen use the refract command directly (or wikihistory as an alias):
refract analyze "Earth" --depth briefFrom source
Section titled “From source”git clone https://github.com/refract-org/refract.gitcd refractbun installbun run buildnode packages/cli/dist/src/cli.js --versionRun the CLI as node packages/cli/dist/src/cli.js <command>, or put it on your
PATH with bun link inside packages/cli.
Docker
Section titled “Docker”Build the image from a checkout. Its entry point is the CLI:
git clone https://github.com/refract-org/refract.gitcd refractdocker build -t refract .docker run --rm refract analyze "Bitcoin" --depth brief --jsonVerify installation
Section titled “Verify installation”refract --versionA version number means the CLI started. The CLI
before it on npm, 0.5.7, does not start and fails here with SyntaxError: The requested module '@refract-org/analyzers' does not provide an export named …;
npm install -g @refract-org/cli replaces it.