Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wish_cli-0.7.0.tar.gz (92.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wish_cli-0.7.0-py3-none-any.whl (101.6 kB view details)

Uploaded Python 3

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

Hashes for wish_cli-0.7.0.tar.gz
Algorithm Hash digest
SHA256 bb3fe6e8efd0b70cfcad22b4bb46c12525d6162e1907f93929e90a79bed24267
MD5 9481fff4ffc28fb2daf1ce3857ec93e8
BLAKE2b-256 e4a321383dd75a8f4f2fb7e7cdd63b973a5872f2c9f27f5ab0d6768b8da31827

See more details on using hashes here.

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

Hashes for wish_cli-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5490fa7b02b3304cf293c3ec3e96239e29e85d7449d3345957a5b8b24736af8
MD5 9cae9d6e7015b1909aa284d120a50067
BLAKE2b-256 261fcf63b6729f1c905fde8f6947ebc651306b15fa3a0f2a723a3bdcc1f1ca7f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page