Apicentric
A powerful CLI tool and API simulator platform for developers who love the terminal
What is Apicentric?
Apicentric is a Rust-based CLI tool and API simulator platform that helps developers:
- 🎯 Mock APIs with simple YAML configuration
- ✅ Test API contracts between services
- 🔄 Generate code (TypeScript types, React Query hooks)
- 🖥️ TUI (Terminal User Interface) for visual service management
- 🌐 P2P collaboration on service definitions (optional)
Perfect for frontend developers who need backend APIs, teams doing contract testing, or anyone who loves working in the terminal.
Core Concepts
Apicentric is built around a few core concepts:
- Service Definition: A YAML file that defines a mock API, including its endpoints, responses, and scenarios.
- Simulator: A local server that serves the mock APIs defined in your service definitions.
- Contract Testing: A feature that allows you to validate that your mock APIs match the real APIs they are mocking.
- Code Generation: A feature that allows you to generate client code from your service definitions.
- TUI: A terminal user interface that provides a visual way to manage your services.
Quick Start
Get up and running in 5 minutes:
# Install
# Create a service
# Start simulator
# Test it
Installation
Apicentric provides multiple installation methods to suit your workflow. Choose the one that works best for you.
Homebrew (macOS/Linux) - Recommended
The easiest way to install on macOS and Linux:
Verify installation:
Update to latest version:
Install Script (Unix)
Quick installation script for Linux and macOS:
|
This script will:
- Detect your platform and architecture automatically
- Download the appropriate binary
- Verify checksums for security
- Install to
/usr/local/bin(requires sudo)
Custom installation directory:
INSTALL_DIR=/.local/bin |
Verify installation:
Windows PowerShell
For Windows users, use the PowerShell installation script:
irm https://raw.githubusercontent.com/pmaojo/apicentric/main/scripts/install.ps1 | iex
This script will:
- Download the Windows x64 binary
- Verify checksums
- Extract to
%USERPROFILE%\.apicentric\bin - Add to PATH (restart terminal after installation)
Verify installation:
apicentric --version
Cargo (Build from Source)
If you have Rust installed, you can build from source with custom features:
Minimal build (fastest, ~1 minute):
Includes: Core simulator only
CLI Tools build (recommended, ~2 minutes):
Includes: Simulator, contract testing, and TUI
Full build (all features, ~3-5 minutes):
Includes: All features (TUI, P2P, GraphQL, scripting, AI)
Default build:
Includes: Simulator and contract testing
Verify installation:
Pre-built Binaries
Download pre-built binaries for your platform from GitHub Releases.
Available platforms:
- Linux x64 (
apicentric-linux-x64.tar.gz) - macOS x64 (
apicentric-macos-x64.tar.gz) - macOS ARM64 (
apicentric-macos-arm64.tar.gz) - Windows x64 (
apicentric-windows-x64.zip)
Manual installation (Linux/macOS):
# Download the appropriate archive
# Verify checksum (optional but recommended)
# Extract
# Move to PATH
# Make executable
Manual installation (Windows):
- Download
apicentric-windows-x64.zipfrom releases - Extract the archive
- Move
apicentric.exeto a directory in your PATH - Or add the directory to your PATH environment variable
Verify installation:
Docker (Coming Soon)
Docker images will be available soon for containerized deployments.
Verification
After installation, verify that Apicentric is working correctly:
# Check version
# View help
# List available commands
Expected output should show version information and available commands.
Troubleshooting
Command not found
Issue: apicentric: command not found after installation
Solutions:
-
Homebrew: Ensure Homebrew's bin directory is in your PATH:
-
Install script: Verify
/usr/local/binis in your PATH:| && || -
Windows: Restart your terminal or PowerShell after installation to refresh PATH
-
Cargo: Ensure
~/.cargo/binis in your PATH:
Permission denied
Issue: Permission errors during installation
Solutions:
-
Unix install script: The script requires sudo for
/usr/local/bin. Use custom directory:INSTALL_DIR=/.local/bin |Then add to PATH:
-
Manual installation: Use
sudowhen moving to system directories:
Checksum verification failed
Issue: Checksum mismatch during installation
Solutions:
-
Download may be corrupted. Delete and try again:
-
Verify you're downloading from the official repository
-
Check your internet connection
Cargo build fails
Issue: Compilation errors when building from source
Solutions:
-
Update Rust: Ensure you have the latest stable Rust:
-
Missing dependencies: Install required system dependencies:
- Ubuntu/Debian:
- macOS:
- Windows: Install Visual Studio Build Tools
- Ubuntu/Debian:
-
Try minimal build: If full build fails, try minimal:
Feature not available
Issue: Command shows "Feature not available in this build"
Solutions:
-
You installed a minimal build. Reinstall with desired features:
-
Or install full version:
macOS security warning
Issue: "apicentric cannot be opened because it is from an unidentified developer"
Solutions:
-
Option 1: Use Homebrew installation (recommended):
-
Option 2: Allow the binary manually:
-
Option 3: Build from source with Cargo:
Still having issues?
If you're still experiencing problems:
- Check GitHub Issues for similar problems
- Create a new issue with:
- Your operating system and version
- Installation method used
- Complete error message
- Output of
apicentric --version(if available)
- Join our Discussions for community support
Features
🎯 API Simulator
Define mock APIs in YAML and serve them locally:
- Path parameters and regex matching
- Dynamic templates with Handlebars
- Scenarios for different states
- Request/response logging
- Request recording proxy and auto-generated endpoints via
record_unknown - Imports OpenAPI 2.0/3.x specs, preferring documented examples and generating JSON bodies from schemas when necessary
✅ Contract Testing
Validate that mocks match real APIs:
- Register contracts from specs
- Compare mock vs real responses
- HTML reports with differences
- CI/CD integration
🔄 Code Generation
Generate client code from service definitions:
- TypeScript interfaces
- React Query hooks
- OpenAPI specs
- Postman collections
🖥️ TUI (Terminal User Interface)
Interactive terminal dashboard for service management:
- Real-time service status
- Live request logs with filtering
- Start/stop services
- Keyboard-driven workflow
🌐 Advanced Features (Optional)
- P2P Collaboration: Share services with team members
- GraphQL Mocking: Mock GraphQL APIs with schema
- JavaScript Plugins: Extend with custom logic
Documentation
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
License
MIT License - see LICENSE for details.