Skip to main content
Docs: ApiGear Core

Introduction

The apigear command-line interface (CLI) is the primary tool for working with the ApiGear platform. It provides complete functionality for API-driven development, from code generation to runtime monitoring and simulation.

Key Features

Code Generation

Generate production-ready SDKs from ObjectAPI definitions using templates for C++, Qt, Unreal Engine, Python, and more.

Project Management

Create, organize, and manage API projects with modules, solutions, and scenarios.

Template Management

Browse, install, and manage SDK templates from the ApiGear registry or create custom templates.

API Simulation

Run scripted backends that simulate your services for client development and testing.

API Stimulation

Drive your service implementations with scripted client calls for validation and load testing.

API Monitoring

Monitor real-time API traffic from your applications for debugging and validation.

Installation

Download the latest release for your platform from the GitHub releases page.

macOS

# Download and extract
curl -L https://github.com/apigear-io/cli/releases/latest/download/apigear-darwin-amd64.tar.gz | tar xz

# Move to PATH
sudo mv apigear /usr/local/bin/

Linux

# Download and extract
curl -L https://github.com/apigear-io/cli/releases/latest/download/apigear-linux-amd64.tar.gz | tar xz

# Move to PATH
sudo mv apigear /usr/local/bin/

Windows

Download the .exe file from the releases page and add it to your PATH.

Quick Start

# Check installation
apigear version

# Create a new project
apigear project create -d my-api-project

# Generate code from a solution
apigear generate solution apigear/demo.solution.yaml

# Start simulation server
apigear sim run apigear/demo.scenario.js

# Monitor API traffic
apigear monitor run

Command Overview

CommandAliasDescription
generategen, gGenerate SDKs from API definitions
projectprjManage API projects
templatetpl, tManage SDK templates
simulatesim, sRun scripted backend simulations
stimulatestimRun scripted client stimulations
monitormon, mMonitor API traffic
olinkolInteractive ObjectLink REPL
specValidate API specifications
configcfg, cManage configuration
serveStart combined server
updateUpdate CLI to latest version
versionDisplay version information

Updating

The CLI can update itself to the latest version:

apigear update

Use --force to skip confirmation:

apigear update --force

Configuration

View current configuration:

apigear config info

Display all configuration values:

apigear config get

Export environment variables:

apigear config env

Configuration Locations

PlatformPath
macOS~/Library/Application Support/apigear/
Linux~/.config/apigear/
Windows%APPDATA%\apigear\

Environment Variables

VariableDescription
APIGEAR_TEMPLATESOverride template cache location
APIGEAR_REGISTRYOverride template registry URL

Server Ports

Default ports used by CLI servers:

ServiceDefault PortPurpose
Simulation4333WebSocket server for ObjectLink
Monitor5555HTTP server for API events
NATS4222Message broker (optional)

Document Validation

Validate any ApiGear document:

apigear spec check myapi.module.yaml

View schema for document types:

apigear spec schema --type module
apigear spec schema --type solution
apigear spec schema --type rules

Experimental Features

Access experimental commands with the x command:

# Convert between formats
apigear x json2yaml file.json
apigear x yaml2json file.yaml
apigear x yaml2idl api.module.yaml
apigear x idl2yaml api.idl

# WebSocket testing
apigear x wsecho --address :8080
apigear x wscat --url ws://localhost:8080

CI/CD Integration

The CLI is designed for automation:

# Non-interactive update
apigear update --force

# Generate with specific template version
apigear generate solution solution.yaml

# Watch mode for development
apigear generate solution solution.yaml --watch

Getting Help

Get help for any command:

apigear --help
apigear generate --help
apigear template install --help