CLI API
Command-line interface for UX Master.
uxm init
Install UX-Master skill for AI assistants.
Bash
uxm init --ai <platform> [options]
Options
| Option | Description | Default |
|---|---|---|
--ai, -a | Target AI platform (required) | - |
--global, -g | Install to global config | false |
--force, -f | Overwrite existing files | false |
Supported Platforms
claude- Claude Codecursor- Cursor IDEwindsurf- Windsurf IDEvscode- VS Code MCPfigma- Figma Pluginall- All platforms
Example
# Install for Claude Code
uxm init --ai claude
# Install globally with force
uxm init --ai claude --global --force
uxm search
Search UX-Master knowledge base.
Bash
uxm search <query> [options]
Options
| Option | Description | Default |
|---|---|---|
--domain, -d | Search domain | - |
--stack, -s | Technology stack | - |
--max-results, -n | Max results | 3 |
--design-system, -ds | Generate design system | false |
uxm validate
Validate UI against 37 Design Tests.
Bash
uxm validate <target> [options]
Test Suites
all- All 37 testsmobile- Mobile-specific (7 tests)landing- Landing page (6 tests)dashboard- Dashboard (6 tests)a11y- Accessibility (5 tests)
Output Formats
rich- Terminal with colorsjson- JSON outputmarkdown- Markdown reporthtml- HTML dashboard
Example
# Validate HTML file
uxm validate index.html --suite mobile
# Validate URL
uxm validate https://stripe.com --url --suite all
# Generate HTML report
uxm validate index.html --format html --output report.html
uxm extract
Extract design system from website.
Bash
uxm extract <url> [options]
Example
# Extract to JSON
uxm extract https://stripe.com --output stripe.json
# Export to Figma
uxm extract https://linear.app --figma
# Deep crawl with screenshots
uxm extract https://vercel.com --depth 2 --screenshots
MCP Server API
Model Context Protocol server for AI assistants.
Base URL: http://localhost:3000
Authentication: None required for local development
Available Tools
search_ux_laws
Search 48 UX Laws for psychology-driven design.
POST
/mcp/v1/tools/call
{
"name": "search_ux_laws",
"arguments": {
"query": "mobile touch targets",
"product_type": "mobile",
"max_results": 5
}
}
validate_design
Validate UI code against 37 Design Tests.
POST
/mcp/v1/tools/call
{
"name": "validate_design",
"arguments": {
"html": "<button style='width: 100px'>Click</button>",
"css": "button { padding: 10px; }",
"test_suite": "all"
}
}
extract_design_system
Extract design system from website using Harvester v4.
POST
/mcp/v1/tools/call
{
"name": "extract_design_system",
"arguments": {
"url": "https://stripe.com",
"depth": 1,
"include_screenshots": false
}
}
Python SDK
Validation Engine
Python
from validation_engine import ValidationEngine
# Create engine
engine = ValidationEngine()
# Load harvester data
with open('harvest.json') as f:
data = json.load(f)
# Run validation
report = engine.validate(data, test_suite='all')
# Check results
print(f"Score: {report.score}/100")
print(f"Passed: {report.passed_count}/{report.total_count}")
Search Engine
Python
from search_engine import SearchEngine
engine = SearchEngine()
# Search UX Laws
results = engine.search(
query="mobile touch targets",
domain="ux-laws",
max_results=5
)
# Generate design system
system = engine.generate_design_system(
query="fintech dashboard",
project_name="MyApp"
)
Validation Engine
Test Categories
Mobile Tests (7)
| ID | Name | Severity | Check |
|---|---|---|---|
| DT-MOB-001 | Fitts's Law | Critical | Touch targets ≥ 44px |
| DT-MOB-002 | Thumb Zone | High | Actions in bottom 25% |
| DT-MOB-003 | Touch Feedback | High | Hover/active states |
Landing Page Tests (6)
| ID | Name | Severity | Check |
|---|---|---|---|
| DT-LND-001 | Hero Clarity | Critical | Value prop in 5 sec |
| DT-LND-002 | CTA Prominence | Critical | Visual dominance |
| DT-LND-003 | Social Proof | High | Above the fold |
Accessibility Tests (5)
| ID | Name | Severity | Check |
|---|---|---|---|
| DT-A11-001 | Focus States | Critical | Visible focus |
| DT-A11-002 | Input Labels | Critical | Associated labels |
| DT-A11-003 | ARIA Usage | High | Proper attributes |
Harvester API
Browser Injection
JavaScript
// Inject harvester_v4.js into browser console
const harvester = document.createElement('script');
harvester.src = 'https://ux-master.todyai.io/harvester_v4.js';
document.head.appendChild(harvester);
// Run extraction
const data = window.UXMasterHarvester.extract();
console.log(JSON.stringify(data, null, 2));
Python API
Python
from harvester_browser import BrowserHarvester
harvester = BrowserHarvester()
# Harvest single page
result = harvester.harvest("https://example.com")
if result["success"]:
data = result["data"]
print(f"Extracted {len(data['components']['blueprints'])} components")
Output Format
JSON
{
"_version": 4,
"meta": {
"url": "https://example.com",
"title": "Page Title",
"pageType": "dashboard",
"timestamp": "2024-01-01T00:00:00Z"
},
"visualAnalysis": {
"colors": {
"semantic": {...},
"neutrals": {...}
},
"typography": {...},
"layout": {...},
"spacing": {...}
},
"components": {
"blueprints": {...}
}
}
Error Codes
| Code | Meaning | Resolution |
|---|---|---|
| 400 | Bad Request | Check parameters |
| 404 | Not Found | Check URL/file path |
| 422 | Validation Error | Check input format |
| 500 | Server Error | Check logs |
| 503 | Service Unavailable | MCP server not running |
🚀 Ready to build?
Start with our tutorials or explore the Harvester v4 documentation.