Thank you for your interest in contributing to YouTube Music CLI! This document provides guidelines and instructions for contributing to the project.
- Node.js >= 16
- Bun (package manager and runtime)
- mpv media player (for audio playback)
- TypeScript knowledge
-
Fork and clone the repository:
git clone https://github.com/your-username/youtube-music-cli.git cd youtube-music-cli -
Install dependencies:
bun install
-
Build the project:
bun run build
-
Run in development mode:
bun run dev
This project uses automated code quality tools. The prebuild script runs these
checks automatically before building:
bun run format # Format code with Prettier
bun run format:check # Check formatting without modifyingbun run lint # Lint code with ESLint
bun run lint:fix # Fix linting issues automaticallybun run typecheck # Type check without emittingbun run test # Run prettier check + XO + AVAyoutube-music-cli/
├── source/
│ ├── cli.tsx # CLI entry point
│ ├── app.tsx # React app root
│ ├── components/ # React components
│ │ ├── layouts/ # Main layout containers
│ │ ├── player/ # Player-specific components
│ │ ├── search/ # Search components
│ │ ├── playlist/ # Playlist management
│ │ ├── settings/ # Settings UI
│ │ └── common/ # Shared components
│ ├── services/ # Business logic services
│ │ ├── player/ # Audio playback
│ │ ├── youtube-music/ # API wrapper
│ │ ├── config/ # Configuration persistence
│ │ └── ...
│ ├── stores/ # State management (Context + useReducer)
│ ├── hooks/ # Custom React hooks
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Utility functions
├── tests/ # Test files
└── package.json
Use descriptive branch names:
feature/your-feature-namebugfix/issue-descriptionrefactor/code-section
Follow conventional commits format:
feat: add new featurefix: bug descriptiondocs: update documentationrefactor: code restructuringtest: add tests
- Use ES modules with
.ts/.tsxextensions in imports - Follow the existing code patterns
- Add comments for non-obvious logic
- Update types when adding new data structures
- Discuss first: Open an issue to discuss major features before implementing
- Follow patterns: Use existing service/component patterns
- Add types: Define TypeScript types for new data structures
- Test thoroughly: Test edge cases and error conditions
- Update docs: Update relevant documentation
YouTube Music CLI supports plugins for extending functionality. See the plugin documentation for details on creating your own plugins.
When reporting bugs, please include:
- Your OS and version
- Node.js version (
node --version) - CLI version (
youtube-music-cli --versionif applicable) - mpv version (
mpv --version) - Steps to reproduce the issue
- Expected vs actual behavior
- Error messages or logs
- Fork the repository
- Create a feature branch
- Make your changes following the guidelines above
- Ensure all tests pass (
bun run test) - Commit your changes with clear messages
- Push to your fork
- Open a pull request with a clear description
Your PR should:
- Pass all automated checks
- Include tests for new functionality
- Update documentation if needed
- Follow the existing code style
Feel free to open an issue for questions or discussion about potential contributions. We welcome all contributions!
Thank you for contributing to YouTube Music CLI!