Communitygithub.com

cli-anything-wiremock

WireMock HTTP モックサーバー管理のためのPython CLIツール

cli-anything-wiremock とは?

`cli-anything-wiremock`は、WireMock Admin REST API(`/__admin/`)をラップするコマンドラインインターフェースです。エージェントや開発者は、HTTPスタブマッピングの管理、受信リクエストの検査、ステートフルなシナリオの制御、実際のバックエンドトラフィックの記録などを、ターミナルやエージェントのツールコールからすべて実行できます。WireMockは、統合テスト環境で実際のHTTPバックエンドを制御可能なモックレスポンスに置き換えるために広く使用されています。このツールは、`stub`、`request`、`scenario`、`record`、`settings`などのコマンドグループを提供し、特に`--json`フラグを使用することでエージェントコンテキストでの解析が容易になります。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/HKUDS/CLI-Anything/tree/main/skills/cli-anything-wiremock

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

概要

cli-anything-wiremock は、WireMock Admin REST API(/__admin/)をラップするコマンドラインインターフェースです。エージェントや開発者は、HTTPスタブマッピングの管理、提供されたリクエストの検査、ステートフルなシナリオの制御、実際のバックエンドトラフィックの記録を、ターミナルまたはエージェントツール呼び出しからすべて実行できます。

WireMock は、統合テスト環境で実際のHTTPバックエンドを制御可能なモックレスポンスに置き換えるためによく使用されます。

コマンドグループ

stub — HTTPスタブマッピングの管理

コマンド説明
stub list登録済みの全スタブを一覧表示
stub get <id>UUIDで特定のスタブの詳細を取得
stub create <json>JSON文字列からスタブを作成
stub quick M URL Sスタブを簡易作成: メソッド URL ステータスコード
stub delete <id>UUIDでスタブを削除
stub reset全スタブをディスク上のデフォルトにリセット
stub saveメモリ内のスタブをディスクに永続化
stub import <file>JSONファイルからスタブをインポート

request — 提供されたリクエストの検査

コマンド説明
request list最近提供されたリクエストを一覧表示
request find <pattern>JSONパターンに一致するリクエストを検索
request count <pattern>JSONパターンに一致するリクエストをカウント
request unmatchedどのスタブにも一致しなかったリクエストを表示 (404)
request resetリクエストジャーナルをクリア

scenario — ステートフルなシナリオ管理

コマンド説明
scenario list全シナリオと現在の状態を一覧表示
scenario set N Sシナリオ名 NAME を状態 STATE に設定
scenario reset全シナリオを初期状態にリセット

record — 実際のバックエンドからのトラフィック記録

コマンド説明
record start <url>プロキシ + 記録を TARGET_URL に対して開始
record stop記録を停止し、キャプチャしたスタブを返す
record status現在記録中かどうかを確認
record snapshotメモリ内のリクエストをスタブとしてスナップショット

settings — グローバルサーバー設定

コマンド説明
settings get現在のグローバルWireMock設定を取得
settings versionWireMockサーバーバージョンを表示

トップレベルコマンド

コマンド説明
statusWireMockが実行中かどうかを確認
reset完全リセット: スタブ + リクエスト + シナリオ
shutdownWireMockサーバーを正常にシャットダウン

主要な例

# 接続確認
cli-anything-wiremock status

# 簡易形式でスタブを作成
cli-anything-wiremock stub quick GET /api/users 200 --body '[{"id":1}]'

# 完全なJSONでスタブを作成
cli-anything-wiremock stub create '{
  "request": {"method": "POST", "url": "/api/orders"},
  "response": {"status": 201, "body": "{\"id\":99}"}
}'

# POSTが正確に1回実行されたことを確認
cli-anything-wiremock --json request count '{"method":"POST","url":"/api/orders"}'
# → {"count": 1}

# シナリオ: 状態を進める
cli-anything-wiremock scenario set "cart-flow" "item-added"

# 実際のバックエンドを記録
cli-anything-wiremock record start https://api.example.com
# ... リクエストを送信 ...
cli-anything-wiremock record stop

エージェント向けガイダンス

エージェントコンテキストでは必ず --json を使用

スクリプトやエージェントツール呼び出しでは、すべての呼び出しに --json を使用してください。JSON出力はコマンドタイプによって異なります(これらは、すべてのレスポンスをラップするエンベロープではなく、個別のレスポンスタイプです):

# データコマンドはWireMock API JSONをそのまま返します:
cli-anything-wiremock --json stub quick GET /api/hello 200 --body '{"hello":"world"}'
# → {"id": "abc-123", "request": {...}, "response": {...}, ...}

cli-anything-wiremock --json stub list
# → {"mappings": [...], "total": N}

# ボイドコマンド(delete、reset、save)は以下を返します:
# → {"status": "ok"}

# エラーは以下を返します:
# → {"status": "error", "message": "Connection refused"}

環境変数による接続

コマンドを呼び出す前に、環境変数で接続パラメータを設定します:

export WIREMOCK_HOST=localhost
export WIREMOCK_PORT=8080

テスト検証のワークフローパターン

  1. テスト対象システムを実行する前にスタブをセットアップ:
    cli-anything-wiremock --json stub quick POST /api/payment 200 --body '{"success":true}'
    
  2. テスト対象システムを実行します。
  3. インタラクションを検証:
    cli-anything-wiremock --json request count '{"method":"POST","url":"/api/payment"}'
    
  4. クリーンアップ:
    cli-anything-wiremock reset
    

エラーハンドリング

すべてのエラーで非ゼロの終了コードが返されます。--json モードでは、エラーは {"status": "error", "message": "..."} を返します。成功時は、生のWireMock APIレスポンスを返します。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-ccswitch

CLI interface for CC Switch — manage AI coding tool configurations from the terminal

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-comfyui

>-

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-firefly-iii

Firefly III CLI - Personal finance management via CLI-Anything

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

関連スキル