Maestro is a sophisticated music controller for macOS that provides seamless control over Apple Music through multiple interfaces. Built with Go and designed for performance, security, and extensibility.
- π΅ Complete Music Control: Play, pause, skip, volume, shuffle, repeat
- π₯οΈ Multiple Interfaces: CLI, TUI, gRPC API, MCP server
- π Enterprise Security: mTLS authentication, secure session management
- π High Performance: Concurrent operations, efficient AppleScript integration
- π Comprehensive Logging: Structured JSON logging with context tracing
- π§ͺ Well Tested: 95%+ test coverage with integration tests
- macOS 10.15+ (Catalina or later)
- Apple Music.app installed
- Go 1.25+ (for building from source)
git clone https://github.com/madstone-tech/maestro.git
cd maestro
make build
sudo make installbrew install madstone-tech/tap/maestro# Control music playback
maestro play
maestro pause
maestro next
maestro volume 75
# Get player status
maestro status
maestro status --json
# Interactive TUI (Coming Soon)
maestro-tui
# Start daemon for API access (Coming Soon)
maestrodMaestro follows Domain-Driven Design principles with clean architecture:
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Presentation β β Application β β Infrastructure β
β β β β β β
β β’ CLI (Cobra) ββββ€ β’ Use Cases ββββ€ β’ AppleScript β
β β’ TUI (Bubble) β β β’ Services β β β’ gRPC Server β
β β’ gRPC API β β β’ Session Mgmt β β β’ Logging β
β β’ MCP Server β β β β β’ Authenticationβ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βββββββββββββββββββ
β Domain β
β β
β β’ Entities β
β β’ Value Objects β
β β’ Repositories β
β β’ Domain Logic β
βββββββββββββββββββ
- Domain Layer: Core business logic, entities, and value objects
- Application Layer: Use cases, services, and application logic
- Infrastructure Layer: External integrations (AppleScript, gRPC, logging)
- Presentation Layer: User interfaces (CLI, TUI, API)
β Foundation Layer
- Complete domain model with 95.3% test coverage
- AppleScript infrastructure with timeout handling
- Basic CLI with essential commands
- Structured JSON logging system
- CI/CD pipeline with quality gates
π§ In Development (See GitHub Issues)
- Phase 2: TUI interface with Bubble Tea
- Phase 3: gRPC API server with mTLS
- Phase 4: MCP (Model Context Protocol) server
- Phase 5: Advanced features and optimizations
| Command | Description | Example |
|---|---|---|
play |
Start playback | maestro play |
pause |
Pause playback | maestro pause |
stop |
Stop playback | maestro stop |
next |
Next track | maestro next |
previous |
Previous track | maestro previous |
volume |
Set volume (0-100) | maestro volume 75 |
status |
Get player status | maestro status --json |
--json: Output in JSON format--log-level: Set log level (debug, info, warn, error)--timeout: Set operation timeout (default: 5s)
- Go 1.25+
- macOS with Apple Music.app
- Make
# Install dependencies
make deps
# Build all binaries
make build
# Run tests
make test
# Run linters
make lint
# Run all pre-commit checks
make pre-commit# Run all tests with coverage
make test
# Run only unit tests
make test-unit
# Run integration tests (requires Music.app)
make test-integration
# Generate coverage report
make test-coverage
# Check coverage meets threshold (80%)
make test-coverage-checkThe project maintains high code quality standards:
- 80% minimum test coverage enforced by CI
- golangci-lint with comprehensive rules
- Security scanning with govulncheck
- Automated formatting with gofmt
- Pre-commit hooks for quality checks
maestro/
βββ cmd/ # Application entry points
β βββ maestro/ # Main CLI application
β βββ maestro-exec/ # AppleScript executor subprocess
β βββ maestrod/ # Daemon server (Phase 3)
β βββ maestro-tui/ # Terminal UI (Phase 2)
β βββ maestro-mcp/ # MCP server (Phase 4)
βββ domain/music/ # Domain layer
β βββ entities.go # Core entities (Track, Playlist, Player)
β βββ values.go # Value objects (Duration, Volume, etc.)
β βββ repositories.go # Repository interfaces
β βββ errors.go # Domain errors
βββ infrastructure/ # Infrastructure layer
β βββ applescript/ # AppleScript integration
βββ presentation/ # Presentation layer
β βββ cli/ # Command-line interface
βββ pkg/ # Shared packages
β βββ logger/ # Structured logging
βββ .github/ # GitHub workflows and templates
βββ docs/ # Documentation
# Logging configuration
export MAESTRO_LOG_LEVEL=info
export MAESTRO_LOG_FORMAT=json
export MAESTRO_LOG_OUTPUT=stdout
# Server configuration (Phase 3)
export MAESTRO_SERVER_PORT=8443
export MAESTRO_TLS_CERT_PATH=/path/to/cert.pem
export MAESTRO_TLS_KEY_PATH=/path/to/key.pem
# Performance tuning
export MAESTRO_SCRIPT_TIMEOUT=5s
export MAESTRO_MAX_CONCURRENT_OPERATIONS=10# ~/.maestro/config.yaml
server:
port: 8443
tls:
cert_path: ~/.maestro/certs/server.crt
key_path: ~/.maestro/certs/server.key
logging:
level: info
format: json
performance:
script_timeout: 5s
max_concurrent_ops: 10service MaestroService {
rpc Play(PlayRequest) returns (PlayResponse);
rpc Pause(PauseRequest) returns (PauseResponse);
rpc GetStatus(StatusRequest) returns (StatusResponse);
// ... more methods
}Maestro will provide Model Context Protocol support for AI assistants:
{
"name": "maestro",
"description": "Music control for AI assistants",
"tools": [
{
"name": "play_music",
"description": "Control music playback"
}
]
}- mTLS authentication for API access
- Certificate-based client authentication
- Session management with configurable timeouts
- Rate limiting and request validation
Maestro requires the following macOS permissions:
- Automation permission for Apple Music.app control
- Accessibility permission (if using advanced features)
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Run
make pre-committo ensure quality - Submit a pull request
This project follows the Contributor Covenant Code of Conduct.
See our detailed roadmap and GitHub milestones for planned features.
- Phase 2: Interactive TUI with real-time updates
- Phase 3: gRPC API server with streaming
- Phase 4: MCP server for AI integration
- Phase 5: Performance optimizations and advanced features
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Cobra CLI framework
- Logging powered by Logrus
- Future TUI powered by Bubble Tea
- Inspired by the Unix philosophy of composable tools
Made with β€οΈ by the Madstone Technologies team