Skip to main content
New protocol version released: This page may contain outdated information.
The HAIP CLI can be installed and used in multiple ways. Choose the method that best fits your environment and requirements.

Prerequisites

Node.js

Version 20.0.0 or higher

npm

Version 9.0.0 or higher

Git

For cloning the repository
1

Clone the Repository

git clone https://github.com/haiprotocol/haip-cli.git cd haip-cli
2

Install Dependencies

bash npm install
3

Build the Project

bash npm run build
4

Verify Installation

bash node dist/index.js --help You should see the HAIP CLI banner and help information.

Optional: Install Globally

Method 2: From NPM

Available Now: The HAIP CLI is available on npm as @haip/cli.
npm version npm downloads License: MIT

Method 3: Docker

Docker: Docker images will be available on Docker Hub as haip/cli in the future.

Pull the Image

Run the Container

Development Setup

Prerequisites for Development

  • Node.js 20.0.0 or higher
  • npm 9.0.0 or higher
  • TypeScript 5.0.0 or higher
  • Git for version control

Development Installation

Development Mode

Verification

After installation, verify that the CLI is working correctly:

1. Check Version

Expected output:

2. Check System Information

Expected output:

3. Check Help System

You should see the ASCII art banner and complete command listing.

4. Test Commands

Configuration

Environment Variables

The CLI can be configured using environment variables:

Configuration File (Future Enhancement)

Create a configuration file for persistent settings:

Troubleshooting

Common Issues

Permission Denied

Node Version Issues

Build Errors

Test Failures

Getting Help

If you encounter issues:
  1. Check the logs - Run with verbose output: node dist/index.js --verbose
  2. Check Node.js version - Ensure you’re using Node.js 16+
  3. Check dependencies - Run npm install to ensure all dependencies are installed
  4. Check TypeScript - Run npx tsc --noEmit to check for type errors
  5. Check tests - Run npm test to ensure everything is working

Next Steps