Installation

This guide will help you install Azu CLI on your development machine. Azu CLI is distributed as a single binary and works on macOS, Linux, and Windows.

Prerequisites

Before installing Azu CLI, ensure you have the following prerequisites:

Crystal Language

Azu CLI requires Crystal 1.6.0 or higher.

macOS (using Homebrew):

brew install crystal

Ubuntu/Debian:

curl -fsSL https://packagecloud.io/84codes/crystal/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/84codes-crystal.gpg
echo "deb [signed-by=/usr/share/keyrings/84codes-crystal.gpg] https://packagecloud.io/84codes/crystal/ubuntu/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/84codes-crystal.list
sudo apt update
sudo apt install crystal

Arch Linux:

sudo pacman -S crystal

From Source:

git clone https://github.com/crystal-lang/crystal.git
cd crystal
make clean crystal

Database (Optional)

Azu applications typically use a database. Install one of the supported databases:

PostgreSQL (Recommended):

MySQL:

SQLite:

Installation Methods

This is the most reliable method and ensures you get the latest version.

  1. Clone the repository:

  2. Install dependencies:

  3. Build and install:

    This will:

    • Compile the binary in release mode

    • Install it to /usr/local/bin/azu (may require sudo)

    • Make it available system-wide

  4. Verify installation:

Method 2: Using Make (Alternative)

If you prefer to build manually:

  1. Clone and build:

  2. Install manually:

For development work where you want changes to be reflected immediately:

  1. Clone and build:

  2. Create symlink:

This creates a symlink from the built binary to /usr/local/bin/azu, so any changes you make to the source will be reflected immediately after rebuilding.

Method 4: Development Installation

For development or if you want to modify Azu CLI:

  1. Clone the repository:

  2. Install dependencies:

  3. Build in development mode:

  4. Add to PATH (optional):

Post-Installation Setup

1. Verify Installation

2. Configure Global Settings (Optional)

Create a global configuration file:

3. Set Up Database

If you're planning to use databases, ensure your database server is running:

PostgreSQL:

MySQL:

Troubleshooting

Common Issues

1. "azu: command not found"

Solution 1: Check if the binary is in your PATH:

Solution 2: Reinstall with proper permissions:

Solution 3: Add to PATH manually:

2. Permission Denied During Installation

3. Crystal Not Found

Ensure Crystal is properly installed and in your PATH:

4. Compilation Errors

Update your Crystal installation:

Clear shards cache and reinstall:

5. Database Connection Issues

Ensure your database service is running:

Getting Help

If you encounter issues during installation:

  1. Check the logs during compilation for specific errors

  2. Verify prerequisites are properly installed

  3. Update Crystal to the latest version

  4. Clear build cache: make clean && make build

  5. Create an issue on GitHub with:

    • Your operating system and version

    • Crystal version (crystal version)

    • Full error output

    • Installation method used

Available Makefile Targets

The Azu CLI Makefile provides several useful targets:

Target
Description

make or make all

Build and create symlink (default)

make build

Build the binary only

make shard

Install dependencies and build

make install

Build and install binary to system

make link

Create symlink to built binary

make force_link

Force create symlink (overwrites existing)

make run

Run the built binary

make clean

Remove built binary

make distclean

Remove binary and all build artifacts

Examples

Updating Azu CLI

To update to the latest version:

Uninstalling

To remove Azu CLI:

If installed with make install

Complete cleanup


Next Steps:

Last updated