← 返回命令列表

Linux command

aimock 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start

npx aimock -p [4010] -f [./fixtures]

Start

npx aimock --config [aimock.json]

Record

npx aimock --record --provider-openai [https://api.openai.com]

Convert

npx aimock convert [vidaimock] [./templates/] [./fixtures/]

Run

docker run -d -p 4010:4010 -v [./fixtures]:/fixtures ghcr.io/copilotkit/aimock -f /fixtures

说明

aimock is deterministic mock infrastructure for testing AI applications. It mocks LLM APIs, image generation, text-to-speech, transcription, video generation, MCP tools, A2A agents, AG-UI event streams, vector databases, search, rerank, and moderation — all from one package on one port with zero dependencies. The tool supports 11 LLM providers including OpenAI, Claude, Gemini, Bedrock, Azure, Vertex AI, Ollama, and Cohere with full streaming support. Record & Replay mode proxies real APIs and saves responses as fixtures for deterministic test playback. Chaos testing capabilities allow simulating failures and edge cases. aimock runs daily against real provider APIs and catches response format changes within 24 hours, maintaining fixture compatibility. It is built entirely on Node.js builtins with no external dependencies.

参数

-p, --port _number_
Port to listen on (default: 4010)
-f, --fixtures _directory_
Path to the fixtures directory
--config _file_
Load configuration from a JSON file
--record
Enable record mode to proxy real APIs and save responses as fixtures
--provider-openai _url_
OpenAI provider URL for proxying in record mode
convert _format_ _source_ _dest_
Convert fixtures from other tools (vidaimock, mockllm)

FAQ

What is the aimock command used for?

aimock is deterministic mock infrastructure for testing AI applications. It mocks LLM APIs, image generation, text-to-speech, transcription, video generation, MCP tools, A2A agents, AG-UI event streams, vector databases, search, rerank, and moderation — all from one package on one port with zero dependencies. The tool supports 11 LLM providers including OpenAI, Claude, Gemini, Bedrock, Azure, Vertex AI, Ollama, and Cohere with full streaming support. Record & Replay mode proxies real APIs and saves responses as fixtures for deterministic test playback. Chaos testing capabilities allow simulating failures and edge cases. aimock runs daily against real provider APIs and catches response format changes within 24 hours, maintaining fixture compatibility. It is built entirely on Node.js builtins with no external dependencies.

How do I run a basic aimock example?

Run `npx aimock -p [4010] -f [./fixtures]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -p, --port _number_ do in aimock?

Port to listen on (default: 4010)