Main CLI application for wish
Project description
wish-cli
Main CLI Application for wish
wish-cli is the main CLI application for the wish AI command center. It provides a refined UI experience similar to Claude Code, accelerating penetration testers' thought processes.
๐ Quick Start
Installation (Production)
pip install wish-sh
wish
Development Environment
# In the project root
uv sync --all-packages --dev
uv run wish
๐ฏ Key Features
โจ Claude Code-style UI Experience
- Beautiful themes with Rich Console
- Interactive modals with Textual
- Asynchronous progress display
- Intuitive command completion
๐ Hybrid Command Processing
- Slash commands:
/help,/status,/mode, etc. - Natural language processing: Instructions like "scan the target"
- AI plan generation: Context-aware execution plans
- Plan approval flow: Safe execution confirmation
๐จ Rich UI Elements
- Hierarchical status display
- Real-time job management
- Interactive plan editing
- Responsive progress display
๐ Command Reference
Slash Commands
Basic Information
/help # Display help
/status # Display engagement status
/mode [recon|enum|exploit|report] # Display/change mode
State Management
/scope add <target> # Add target scope
/scope remove <target> # Remove target scope
/scope # Display current scope
Results Display
/findings # List findings
/jobs # List running jobs
/logs <job_id> # Display job logs
Job Management
/stop <job_id> # Stop job
/clear # Clear screen
/history # Command history
Natural Language Commands
# Reconnaissance Phase
scan the target
find active hosts
enumerate web directories
# Validation Phase
check for vulnerabilities
test for SQL injection
brute force login
# Exploitation Phase
escalate privileges
deploy sliver implant
๐ฎ User Interface
Main Screen Layout
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โป Welcome to wish! - The Pentester's Command Center โ
โ /help for commands, /mode for current mode โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
[Output Area: Scrollable main display]
- AI responses and plan display
- Tool execution results
- Asynchronous notifications
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ > your command here โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Mode: [recon] | Targets: [3] | Jobs: [1] | Press ? for help
Plan Approval Flow
โ I will scan the target at 10.0.0.5 for vulnerabilities.
โ Execute(nikto)
โฟ Command: nikto -h 10.0.0.5 -p 80
โฟ Purpose: Web vulnerability scanning
โฟ Expected: HTTP service vulnerabilities
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Would you like to proceed? โ
โ โฏ 1. Yes (Execute Plan) โ
โ 2. Edit Command โ
โ 3. No (Cancel) โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ๏ธ Configuration
OpenAI API Key Setup
# Environment variable (recommended)
export OPENAI_API_KEY="your-openai-api-key-here"
# Configuration file
wish-ai-validate --init-config
wish-ai-validate --set-api-key "your-key"
# Manual configuration
echo 'api_key = "your-key"' >> ~/.wish/config.toml
UI Customization
# ~/.wish/config.toml
[ui]
theme = "dark" # dark/light
progress_style = "modern" # modern/classic
auto_approve = false # Auto-approve plans
max_history = 100 # Command history retention
๐ ๏ธ Development
Architecture Overview
wish-cli/
โโโ main.py # Entry point
โโโ cli.py # Main CLI loop
โโโ ui/ # UI-related
โ โโโ ui_manager.py # Rich+Textual integration
โ โโโ progress_manager.py # Progress display
โ โโโ textual_widgets.py # Modal UI
โ โโโ input_handler.py # Input handling
โโโ core/ # Core functionality
โ โโโ command_dispatcher.py # Command routing
โโโ commands/ # Command implementations
โโโ slash_commands.py # Slash commands
Key Components
WishCLI
Main CLI application class
- Asynchronous main loop
- Session management
- Graceful shutdown
UIManager
UI integration management class
- Rich Console + Textual integration
- Progress display
- Modal management
CommandDispatcher
Command routing class
- Slash command processing
- Natural language parsing
- AI plan execution
Testing
# Unit tests
uv run pytest tests/
# E2E tests
uv run pytest e2e-tests/
# Component integration tests
uv run pytest e2e-tests/component/
# Workflow tests
uv run pytest e2e-tests/workflows/
Code Quality
# Format code
uv run ruff format src/
# Lint code
uv run ruff check src/
# Type checking
uv run mypy src/
๐ง Troubleshooting
Common Issues
"No module named 'wish_cli'"
# Run in development environment
uv run wish
# Or install package
pip install -e .
"OpenAI API key not configured"
# Set environment variable
export OPENAI_API_KEY="your-key"
# Verify configuration
wish-ai-validate --check-env
"Rich/Textual import errors"
# Reinstall dependencies
uv sync --reinstall
Performance Tips
- Memory usage: Reduce logs with
--log-level ERROR - Response speed: Speed up with proper API key configuration
- CPU usage: Adjust number of concurrent jobs
๐ค Contributing
Development Setup
# 1. Fork and clone
git clone your-fork-url
cd wish/.sprout/wish-cli-basic-ui
# 2. Set up development environment
uv sync --all-packages --dev
# 3. Pre-checks
make lint
make test
# 4. Implement and test
# ... your changes ...
# 5. Quality checks
make format
make test
Code Style
- Python: PEP 8 compliant, ruff formatting
- Type Hints: Required (mypy checks)
- Docstrings: Google style
- Error Handling: Fail-fast principle
๐ License
MIT License - See LICENSE file for details.
๐ Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wish_cli-0.7.0.tar.gz.
File metadata
- Download URL: wish_cli-0.7.0.tar.gz
- Upload date:
- Size: 92.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb3fe6e8efd0b70cfcad22b4bb46c12525d6162e1907f93929e90a79bed24267
|
|
| MD5 |
9481fff4ffc28fb2daf1ce3857ec93e8
|
|
| BLAKE2b-256 |
e4a321383dd75a8f4f2fb7e7cdd63b973a5872f2c9f27f5ab0d6768b8da31827
|
File details
Details for the file wish_cli-0.7.0-py3-none-any.whl.
File metadata
- Download URL: wish_cli-0.7.0-py3-none-any.whl
- Upload date:
- Size: 101.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5490fa7b02b3304cf293c3ec3e96239e29e85d7449d3345957a5b8b24736af8
|
|
| MD5 |
9cae9d6e7015b1909aa284d120a50067
|
|
| BLAKE2b-256 |
261fcf63b6729f1c905fde8f6947ebc651306b15fa3a0f2a723a3bdcc1f1ca7f
|