mirror of
https://fastgit.cc/github.com/HKUDS/CLI-Anything
synced 2026-04-20 21:00:28 +08:00
5.2 KiB
5.2 KiB
Quick Start Guide
Get started with the cli-anything plugin in 5 minutes.
Installation
# Copy plugin to Claude Code plugins directory
cp -r /root/cli-anything/cli-anything-plugin ~/.claude/plugins/cli-anything
# Reload plugins in Claude Code
/reload-plugins
# Verify installation
/help cli-anything
Your First CLI Harness
Let's build a CLI for a simple GUI application:
# Build complete CLI harness for GIMP
/cli-anything gimp
This will:
- ✅ Analyze GIMP's architecture
- ✅ Design the CLI structure
- ✅ Implement all core modules
- ✅ Create test plan
- ✅ Write and run tests
- ✅ Document results
- ✅ Create setup.py and install to PATH
Time: ~10-15 minutes (depending on complexity)
Output: /root/cli-anything/gimp/agent-harness/
Install the CLI
# Install to system PATH
cd /root/cli-anything/gimp/agent-harness
pip install -e .
# Verify it's in PATH
which cli-anything-gimp
# Use it from anywhere
cli-anything-gimp --help
Test the CLI
# Navigate to the CLI directory
cd /root/cli-anything/gimp/agent-harness
# Run the CLI directly (if installed)
cli-anything-gimp --help
# Or run as module
python3 -m cli_anything.gimp.gimp_cli --help
# Try creating a project
cli-anything-gimp project new --width 800 --height 600 -o test.json
# Enter REPL mode
cli-anything-gimp repl
Run Tests
# Run all tests
/cli-anything:test gimp
# Or manually
cd /root/cli-anything/gimp/agent-harness
python3 -m pytest cli_anything/gimp/tests/ -v
# Force tests to use the installed command (recommended for validation)
CLI_ANYTHING_FORCE_INSTALLED=1 python3 -m pytest cli_anything/gimp/tests/ -v -s
# Output should show: [_resolve_cli] Using installed command: /path/to/cli-anything-gimp
Validate Quality
# Check if CLI meets all standards
/cli-anything:validate gimp
Build Another CLI
# Build CLI for Blender (3D software)
/cli-anything blender
# Build CLI for Inkscape (vector graphics)
/cli-anything inkscape
# Build CLI for Audacity (audio editor)
/cli-anything audacity
Refining an Existing CLI
After the initial build, use the refine command to expand coverage:
# Broad refinement — agent finds gaps across all capabilities
/cli-anything:refine /home/user/obs-studio
# Focused refinement — target a specific functionality area
/cli-anything:refine /home/user/obs-studio "scene transitions and streaming profiles"
Common Workflows
Build and Test
/cli-anything /home/user/gimp
/cli-anything:test /home/user/gimp
Build, Validate, Test, Install
/cli-anything /home/user/blender
/cli-anything:validate /home/user/blender
/cli-anything:test /home/user/blender
cd /root/cli-anything/blender/agent-harness
pip install -e .
which cli-anything-blender
Refine After Initial Build
# Expand coverage with gap analysis
/cli-anything:refine /home/user/inkscape
# Focus on a specific area
/cli-anything:refine /home/user/inkscape "path boolean operations and clipping masks"
Troubleshooting
Plugin not found
# Check if plugin is in the right location
ls ~/.claude/plugins/cli-anything
# Reload plugins
/reload-plugins
Tests fail
# Check Python version (need 3.10+)
python3 --version
# Install dependencies
pip install click pytest pillow numpy
# Run validation
/cli-anything:validate <software>
CLI doesn't work
# Check if all files were created
ls /root/cli-anything/<software>/agent-harness/cli_anything/<software>/
# Verify Python can import
cd /root/cli-anything/<software>/agent-harness
python3 -c "import cli_anything.<software>"
# Check if installed to PATH
which cli-anything-<software>
# Reinstall if needed
pip install -e .
Publishing to PyPI
Once your CLI is ready:
cd /root/cli-anything/<software>/agent-harness
# Install build tools
pip install build twine
# Build distribution packages
python -m build
# Upload to PyPI (requires account)
twine upload dist/*
Users can then install (multiple CLIs coexist without conflicts):
pip install cli-anything-gimp cli-anything-blender
cli-anything-gimp --help
cli-anything-blender --help
Next Steps
- Read the full README:
cat README.md - Study an example: Explore
/root/cli-anything/gimp/agent-harness/cli_anything/gimp/ - Read HARNESS.md: Understand the methodology at
~/.claude/plugins/cli-anything/HARNESS.md - Build your own: Choose a GUI app and run
/cli-anything <app-name>
Tips
- Start with simpler applications (GIMP, Inkscape) before complex ones (Blender, LibreOffice)
- Always run validation before considering a CLI complete
- Read the generated TEST.md to understand what's tested
- Use
--jsonflag for machine-readable output - REPL mode is great for interactive exploration
- Install CLIs to PATH for agent discoverability
- Publish to PyPI to share with the community
Help
# Get help on any command
/help cli-anything
/help cli-anything:refine
/help cli-anything:test
/help cli-anything:validate
# Or read the command docs
cat commands/cli-anything.md
Success!
You now have a powerful tool for building CLI harnesses for any GUI application. Happy building!