Skip to main content

Installation

The xyz CLI provides a Solana-like interface for interacting with XYZ Chain. This guide covers installation methods for different platforms.

Prerequisites

  • Go 1.21+ - Download
  • Git - For cloning the repository
  • Make - For building from source

Install from Source

Clone and Build

Install Both CLIs

To install both xyz (developer CLI) and xyzd (chain daemon):

Binary Locations

After installation, binaries are located at: Ensure $GOPATH/bin is in your PATH:
Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.) for persistence.

Verify Installation

Shell Completion

Enable tab completion for faster command entry:

Configuration

Initial Setup

View Configuration

Output:

Directory Structure

The CLI stores data in ~/.xyz/:

Environment Variables

All configuration can be set via environment variables with the XYZ_ prefix: Example:

Configuration Precedence

Configuration values are resolved in this order (highest to lowest):
  1. Command-line flags - --node tcp://...
  2. Environment variables - XYZ_NODE=tcp://...
  3. Config file - ~/.xyz/config.yaml
  4. Default values - Built-in defaults

Updating

From Source

Check for Updates

Uninstalling

Troubleshooting

Ensure $GOPATH/bin is in your PATH:
Add to your shell profile for persistence.
The binary may need executable permission:
Ensure Go 1.21+ is installed:
Update Go if needed from https://go.dev/dl/
Run go mod tidy to fetch dependencies:

Next Steps

Configuration

Configure the CLI for your environment

Key Management

Generate and manage keypairs