Skip to main content
All commands follow the pattern ibmi <command> [arguments] [options]. Global options (--system, --format, --raw, --stream, --watch, --output, --tools, --no-color) apply to every command.

SQL Execution

ibmi sql [statement]

Execute a SQL query against the target system.
SQL source priority: positional argument > --file > piped stdin.
Read-only mode is enabled by default. To execute INSERT, UPDATE, DELETE, or DDL statements, pass --no-read-only explicitly or set readOnly: false in your system config.

Multi-System Execution

Run the same SQL query against multiple IBM i systems in parallel by passing a comma-separated list of system names to --system. Each system name must be defined in your CLI configuration file — either the user-level config at ~/.ibmi/config.yaml or a project-level .ibmi/config.yaml.
Multi-system execution requires named system connections. Ad-hoc DB2i_* environment variables only define a single system. See Getting Started for setup instructions and Configuration for managing multiple systems.

Usage

Output format

Each row in the output includes a SYSTEM column identifying which system returned it. The JSON envelope includes a systems array with per-system row counts, timing, and any errors:

Limitations

  • --watch is not supported with multiple systems.
  • If one system is unreachable, its results appear as an error row without affecting the other systems.
  • All systems share the same --limit value. When no --limit is specified, the smallest maxRows across all target systems is used.

Schema Discovery

ibmi schemas

List available schemas (libraries) on the system.

ibmi tables <schema>

List tables, views, and physical files in a schema.

ibmi columns <schema> <table>

Get column metadata for a specific table.
Returns column name, data type, length, nullable, default value, description, and ordinal position. Discover objects that depend on a database file (views, indexes, triggers, foreign keys, logical files).

ibmi describe <objects>

Generate DDL (CREATE statements) for one or more SQL objects using QSYS2.GENERATE_SQL.
Valid --type values: ALIAS, CONSTRAINT, FUNCTION, INDEX, MASK, PERMISSION, PROCEDURE, SCHEMA, SEQUENCE, TABLE, TRIGGER, TYPE, VARIABLE, VIEW, XSR Objects are specified as LIBRARY.OBJECT or just OBJECT (defaults to QSYS2). When describing multiple objects, each is queried independently — a failure on one object produces an ERROR: row without affecting the others.

ibmi validate "<sql>"

Validate SQL syntax and verify referenced objects exist without executing the query.
Uses QSYS2.PARSE_STATEMENT and cross-references tables, columns, and routines against the system catalog.

YAML Tool Execution

ibmi tool <name>

Execute a YAML-defined SQL tool. Requires --tools to specify the YAML file(s).
Each tool’s YAML parameters are automatically converted to CLI flags. Parameter names are converted from snake_case to --kebab-case:

ibmi tools

List available tools from loaded YAML files.

ibmi toolsets

List available toolsets from loaded YAML files.

System Management

ibmi system <subcommand>

Manage named system connections in .ibmi/config.yaml.

Shell Completions

ibmi completion [shell]

Generate shell completion scripts for tab-completion of commands, options, and arguments.
Supports bash, zsh, and fish.