Skip to main content

cMusic

A simple CLI music player written in Python.

NOTICE

Although this player can play any audio file, I do not condone piracy. Please only use this player to play music that you own or have the rights to play. By using this player, you agree to take full responsibility for any legal consequences that may arise from your use of this player.

Table of Contents

Requirements

  • Python 3.12+ & dependencies (should be installed automatically)
  • poetry
  • tmux

Installation

cmusic is available on PyPI, so you can install it using pip.

pip install cmusic

(please make sure that your python scripts directory is in your PATH)

or you can install it from the source code.

git clone https://github.com/Kokonico/cMusic
cd cmusic
pip3.12 install .

Usage

Cmusic currently only supports mp3 files. To use the player, you need to index the songs you want to play first.

# index a song
cmusic index <Song File>

example:

cmusic index "path/to/song.mp3"

it will walk you through the process of indexing the song.

to select options to change, use arrow keys to navigate and space to select.

to play a song, you can use the following command, the name of the song should be the same as the one you set when indexing the song.

cmusic play <Song> [--loop] [--shuffle]

pssst, you can also pass multiple Songs to play them in a row.

cmusic play <Song1> <Song2> <Song3> ...

The player will display the current Song playing, the progress of the Song and the controls.

NOW PLAYING: Altars of Apostasy by Heaven Pierce Her (Ultrakill: Imperfect Hatred (Original Game Soundtrack))
─────────█────────────────────
<< || >> 01:44 / 05:37 ────○ 🔊 100% 🔁

if you want, you can activate background mode by adding the --background flag to the command.

cmusic play <Song> --background

it will play the Song in the background, and you can continue using the terminal.

note: if you want to return to the player, you can use cmusic c

Music Controls

to control the music when it's not in the background, you can use the following keys:

  • space to pause/play the Song.
  • s to skip the current song
  • shift + (+) to increase the volume.
  • shift + (-) to decrease the volume.
  • e to enter background mode.

commands

  • cmusic index <Song File> to index a Song
  • cmusic list to list all the songs in the library.
  • cmusic play <Song> to play a Song.
  • cmusic version to display the version of the player.
  • cmusic search <query> to search for Songs in the library.
  • cmusic del <Song> to delete a song.

background mode commands

  • cmusic p to pause/play the current Song
  • cmusic v <volume> to change the volume of the player.
  • cmusic c to return to the player.
  • cmusic q to quit the player.

playlist commands

  • cmusic playlist create <name> <song>(s) to create a playlist.
  • cmusic playlist add <name> <song>(s) to add a Song to a playlist.
  • cmusic playlist remove <name> <song>(s) to remove a Song from a playlist.
  • cmusic playlist delete <name> to delete a playlist.
  • cmusic playlist list to list all the playlists.
  • cmusic playlist list <name> to list all the Songs in a playlist.
  • cmusic play <playlist name> --playlist to play a playlist.

Development setup

To set up the development environment, you need to have Poetry and python 3.12+ installed on your system.

git clone https://github.com/Kokonico/cMusic
cd cmusic
poetry install

to install the player to use it in the terminal, you can use the following command.

poetry run pip install .

License

This project is licensed under the Zlib License. See the LICENSE file for details.

Metadata

Release files for cmusic 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cmusic 1.2.0
File Size Uploaded
cmusic-1.2.0.tar.gz 18.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cmusic 1.2.0
File Interpreter ABI Platform
cmusic-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.8 kB

Release files / cmusic-1.2.0.tar.gz

Download URL cmusic-1.2.0.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7985f77953a7c780ebe6daf8c482a84b8e821a7f9cf5b48061307ee7298c84a7
BLAKE2b-256 checksum
How to use checksums
f16256e05defd3ab545feb3ca0262537e8b38beeaedf210269dac191eab94d85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.5 Darwin/23.6.0

Release files / cmusic-1.2.0-py3-none-any.whl

Download URL cmusic-1.2.0-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e70168a0d499e308fe3619b6163366578c2343bb0b28956f585c2f54ddf05e5
BLAKE2b-256 checksum
How to use checksums
5023c3077c63d671c06a762ea30d69c64d0cb8f8c027727b6d522389bdc93aae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.5 Darwin/23.6.0

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page