Skip to main content
Stop the API simulator and gracefully shut down all running mock services.

Usage

apicentric simulator stop [OPTIONS]

Options

--force
boolean
default:"false"
Force stop the simulator even if it’s in an inconsistent state. Use this when normal shutdown fails.
--config
string
default:"apicentric.json"
Path to the configuration file (global option).
--mode
string
Execution mode override: ci, development, or debug (global option).
--dry-run
boolean
default:"false"
Show what would be executed without actually stopping the simulator (global option).
--verbose
boolean
default:"false"
Enable verbose output for detailed logging (global option).
--db-path
string
default:"apicentric.db"
Path to the SQLite database for simulator storage (global option).

Examples

Stop the simulator

apicentric simulator stop
Example output when simulator is running:
🛑 Stopping API Simulator...
✅ API Simulator stopped
Example output when simulator is not running:
🛑 Stopping API Simulator...
⚠️ API Simulator not running

Force stop the simulator

apicentric simulator stop --force
Use this when the simulator is unresponsive or in an error state.

Dry run mode

apicentric simulator stop --dry-run
Example output:
🏃 Dry run: Would stop API simulator (force=false)

How it works

When you run simulator stop:
  1. The command checks if the simulator is currently active
  2. If active, it sends a shutdown signal to all running services
  3. Each service is gracefully stopped in sequence
  4. Resources are cleaned up and ports are released
  5. The simulator process terminates
If you started the simulator with simulator start, pressing Ctrl+C will also stop it gracefully. The stop command is useful when the simulator is running in the background or you need to script shutdown operations.

Troubleshooting

Simulator won’t stop

If the simulator doesn’t respond to the stop command:
  • Use --force to force shutdown
  • Check for zombie processes: ps aux | grep apicentric
  • Manually kill the process if needed: kill <PID>

Configuration error

If you see “API simulator is not enabled or configured”:
  • Verify your apicentric.json configuration
  • Check that you’re in the correct directory
  • Use --config to specify the config file path

Build docs developers (and LLMs) love