本文へスキップ
Skillpedia
テスト58k · #3255

cli-anything-wiremock

できること

このスキルは、テスト中に本物のサービスの代わりを務めるツールWireMockを、AIエージェントが操作できるようにします。本物のバックエンドを使わずにテスト用の偽のレスポンスが必要な開発者向けです。

使う場面

  • ✓テスト環境用に、偽のAPIレスポンスを設定したいとき。
  • ✓モックサーバーが実際に受け取ったリクエストを確認したいとき。
  • ✓実際のバックエンドのトラフィックを記録し、モックのレスポンスとして再利用したいとき。

スキルのリンク

https://github.com/HKUDS/CLI-Anything/blob/main/skills/cli-anything-wiremock/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/HKUDS/CLI-Anything/blob/main/skills/cli-anything-wiremock/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“テストサーバーで、/ordersページに対してステータス200を返す偽のレスポンスを設定してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、WireMockの管理インターフェースにコマンドを送り、スタブのマッピングを作成、一覧表示、削除します。また、受け取ったリクエストを確認できます。変更は、実行中のモックサーバーに適用されます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Overview

cli-anything-wiremock is a command-line interface that wraps the WireMock Admin REST API (/__admin/). It allows agents and developers to manage HTTP stub mappings, inspect served requests, control stateful scenarios, and record real backend traffic — all from the terminal or from agent tool calls.

WireMock is commonly used in integration testing environments to replace real HTTP backends with controllable mock responses.

Command Groups

stub — Manage HTTP stub mappings

Command Description
stub list List all registered stubs
stub get <id> Get details of a specific stub by UUID
stub create <json> Create a stub from a JSON string
stub quick M URL S Quickly create a stub: METHOD URL STATUS_CODE
stub delete <id> Delete a stub by UUID
stub reset Reset all stubs to the defaults on disk
stub save Persist in-memory stubs to disk
stub import <file> Import stubs from a JSON file

request — Inspect served requests

Command Description
request list List recent served requests
request find <pattern> Find requests matching a JSON pattern
request count <pattern> Count requests matching a JSON pattern
request unmatched List requests that matched no stub (404s)
request reset Clear the request journal

scenario — Stateful scenario management

Command Description
scenario list List all scenarios and current states
scenario set N S Set scenario NAME to STATE
scenario reset Reset all scenarios to their initial state

record — Record traffic from a real backend

Command Description
record start <url> Start proxying + recording to TARGET_URL
record stop Stop recording, return captured stubs
record status Check if currently recording
record snapshot Snapshot in-memory requests as stubs

settings — Global server settings

Command Description
settings get Get current global WireMock settings
settings version Show WireMock server version

Top-level commands

Command Description
status Check if WireMock is running
reset Full reset: stubs + requests + scenarios
shutdown Gracefully shut down the WireMock server

Key Examples

# Check connectivity
cli-anything-wiremock status

# Create a stub using quick form
cli-anything-wiremock stub quick GET /api/users 200 --body '[{"id":1}]'

# Create a stub using full JSON
cli-anything-wiremock stub create '{
  "request": {"method": "POST", "url": "/api/orders"},
  "response": {"status": 201, "body": "{\"id\":99}"}
}'

# Verify a POST was made exactly once
cli-anything-wiremock --json request count '{"method":"POST","url":"/api/orders"}'
# → {"count": 1}

# Scenario: advance state
cli-anything-wiremock scenario set "cart-flow" "item-added"

# Record a real backend
cli-anything-wiremock record start https://api.example.com
# ... make requests ...
cli-anything-wiremock record stop

Agent Guidance

Always use --json in agent contexts

Use --json for all invocations in scripts or agent tool calls. JSON output varies by command type (these are distinct response types, no

よくある質問

WireMockは動いている必要がありますか?

はい。スキルはWireMockの管理APIと通信するため、モックサーバーが動いている必要があります。

スタブをディスクに保存できますか?

はい。saveコマンドでメモリ上のスタブをディスクに書き込み、importコマンドでファイルから読み込めます。

時間とともに変わるレスポンスに対応していますか?

はい。ステートフルなシナリオのコマンドがあり、一連のリクエストに応じてレスポンスを変えられます。

詳細

作者による元の説明

Python CLI harness for WireMock HTTP mock server administration

repo: HKUDS/CLI-Anything

人気

GitHubのスター
58k
ランキング
#3255
ライセンス
Apache-2.0
更新日
2026/9/21

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル