Skip to content

Installation

Hacksmith CLI can be installed in multiple ways depending on your needs and environment.

The fastest way to install Hacksmith without any dependencies:

Terminal window
curl -fsSL https://raw.githubusercontent.com/saif-shines/hacksmith/main/scripts/install.sh | bash

This downloads and installs a standalone binary for your platform (macOS, Linux, or Windows).

  1. Detects your operating system and CPU architecture
  2. Downloads the appropriate binary from GitHub Releases
  3. Installs to ~/.local/bin/hacksmith
  4. Makes the binary executable
  • macOS: Apple Silicon (ARM64), Intel (x64)
  • Linux: x64, ARM64
  • Windows: x64

By default, the installer uses ~/.local/bin. To install elsewhere:

Terminal window
INSTALL_DIR=/usr/local/bin curl -fsSL https://raw.githubusercontent.com/saif-shines/hacksmith/main/scripts/install.sh | bash

If ~/.local/bin is not in your PATH, add this to your shell profile (~/.bashrc, ~/.zshrc, etc.):

Terminal window
export PATH="$PATH:$HOME/.local/bin"

Then reload your shell:

Terminal window
source ~/.bashrc # or ~/.zshrc

Run Hacksmith without installing it permanently:

Terminal window
npx hacksmith plan -b <blueprint-url>

Pros:

  • No installation needed
  • Always uses latest version
  • Quick for one-off usage

Cons:

  • Requires Node.js 18+
  • Downloads package each time (or uses npm cache)
  • Slightly slower startup

Install globally for persistent use:

Terminal window
npm install -g hacksmith

Or with yarn:

Terminal window
yarn global add hacksmith

Or with pnpm:

Terminal window
pnpm add -g hacksmith

Pros:

  • Integrates with Node.js ecosystem
  • Easy to update (npm update -g hacksmith)
  • Familiar for JavaScript developers

Cons:

  • Requires Node.js 18+
  • Slower startup than binary
  • Larger installation size

Download binaries directly from GitHub Releases:

  1. Visit https://github.com/saif-shines/hacksmith/releases
  2. Download the binary for your platform:
    • macOS ARM64: hacksmith-darwin-arm64
    • macOS Intel: hacksmith-darwin-x64
    • Linux x64: hacksmith-linux-x64
    • Linux ARM64: hacksmith-linux-arm64
    • Windows: hacksmith-windows-x64.exe
  3. Move to a directory in your PATH:
Terminal window
# macOS/Linux
mv hacksmith-darwin-arm64 /usr/local/bin/hacksmith
chmod +x /usr/local/bin/hacksmith
# Windows (PowerShell as Administrator)
Move-Item hacksmith-windows-x64.exe C:\Windows\System32\hacksmith.exe

For development or custom builds:

Terminal window
# Clone the repository
git clone https://github.com/saif-shines/hacksmith.git
cd hacksmith
# Install dependencies
pnpm install
# Build the CLI
pnpm cli:build
# Link globally
pnpm cli:link

Now you can run hacksmith from anywhere.

Compile your own binary:

Terminal window
# Build for your platform
cd packages/hacksmith
bun build ./src/run.ts --compile --outfile hacksmith
# Move to PATH
mv hacksmith /usr/local/bin/

Build binaries for all platforms:

Terminal window
pnpm build:binaries

Binaries will be in dist/binaries/.

After installation, verify Hacksmith is available:

Terminal window
hacksmith --version

You should see the version number, for example:

0.0.x

Re-run the install script:

Terminal window
curl -fsSL https://raw.githubusercontent.com/saif-shines/hacksmith/main/scripts/install.sh | bash

Or specify a version:

Terminal window
VERSION=v0.0.7 curl -fsSL https://raw.githubusercontent.com/saif-shines/hacksmith/main/scripts/install.sh | bash
Terminal window
npm update -g hacksmith
Terminal window
rm ~/.local/bin/hacksmith
# or
rm /usr/local/bin/hacksmith
Terminal window
npm uninstall -g hacksmith
Terminal window
pnpm cli:unlink

Problem: hacksmith: command not found

Solutions:

  1. Check if binary exists:
Terminal window
ls -la ~/.local/bin/hacksmith
  1. Add to PATH:
Terminal window
export PATH="$PATH:$HOME/.local/bin"
  1. Verify PATH includes installation directory:
Terminal window
echo $PATH

Problem: Permission denied when running hacksmith

Solution: Make the binary executable:

Terminal window
chmod +x ~/.local/bin/hacksmith

Problem: Install script fails to download binary

Solutions:

  1. Check internet connection
  2. Verify GitHub is accessible
  3. Try manual download from https://github.com/saif-shines/hacksmith/releases
  4. Check if your platform is supported

Problem: Binary doesn’t run (e.g., ARM binary on x64 machine)

Solution: Download the correct binary for your platform:

Terminal window
# Check your architecture
uname -m
# x86_64 or amd64 → use x64 binary
# arm64 or aarch64 → use arm64 binary

Problem: Error: Requires Node.js >=18

Solutions:

  1. Update Node.js:
Terminal window
# Using nvm
nvm install 18
nvm use 18
# Using Homebrew (macOS)
brew upgrade node
  1. Or use the standalone binary (no Node.js required):
Terminal window
curl -fsSL https://raw.githubusercontent.com/saif-shines/hacksmith/main/scripts/install.sh | bash
MethodNode.js RequiredSizeStartup SpeedAuto-updates
Binary (curl)No~50MBFastManual
npxYes (18+)~20MBMediumAutomatic
npm globalYes (18+)~20MBMediumManual
From sourceYes (18+)~20MBMediumManual
  • For end users: Use the curl install script (no dependencies)
  • For JavaScript developers: Use npm/npx (familiar workflow)
  • For contributors: Install from source (easy development)
  • For CI/CD: Use npx (no global installation needed)
  • Quick Start Guide: /get-started
  • Create Your First Blueprint: /get-started/author-blueprint
  • Command Reference: /handbooks/commands
  • Testing Releases: /handbooks/testing-releases
  • Contributing Guide: /handbooks/contribute
  • GitHub Repository: https://github.com/saif-shines/hacksmith