simulator command provides complete control over your API mock services, including lifecycle management, monitoring, code generation, and import/export capabilities.
Subcommands
start
Start the API simulator and load service definitions.Directory containing service definition YAML files
Force stop any existing simulator before starting
Install and start a service template from the marketplace
The simulator runs until you press
Ctrl+C. All services are started on the ports defined in their YAML files.stop
Stop the running API simulator.Force stop even if services are active
status
Display the current status of the simulator and all services.Show detailed information about each service
validate
Validate service definition files for syntax and structure errors.Path to a service file or directory to validate
Recursively validate all YAML files in subdirectories
Show validation details for each file
logs
Retrieve and filter request logs from a running service.Name of the service to fetch logs from
Maximum number of log entries to retrieve
Filter by HTTP method (GET, POST, PUT, DELETE, etc.)
Filter by request route/path
Filter by HTTP status code
Write logs to a JSON file instead of stdout
monitor
Continuously monitor simulator status and live request logs.Monitor a specific service (monitors all services if omitted)
Output in JSON format for programmatic processing
Refresh interval in seconds (monitors continuously if omitted)
Press
Ctrl+C to stop monitoring.set-scenario
Activate a specific scenario across all services.Name of the scenario to activate
import
Import API definitions from other formats into apicentric service definitions.Path to the input file (OpenAPI, Postman, WireMock, or Mockoon)
Path where the converted service definition will be saved
- OpenAPI 3.0 / Swagger 2.0 (JSON or YAML)
- Postman collections
- WireMock mappings
- Mockoon environments
The command auto-detects the input format. If detection fails, it attempts to parse as OpenAPI.
export
Export service definitions to other formats.Path to the apicentric service definition file
Path where the exported file will be saved
Export format:
openapi or postmangenerate-types
Generate TypeScript type definitions from a service definition.Path to the service definition YAML file
Path where the TypeScript file will be saved
generate-query
Generate React Query hooks from a service definition.Path to the service definition YAML file
Path where the hooks file will be saved
generate-view
Generate a React component view from a service definition.Path to the service definition YAML file
Path where the React component will be saved
new
Requires the
tui feature to be enabled.Directory where the service definition will be created
new-graphql
Create a new GraphQL service definition with schema and mock files.Name of the GraphQL service
Directory where the service files will be created
myapi.yaml- Service definitionmyapi.gql- GraphQL schemahelloQuery.json- Example mock response
edit
Requires the
tui feature to be enabled.Path to the service definition file
record
Record live API traffic and generate a service definition.Path where the recorded service definition will be saved
Target API URL to record traffic from
dockerize
Generate a Docker image for your service definitions.One or more service definition files to include
Output directory for the Dockerfile and related files
Dockerfile- Multi-stage build with apicentric.dockerignore- Ignore patternsservices/- Copied service definitions
test
Requires the
contract-testing feature to be enabled.Path to the contract/service definition file
URL of the real API to test against
Environment name for the test run
Minimal output, only show pass/fail summary