Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Minor Changes

- Add GitHub Action for one-line CI setup — `uses: CopilotKit/aimock@v1` with fixtures, config, port, args, and health check (#102)
- Wire fixture converters into CLI — `npx aimock convert vidaimock` and `npx aimock convert mockllm` as first-class subcommands (#102)
- Wire fixture converters into CLI — `npx @copilotkit/aimock convert vidaimock` and `npx @copilotkit/aimock convert mockllm` as first-class subcommands (#102)
- Add 30 npm keywords for search discoverability (#102)
- Add fixture gallery with 11 examples covering all mock types, plus browsable docs page at /examples (#102)
- Add vitest and jest plugins for zero-config testing — `import { useAimock } from "@copilotkit/aimock/vitest"` (#102)
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ aimock mocks everything your AI app talks to:
| **VectorMock** | Pinecone, Qdrant, ChromaDB compatible endpoints | [Vector](https://aimock.copilotkit.dev/vector-mock) |
| **Services** | Tavily search, Cohere rerank, OpenAI moderation | [Services](https://aimock.copilotkit.dev/services) |

Run them all on one port with `npx aimock --config aimock.json`, or use the programmatic API to compose exactly what you need.
Run them all on one port with `npx @copilotkit/aimock --config aimock.json`, or use the programmatic API to compose exactly what you need.

## Features

Expand Down Expand Up @@ -72,17 +72,17 @@ See the [GitHub Action docs](https://aimock.copilotkit.dev/github-action) for al

```bash
# LLM mocking only
npx aimock -p 4010 -f ./fixtures
npx @copilotkit/aimock -p 4010 -f ./fixtures

# Full suite from config
npx aimock --config aimock.json
npx @copilotkit/aimock --config aimock.json

# Record mode: proxy to real APIs, save fixtures
npx aimock --record --provider-openai https://api.openai.com
npx @copilotkit/aimock --record --provider-openai https://api.openai.com

# Convert fixtures from other tools
npx aimock convert vidaimock ./templates/ ./fixtures/
npx aimock convert mockllm ./config.yaml ./fixtures/
npx @copilotkit/aimock convert vidaimock ./templates/ ./fixtures/
npx @copilotkit/aimock convert mockllm ./config.yaml ./fixtures/

# Docker
docker run -d -p 4010:4010 -v ./fixtures:/fixtures ghcr.io/copilotkit/aimock -f /fixtures
Expand Down
2 changes: 1 addition & 1 deletion docs/agui-mock/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ <h2>Record &amp; Replay</h2>
<h2>CLI Usage</h2>
<div class="code-block">
<div class="code-block-header">CLI flags <span class="lang-tag">shell</span></div>
<pre><code>npx aimock --fixtures ./fixtures \
<pre><code>npx @copilotkit/aimock --fixtures ./fixtures \
--agui-record \
--agui-upstream http://localhost:8000/agent</code></pre>
</div>
Expand Down
16 changes: 8 additions & 8 deletions docs/aimock-cli/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h2>Quick Start</h2>
<div class="tab-cli">
<div class="code-block">
<div class="code-block-header">Run aimock <span class="lang-tag">shell</span></div>
<pre><code>$ npx aimock --config aimock.json --port 4010</code></pre>
<pre><code>$ npx @copilotkit/aimock --config aimock.json --port 4010</code></pre>
</div>
</div>
<div class="tab-docker">
Expand All @@ -69,7 +69,7 @@ <h2>Quick Start</h2>
-v ./aimock.json:/config.json \
-v ./fixtures:/fixtures \
ghcr.io/copilotkit/aimock \
npx aimock --config /config.json --port 4010</code></pre>
npx @copilotkit/aimock --config /config.json --port 4010</code></pre>
</div>
</div>
</div>
Expand Down Expand Up @@ -228,7 +228,7 @@ <h2>Docker Usage</h2>
<div class="code-block-header">
Run with config <span class="lang-tag">shell</span>
</div>
<pre><code>$ npx aimock --config aimock.json --host 0.0.0.0</code></pre>
<pre><code>$ npx @copilotkit/aimock --config aimock.json --host 0.0.0.0</code></pre>
</div>
</div>
<div class="tab-docker">
Expand All @@ -241,7 +241,7 @@ <h2>Docker Usage</h2>
-v ./aimock.json:/config.json \
-v ./fixtures:/fixtures \
ghcr.io/copilotkit/aimock \
npx aimock --config /config.json --host 0.0.0.0</code></pre>
npx @copilotkit/aimock --config /config.json --host 0.0.0.0</code></pre>
</div>
</div>
</div>
Expand All @@ -252,7 +252,7 @@ <h2>Fixture Converters</h2>
<h3>Usage</h3>
<div class="code-block">
<div class="code-block-header">Convert fixtures <span class="lang-tag">shell</span></div>
<pre><code>npx aimock convert &lt;format&gt; &lt;input&gt; [output]</code></pre>
<pre><code>npx @copilotkit/aimock convert &lt;format&gt; &lt;input&gt; [output]</code></pre>
</div>

<h3>Supported Formats</h3>
Expand Down Expand Up @@ -290,13 +290,13 @@ <h3>Examples</h3>
Converter examples <span class="lang-tag">shell</span>
</div>
<pre><code><span class="cm"># Convert a directory of VidaiMock templates</span>
$ npx aimock convert vidaimock ./templates/ ./fixtures/converted.json
$ npx @copilotkit/aimock convert vidaimock ./templates/ ./fixtures/converted.json

<span class="cm"># Convert a mock-llm YAML config</span>
$ npx aimock convert mockllm ./config.yaml ./fixtures/converted.json
$ npx @copilotkit/aimock convert mockllm ./config.yaml ./fixtures/converted.json

<span class="cm"># Print to stdout (omit output path)</span>
$ npx aimock convert vidaimock ./templates/</code></pre>
$ npx @copilotkit/aimock convert vidaimock ./templates/</code></pre>
</div>

<h2>Docker Compose</h2>
Expand Down
4 changes: 2 additions & 2 deletions docs/chaos-testing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ <h2>CLI Flags</h2>
<div class="code-block-header">
CLI chaos flags <span class="lang-tag">shell</span>
</div>
<pre><code>$ npx aimock --fixtures ./fixtures \
<pre><code>$ npx @copilotkit/aimock --fixtures ./fixtures \
--chaos-drop 0.1 \
--chaos-malformed 0.05 \
--chaos-disconnect 0.02</code></pre>
Expand All @@ -231,7 +231,7 @@ <h2>CLI Flags</h2>
<pre><code>$ docker run -d -p 4010:4010 \
-v ./fixtures:/fixtures \
ghcr.io/copilotkit/aimock \
npx aimock --fixtures /fixtures \
npx @copilotkit/aimock --fixtures /fixtures \
--chaos-drop 0.1 \
--chaos-malformed 0.05 \
--chaos-disconnect 0.02</code></pre>
Expand Down
6 changes: 3 additions & 3 deletions docs/docker/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ <h3>Run with local fixtures</h3>
<div class="tab-cli">
<div class="code-block">
<div class="code-block-header">Run <span class="lang-tag">shell</span></div>
<pre><code>$ npx aimock --fixtures ./fixtures
<pre><code>$ npx @copilotkit/aimock --fixtures ./fixtures

<span class="cm"># Custom port</span>
$ npx aimock --fixtures ./fixtures --port 5555</code></pre>
$ npx @copilotkit/aimock --fixtures ./fixtures --port 5555</code></pre>
</div>
</div>
<div class="tab-docker">
Expand All @@ -84,7 +84,7 @@ <h3>Run with local fixtures</h3>
$ docker run -p 5555:5555 \
-v ./fixtures:/fixtures \
ghcr.io/copilotkit/aimock \
npx aimock --fixtures /fixtures --port 5555
--fixtures /fixtures --port 5555

<span class="cm"># Pull from GitHub Container Registry</span>
$ docker pull ghcr.io/copilotkit/aimock:latest
Expand Down
2 changes: 1 addition & 1 deletion docs/images/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ <h2>Record &amp; Replay</h2>

<div class="code-block">
<div class="code-block-header">CLI <span class="lang-tag">sh</span></div>
<pre><code>npx aimock --record --provider-openai https://api.openai.com</code></pre>
<pre><code>npx @copilotkit/aimock --record --provider-openai https://api.openai.com</code></pre>
</div>
</main>
<aside class="page-toc" id="page-toc"></aside>
Expand Down
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ <h3>Replay</h3>
<span class="title">terminal</span>
</div>
<div class="demo-body">
<pre><span class="t-green">$</span> npx aimock --record --provider-openai https://api.openai.com
<pre><span class="t-green">$</span> npx @copilotkit/aimock --record --provider-openai https://api.openai.com

<span class="t-blue">&#9889;</span> Listening on http://localhost:4010

Expand Down Expand Up @@ -1329,7 +1329,7 @@ <h2 class="fade-in">
<span class="title">terminal</span>
</div>
<div class="demo-body">
<pre><span class="t-green">$</span> npx aimock --config aimock.json
<pre><span class="t-green">$</span> npx @copilotkit/aimock --config aimock.json

<span class="t-blue">&#9889;</span> aimock v1.0.0

Expand Down Expand Up @@ -1875,7 +1875,7 @@ <h2 class="fade-in">Built for production</h2>
// ── Terminal demo animation ──────────────────────────────────────
var termSteps = [
// Step 1: User types command
{ type: "prompt", text: "npx aimock -p 4010 -f ./fixture.json", delay: 600 },
{ type: "prompt", text: "npx @copilotkit/aimock -p 4010 -f ./fixture.json", delay: 600 },
// Step 2: Server starts
{
type: "line",
Expand Down
2 changes: 1 addition & 1 deletion docs/integrate-adk/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h2>Quick Start</h2>
</p>
<div class="code-block">
<div class="code-block-header">Start aimock <span class="lang-tag">shell</span></div>
<pre><code>npx aimock --fixtures fixtures/examples/adk/gemini-agent.json</code></pre>
<pre><code>npx @copilotkit/aimock --fixtures fixtures/examples/adk/gemini-agent.json</code></pre>
</div>

<h2>Gemini API Format</h2>
Expand Down
4 changes: 2 additions & 2 deletions docs/integrate-crewai/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h2>Quick Start</h2>
<span class="lang-tag">shell</span>
</div>
<pre><code><span class="cm"># Terminal 1 &mdash; start the mock server</span>
npx aimock --fixtures ./fixtures
npx @copilotkit/aimock --fixtures ./fixtures

<span class="cm"># Terminal 2 &mdash; run your CrewAI script</span>
<span class="kw">export</span> OPENAI_BASE_URL=http://localhost:4010/v1
Expand Down Expand Up @@ -333,7 +333,7 @@ <h2>Record &amp; Replay</h2>
<div class="code-block">
<div class="code-block-header">Record a crew run <span class="lang-tag">shell</span></div>
<pre><code><span class="cm"># Start aimock in record mode &mdash; unmatched requests go to OpenAI</span>
npx aimock --fixtures ./fixtures \
npx @copilotkit/aimock --fixtures ./fixtures \
--record \
--provider-openai https://api.openai.com

Expand Down
6 changes: 3 additions & 3 deletions docs/integrate-langchain/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h2>Quick Start</h2>
<div class="code-block-header">Minimal setup <span class="lang-tag">python</span></div>
<pre><code><span class="kw">from</span> langchain_openai <span class="kw">import</span> ChatOpenAI

<span class="cm"># Start aimock first: npx aimock --fixtures ./fixtures</span>
<span class="cm"># Start aimock first: npx @copilotkit/aimock --fixtures ./fixtures</span>
llm = <span class="fn">ChatOpenAI</span>(
base_url=<span class="str">"http://localhost:4010/v1"</span>,
api_key=<span class="str">"test"</span>,
Expand Down Expand Up @@ -182,7 +182,7 @@ <h2>Record &amp; Replay</h2>
</p>
<div class="code-block">
<div class="code-block-header">Record a session <span class="lang-tag">shell</span></div>
<pre><code>npx aimock --record --provider-openai https://api.openai.com -f ./fixtures</code></pre>
<pre><code>npx @copilotkit/aimock --record --provider-openai https://api.openai.com -f ./fixtures</code></pre>
</div>
<p>
Then point your LangChain code at <code>http://localhost:4010/v1</code> and run your agent
Expand All @@ -192,7 +192,7 @@ <h2>Record &amp; Replay</h2>
<div class="code-block">
<div class="code-block-header">Replay in tests <span class="lang-tag">shell</span></div>
<pre><code><span class="cm"># Replay mode (default when fixtures exist)</span>
npx aimock -f ./fixtures
npx @copilotkit/aimock -f ./fixtures

<span class="cm"># Run your tests against the recorded fixtures</span>
pytest tests/</code></pre>
Expand Down
8 changes: 4 additions & 4 deletions docs/integrate-llamaindex/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h2>Quick Start</h2>
<p>Start aimock with fixtures that match the queries your pipeline will send:</p>
<div class="code-block">
<div class="code-block-header">Terminal <span class="lang-tag">shell</span></div>
<pre><code>npx aimock --fixtures ./fixtures/llamaindex</code></pre>
<pre><code>npx @copilotkit/aimock --fixtures ./fixtures/llamaindex</code></pre>
</div>

<h2>Mock Both LLM and Vector DB</h2>
Expand Down Expand Up @@ -145,8 +145,8 @@ <h2>Mock Both LLM and Vector DB</h2>
}</code></pre>
</div>
<p>
Load both with <code>npx aimock --config aimock.json</code>. The config points to the
fixture file via <code>llm.fixtures</code>, so aimock handles both legs of the RAG
Load both with <code>npx @copilotkit/aimock --config aimock.json</code>. The config points
to the fixture file via <code>llm.fixtures</code>, so aimock handles both legs of the RAG
pipeline:
</p>
<ul>
Expand Down Expand Up @@ -281,7 +281,7 @@ <h2>Record &amp; Replay</h2>
<div class="code-block">
<div class="code-block-header">Record mode <span class="lang-tag">shell</span></div>
<pre><code><span class="cm"># Record LLM and embedding calls from a live session</span>
npx aimock \
npx @copilotkit/aimock \
--record \
--provider-openai https://api.openai.com \
--fixtures ./fixtures/llamaindex
Expand Down
2 changes: 1 addition & 1 deletion docs/integrate-pydanticai/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h2>Quick Start</h2>
<div class="code-block">
<div class="code-block-header">Terminal <span class="lang-tag">shell</span></div>
<pre><code><span class="cm"># Terminal 1 — start aimock</span>
npx aimock --fixtures ./fixtures
npx @copilotkit/aimock --fixtures ./fixtures

<span class="cm"># Terminal 2 — run the agent</span>
python agent.py</code></pre>
Expand Down
4 changes: 2 additions & 2 deletions docs/metrics/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h2>Quick Start</h2>
<div class="code-block-header">
Enable metrics <span class="lang-tag">shell</span>
</div>
<pre><code>$ npx aimock --fixtures ./fixtures --metrics</code></pre>
<pre><code>$ npx @copilotkit/aimock --fixtures ./fixtures --metrics</code></pre>
</div>
</div>
<div class="tab-docker">
Expand All @@ -91,7 +91,7 @@ <h2>Quick Start</h2>
<pre><code>$ docker run -d -p 4010:4010 \
-v ./fixtures:/fixtures \
ghcr.io/copilotkit/aimock \
npx aimock --fixtures /fixtures --metrics</code></pre>
npx @copilotkit/aimock --fixtures /fixtures --metrics</code></pre>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/migrate-from-mock-llm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,10 @@ <h2>CLI / Docker quick start</h2>
Install &amp; run <span class="lang-tag">sh</span>
</div>
<pre><code><span class="cm"># Run the mock server</span>
npx aimock -p <span class="num">4010</span> -f ./fixtures
npx @copilotkit/aimock -p <span class="num">4010</span> -f ./fixtures

<span class="cm"># With a full config file</span>
npx aimock --config aimock.json --port <span class="num">4010</span>
npx @copilotkit/aimock --config aimock.json --port <span class="num">4010</span>

<span class="cm"># Point your app at the mock</span>
<span class="kw">export</span> OPENAI_BASE_URL=http://localhost:4010/v1</code></pre>
Expand Down
7 changes: 4 additions & 3 deletions docs/migrate-from-mokksy/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ <h1>Switching from Mokksy to aimock</h1>
<!-- ─── The quick switch ─────────────────────────────────── -->
<h2>The quick switch</h2>
<p>
JVM tests can use aimock via Docker or <code>npx aimock</code> if Node.js is available.
Point the OpenAI Java SDK at aimock and your existing test assertions stay the same.
JVM tests can use aimock via Docker or <code>npx @copilotkit/aimock</code> if Node.js is
available. Point the OpenAI Java SDK at aimock and your existing test assertions stay the
same.
</p>

<div class="code-block">
Expand Down Expand Up @@ -402,7 +403,7 @@ <h2>CLI / Docker quick start</h2>
<div class="tab-cli">
<div class="code-block">
<div class="code-block-header">CLI <span class="lang-tag">sh</span></div>
<pre><code>npx aimock -p <span class="num">4010</span> -f ./fixtures</code></pre>
<pre><code>npx @copilotkit/aimock -p <span class="num">4010</span> -f ./fixtures</code></pre>
</div>
</div>
<div class="tab-docker">
Expand Down
4 changes: 2 additions & 2 deletions docs/migrate-from-msw/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ <h3>WebSocket APIs</h3>
<h3>Record &amp; Replay</h3>
<p>
Proxy real APIs, save as fixtures, replay forever.
<code>npx aimock --record --provider-openai https://api.openai.com</code>
<code>npx @copilotkit/aimock --record --provider-openai https://api.openai.com</code>
</p>
</div>
<div class="feature-card">
Expand Down Expand Up @@ -372,7 +372,7 @@ <h2>CLI / Docker quick start</h2>
<div class="tab-cli">
<div class="code-block">
<div class="code-block-header">CLI <span class="lang-tag">sh</span></div>
<pre><code>npx aimock -p <span class="num">4010</span> -f ./fixtures</code></pre>
<pre><code>npx @copilotkit/aimock -p <span class="num">4010</span> -f ./fixtures</code></pre>
</div>
</div>
<div class="tab-docker">
Expand Down
4 changes: 2 additions & 2 deletions docs/migrate-from-piyook/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,10 @@ <h2>CLI / Docker quick start</h2>
Install &amp; run <span class="lang-tag">sh</span>
</div>
<pre><code><span class="cm"># Run the mock server</span>
npx aimock -p <span class="num">4010</span> -f ./fixtures
npx @copilotkit/aimock -p <span class="num">4010</span> -f ./fixtures

<span class="cm"># With a full config file</span>
npx aimock --config aimock.json --port <span class="num">4010</span>
npx @copilotkit/aimock --config aimock.json --port <span class="num">4010</span>

<span class="cm"># Point your app at the mock</span>
<span class="kw">export</span> OPENAI_BASE_URL=http://localhost:4010/v1
Expand Down
13 changes: 7 additions & 6 deletions docs/migrate-from-python-mocks/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,11 @@ <h2>Honest assessment</h2>
<div class="info-box">
<p>
<strong>Two paths for Python teams.</strong> If you have Node.js available,
<code>npx aimock</code> starts a mock server in one command &mdash; no Docker needed.
The <code>aimock-pytest</code> pip package is in development to provide native pytest
fixture integration with automatic server lifecycle management. For Docker-based CI
environments, the <code>ghcr.io/copilotkit/aimock</code> image works with any language.
<code>npx @copilotkit/aimock</code> starts a mock server in one command &mdash; no
Docker needed. The <code>aimock-pytest</code> pip package is in development to provide
native pytest fixture integration with automatic server lifecycle management. For
Docker-based CI environments, the <code>ghcr.io/copilotkit/aimock</code> image works
with any language.
</p>
</div>

Expand Down Expand Up @@ -435,7 +436,7 @@ <h2>CLI / Docker quick start</h2>
Install &amp; run <span class="lang-tag">sh</span>
</div>
<pre><code><span class="cm"># Run the mock server (requires Node.js)</span>
npx aimock -p <span class="num">4010</span> -f ./fixtures
npx @copilotkit/aimock -p <span class="num">4010</span> -f ./fixtures

<span class="cm"># Point your Python app at the mock</span>
<span class="kw">export</span> OPENAI_BASE_URL=http://localhost:4010/v1
Expand Down Expand Up @@ -478,7 +479,7 @@ <h2>CLI / Docker quick start</h2>
<h2>Alternative: npx fixture (no Docker)</h2>
<p>
If Node.js is available in your environment, you can skip Docker entirely and use
<code>npx aimock</code> directly from your <code>conftest.py</code>.
<code>npx @copilotkit/aimock</code> directly from your <code>conftest.py</code>.
</p>

<div class="code-block">
Expand Down
Loading
Loading