Skip to main content
Get the ibmi CLI running and connected to your IBM i system.

Prerequisites

  • Node.js 18+ installed on your development machine
  • Mapepire running on your IBM i system (Setup Guide)
  • IBM i hostname, username, and password

Step 1: Install


Step 2: Configure a System

You have two options for connecting to your IBM i system:

Step 3: Run Your First Query

# List available schemas
ibmi schemas

# List tables in a schema
ibmi tables SAMPLE

# Run a SQL query
ibmi sql "SELECT * FROM SAMPLE.EMPLOYEE FETCH FIRST 5 ROWS ONLY"
You should see formatted table output like:
┌────────┬───────────┬──────────┐
│ EMPNO  │ FIRSTNME  │ LASTNAME │
├────────┼───────────┼──────────┤
│ 000010 │ CHRISTINE │ HAAS     │
│ 000020 │ MICHAEL   │ THOMPSON │
│ 000030 │ SALLY     │ KWAN     │
│ 000050 │ JOHN      │ GEYER    │
│ 000060 │ IRVING    │ STERN    │
└────────┴───────────┴──────────┘
[dev] myhost.com · 5 rows · 0.12s

Step 4: Explore

Try these commands to explore your IBM i system:
# Get column metadata for a table
ibmi columns SAMPLE EMPLOYEE

# Validate SQL syntax before executing
ibmi validate "SELECT * FROM SAMPLE.EMPLOYEE WHERE SALARY > 50000"

# Find objects that depend on a database file
ibmi related SAMPLE EMPLOYEE

# Get JSON output instead of a table
ibmi sql "SELECT * FROM SAMPLE.EMPLOYEE" --raw

Next Steps

Command Reference

Full reference for all commands, options, and examples

Configuration

Multi-system config, output format defaults, and YAML tool paths

Output Formats

Table, JSON, CSV, markdown, and NDJSON streaming

YAML Tools

Run YAML-defined SQL tools from the command line