openclaw-api-tester-cli
v1.1.0
Published
CLI installer for OpenClaw Stateful QA Engine - API Tester Skill
Readme
OpenClaw API Tester CLI
A Universal Global Installer that packages an OpenClaw Skill into a globally executable tool compatible with Windows, macOS, Linux, Docker, WSL, and VPS environments.
Published on npm:
[email protected]
🚀 Universal Compatibility
The installer is engineered for true cross‑platform operation:
- Windows: Detects
APPDATA,LOCALAPPDATA, and user home directories - macOS/Linux: Uses standard
~/.openclawwith fallback discovery - Docker/VPS: Auto‑detects workspace in current directory and environment variables
- WSL: Handles Windows‑Linux path translation and mount points
- Permission‑aware: Validates write access and suggests fixes
What It Does
This CLI tool installs the Stateful QA Engine - API Tester skill into your OpenClaw workspace using intelligent discovery. The skill provides five tools for systematic, stateful API testing:
- ingest_api – Compiles an OpenAPI/Swagger spec into a local workspace.
- read_docs – Reads documentation files (e.g., the generated SKILL.md).
- state_manager – Persistent session state management with
saveVariable(),getVariable(), andclearState(). - execute_test – Performs HTTP requests with variable substitution, 202 polling, and async handling.
- SKILL.md – Complete Stateful QA Engine workflow with mandatory execution gates.
The skill follows Phase 3: Stateful Execution rules: the agent runs tests with memory persistence, dependency mapping, and outputs only a final audit table.
🏗️ Stateful QA Engine Architecture
Core Innovations:
- Memory Injection: Eliminates "Brute-Force" errors with persistent
session_state.json - Dependency Mapping: Mandatory producer-consumer linking before execution
- 415 Guardrail: Verifies
consumestype before POST/PUT requests - Stop-on-Failure: Halts test sequences when producer endpoints fail (≥400)
- Variable Substitution: Automatic
{{VARIABLE_NAME}}pattern replacement in URLs/payloads
Enterprise Expansion Pack:
- Async Handling: 202 Accepted polling with 3 attempts and 2-second delays
- Dynamic Auth-Flow: Authentication endpoint prioritization and token storage
- Recursive Pagination: Comprehensive pagination parameter testing
- Ephemeral Cleanup: Zero-Knowledge persistence with automatic
session_state.jsondeletion
Installation
As a Global CLI Tool
npm install -g openclaw-api-tester-cliThen run:
openclaw-api-testerUsing npx (One‑Time Execution)
npx openclaw-api-tester-cliPrerequisites
- Node.js 18 or higher
- OpenClaw installed and initialized (workspace directory can be anywhere)
- Network access for downloading dependencies (optional, with local fallback)
How It Works: Intelligent Installation
Workspace Discovery (prioritized):
- Command‑line argument:
openclaw-api-tester /custom/path - Environment variables:
OPENCLAW_HOMEorOPENCLAW_WORKSPACE - Current directory scan (for Docker/VPS)
- System defaults:
~/.openclaw/workspace(Linux/macOS) or%APPDATA%/openclaw/workspace(Windows)
- Command‑line argument:
Permission Validation:
- Checks write access to target directory
- Suggests
sudoor alternative paths if permission denied
Skill Installation:
- Creates
api-tester-skillandapi-tester-skill/toolsdirectories - Writes five files:
tools/ingest_api.js– Compile OpenAPI specstools/read_docs.js– Read documentation filestools/state_manager.js– Persistent session state managementtools/execute_test.js– Perform HTTP requests with variable substitution and 202 pollingSKILL.md– Complete Stateful QA Engine operating procedure
- Creates
Dependency Safety:
- Installs
node-fetchlocally inside the skill folder (no global pollution) - Checks for
openapi-to-skillsavailability (usesnpxwhen needed) - Works offline if dependencies are pre‑installed
- Installs
Success Guidance:
- Prints installation location and next steps
- Provides line to add to your OpenClaw
TOOLS.md
Usage Examples
Basic Installation
# Install globally
npm install -g openclaw-api-tester-cli
# Run the installer (auto‑discovers workspace)
openclaw-api-testerCustom Workspace Location
# Specify workspace path directly
openclaw-api-tester /path/to/my/openclaw/workspace
# Using environment variable
export OPENCLAW_HOME=/custom/path
openclaw-api-testerDocker / VPS Installation
# Inside container or remote server
cd /app
npx openclaw-api-tester-cli
# The installer will scan current directory for .openclaw/Windows Installation
# PowerShell or CMD
npm install -g openclaw-api-tester-cli
openclaw-api-tester
# Automatically detects APPDATA or user profileUsage After Installation
Add the following line to your OpenClaw TOOLS.md:
- **API Tester:** Located at `./api-tester-skill`. Read `./api-tester-skill/SKILL.md` to use.Then, in your OpenClaw agent, you can invoke the skill's tools as described in SKILL.md.
Skill Operating Procedure
The skill enforces a stateful execution workflow:
MANDATORY WORKFLOW:
- Phase 1: Memory Injection – Use
state_manager.jsfor all data persistence - Phase 2: Dependency Mapping – Generate producer-consumer mapping table
- Phase 2.5: Authentication Flow – Prioritize auth endpoints and store tokens
- Phase 2.6: Pagination Testing – Test list endpoints with query parameters
- Phase 3: Stateful Execution – Execute tests with variable substitution
- Phase 4: Execution Gate – Output pre-execution table before running tests
- Phase 5: Ephemeral Cleanup – Delete
session_state.jsonafter completion
Key Features:
- Variable Substitution:
http://api.example.com/pets/{{saved_pet_id}} - 202 Polling: Automatic async handling with configurable retries
- 415 Prevention: Schema-based
Content-Typevalidation - Stop-on-Failure: Intelligent test sequence management
- Zero-Knowledge Persistence: No test data remains after session
Development
The installer is built with modular, cross‑platform architecture:
Core Modules:
- Path Handler (
getPlatformInfo(),getSystemDefaultOpenClawDir())- Platform‑aware path resolution
- Workspace Discovery (
discoverOpenClawWorkspace())- Recursive search with priority system
- Permission Validator (
validateWritePermissions(),handlePermissionError())- User‑friendly permission error handling
- Dependency Installer (
installDependenciesSafely())- Local npm installation with safety checks
- Skill File Generator (
createSkillFiles())- Generates complete Stateful QA Engine with all enterprise features
Testing
# Run syntax check
node --check index.js
# Create test installation
mkdir test_install && cd test_install && node ../index.jsVersion History
v1.1.0 (Current) - Enterprise Stateful QA Engine
- Complete Enterprise Expansion: Full async handling, dynamic auth flow, pagination testing
- Production-Ready Architecture: Stateful execution with memory persistence
- Enhanced Security: Zero-Knowledge persistence with automatic cleanup
- Robust Error Handling: 202 polling with configurable retries, stop-on-failure logic
- Comprehensive Documentation: Updated README and SKILL.md with enterprise workflows
v1.0.1 - Stateful QA Engine Beta
- Deep-Core Refactor: Transformed from "Passive Installer" to "Stateful QA Engine"
- Memory Injection: Added
state_manager.jswith persistent session state - Enterprise Expansion Pack: 202 polling, dynamic auth flow, pagination testing
- Ephemeral Cleanup Protocol: Zero-Knowledge persistence with automatic cleanup
- Dependency Mapping: Mandatory producer-consumer linking
- 415 Guardrail: Schema-based content type validation
v1.0.0 - Initial Release
- Universal cross-platform installer
- Basic API testing tools (ingest_api, read_docs, execute_test)
- Silent execution workflow
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
MIT © Tapan Talukdar. See LICENSE for details.
Support
- Issues: GitHub Issues
- Email: [email protected]
- Documentation: GitHub Wiki
