Skip to content

Latest commit

Β 

History

History
201 lines (161 loc) Β· 6.98 KB

File metadata and controls

201 lines (161 loc) Β· 6.98 KB

Changelog

All notable changes to MenuCLI will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[2.2.0] - 2025-01-18

Added

  • 🎯 Alternative Menu Names - Handle menu items that change based on state

    • Use pipe | syntax for alternatives: "Show Sidebar|Hide Sidebar"
    • Automatically tries each alternative until one works
    • Smart detection of toggle patterns
  • πŸ”€ Fallback Chains - Try multiple complete paths

    • Use double pipe || for fallback paths
    • Example: "File > Save As..." || "File > Export..."
    • Useful for cross-version compatibility
  • πŸ“Š State Detection - Check menu item states

    • New state command to check enabled/disabled/checked status
    • Returns detailed state information including keyboard shortcuts
    • AppleScript-based state checking for reliability
  • πŸ”§ Smart Toggles - Intelligent handling of toggle menu items

    • New toggle command automatically handles Show/Hide variations
    • Supports 10+ toggle patterns: Show/Hide, Enable/Disable, Start/Stop, Mute/Unmute, Play/Pause, Connect/Disconnect, Lock/Unlock, Maximize/Minimize, Expand/Collapse
    • Automatically detects current state and applies opposite action
  • 🎯 Click with Alternatives - New click-alt command

    • Combines alternatives and fallbacks in one command
    • --wait-enabled flag to wait for menu availability
    • --timeout option for custom wait duration
    • Verbose mode shows which alternative succeeded

Changed

  • MenuHelper now exposes public methods for state checking
  • AppleScriptBridge enhanced with state detection methods
  • Improved error messages to show which alternatives were tried
  • getMenuBar made public for StateAwareMenuHelper access

Technical

  • Added MenuItemAlternatives.swift for alternative resolution logic
  • Added StateAwareMenuHelper.swift for state-aware operations
  • Added PatternMatcher class for wildcard/regex support (foundation for future features)
  • All performance optimizations from v2.1.0 maintained

[2.1.0] - 2025-01-18

Added

  • πŸš€ Script Caching - 30-50% faster for repeated operations

    • Compiled AppleScripts cached and reused
    • Thread-safe implementation with concurrent queue
    • --no-cache flag for debugging
    • Cache automatically invalidates on errors
  • πŸ“¦ Batch Operations - 60-80% faster for multiple commands

    • New batch command for multiple menu operations
    • Single AppleScript execution for all operations
    • Example: menu batch App "Edit > Copy;Edit > Paste"
    • Individual success/failure reporting
  • ⏱️ Performance Tuning

    • Configurable delays with --delay option (milliseconds)
    • Reduced default delays from 200-300ms to 50ms
    • Optimized string building with pre-allocated buffers
    • Escape key delay reduced to 20ms
  • πŸ”„ Async Support

    • Async execution methods for GUI integration
    • Non-blocking operations with completion handlers
    • DispatchQueue-based implementation

Changed

  • Default menu open delay reduced to 50ms
  • Improved script generation with StringBuilder pattern
  • ExecutionStrategy show delay reduced to 20ms
  • Version bumped to 2.1.0

Performance Improvements

  • Single operations: 43-50% faster
  • Repeated operations: 70% faster (with cache)
  • Multiple operations: 60-80% faster (batch mode)
  • Memory usage optimized with string buffer pre-allocation

[1.0.0] - 2025-01-17

Added

  • πŸŽ‰ Initial release of MenuCLI

  • ✨ Core Features:

    • list command to enumerate menu items for any running application
    • click command to programmatically trigger menu items
    • check command to verify menu item existence for conditional scripting
    • diagnose command for troubleshooting menu execution methods
  • πŸ”‡ Non-Visual Execution:

    • --no-visual flag for silent menu automation without visual display
    • AppleScript bridge for guaranteed non-visual execution
    • Perfect for background automation and CI/CD pipelines
  • πŸ”€ Smart Typography Handling:

    • Automatic conversion of ... to … (ellipsis)
    • Smart quotes normalization (' β†’ ')
    • Em/en dash handling (β€” β†’ -)
  • ⚑ Multiple Execution Methods:

    • pick - Direct AXUIElement action
    • keyboard - Keyboard shortcut simulation
    • selector - Objective-C selector invocation
    • show-and-pick - Visual menu opening then selection
    • click - Traditional click action
    • --try-all flag to attempt all methods until success
  • πŸ—οΈ Modern Application Support:

    • Native AppKit applications
    • SwiftUI applications
    • Electron applications (VS Code, Discord, etc.)
    • Java applications (IntelliJ IDEA, etc.)
    • Web-based applications
  • πŸ› οΈ Developer Experience:

    • Comprehensive --verbose output for debugging
    • --quiet mode for script-friendly output
    • --metrics flag for performance monitoring
    • Detailed error messages and troubleshooting guidance
  • πŸ” Security & Permissions:

    • Accessibility API integration
    • Proper permission checking and user guidance
    • Secure execution model

Technical Implementation

  • Swift 5.9+ with modern async/await patterns
  • AXUIElement API for direct UI access
  • AppleScript System Events bridge
  • CGEvent keyboard simulation
  • NSWorkspace application discovery
  • Swift Argument Parser for robust CLI interface

Documentation

  • Comprehensive README with examples and use cases
  • Built-in help system (--help for all commands)
  • Troubleshooting guide for common issues
  • Professional API documentation

Platform Support

  • macOS 10.15 (Catalina) and later
  • Intel and Apple Silicon Macs
  • Universal binary support

Future Releases

Planned Features

  • 🍺 Homebrew formula for easy installation
  • πŸ“± Menu bar application companion
  • πŸ”„ Menu item state monitoring and change detection
  • πŸ“‹ Menu structure export to JSON/XML formats
  • 🎯 Menu item fuzzy matching and search
  • πŸ”Œ Plugin system for custom execution methods
  • πŸ“Š Usage analytics and performance optimization
  • 🌐 Remote menu control over network
  • 🎨 Customizable output formatting
  • πŸ”’ Enhanced security with code signing

Version Roadmap

v1.1.0 (Planned)

  • Fuzzy menu item matching
  • Menu structure caching for performance
  • Homebrew formula
  • Enhanced error messages

v1.2.0 (Planned)

  • JSON output format
  • Menu item state monitoring
  • Performance improvements

v2.0.0 (Planned)

  • Plugin architecture
  • Menu bar companion app
  • Remote control capabilities
  • Breaking changes for improved API design

Contributing

See CONTRIBUTING.md for guidelines on how to contribute to this changelog and the project.

Release Notes Format

Each release follows this format:

  • Added for new features
  • Changed for changes in existing functionality
  • Deprecated for soon-to-be removed features
  • Removed for now removed features
  • Fixed for any bug fixes
  • Security for vulnerability fixes