Skip to content

Rawi (راوي) Documentation | Getting Started Building and installing the rawi CLI from source

Building and Installing Rawi CLI from Source

Section titled “Building and Installing Rawi CLI from Source”

This guide describes how to build and install the latest release of the Rawi CLI from source on supported operating systems.


  • You want to contribute to Rawi or test unreleased features.
  • You need to patch or customize the CLI.
  • You are packaging Rawi for a distribution.
  • You require a build for a non-standard environment.

All commands are assumed to run from the root of the Rawi source directory.

  1. Setup Requirements

    • Node.js: v18.0.0 or higher
    • pnpm (recommended), or npm/yarn
    • Git (to clone the repository)
  2. Clone the Repository

    Terminal window
    git clone https://github.com/withrawi/rawi.git
    cd rawi
  3. Install Dependencies

    Terminal window
    pnpm install
  4. Build the CLI

    Terminal window
    pnpm build
  5. (Optional) Run Tests

    Terminal window
    pnpm test
  6. Link the CLI Locally This makes the rawi command available globally on your system for development and testing.

    Terminal window
    pnpm link --global
  7. Verify Installation

    Terminal window
    rawi --version
    rawi info

If you want to install Rawi in a custom location or as part of a CI/CD pipeline, you can use the following:

Terminal window
# Install dependencies and build
pnpm install && pnpm build
# Use npx to run without global install
npx rawi ask "Hello from source build!"

Terminal window
# Clone, build, and link in one go
git clone https://github.com/withrawi/rawi.git
cd rawi
pnpm install
pnpm build
pnpm link --global
# Now use Rawi anywhere
rawi ask "What is AstroJS Starlight?"

  • If you encounter issues, see Troubleshooting Guide.
  • For permission errors, try running with sudo or adjust your npm global directory.
  • For dependency issues, ensure you are using Node.js 18+ and a supported package manager.