Hi HN,

I created kew, a music player for the Linux terminal.

This started when I asked myself: what if I could just type something like "play nirvana" in the terminal and have the rest taken care of automatically? That got the ball rolling and I kept adding stuff: covers in ascii and then as sixel images, a playlist view, a visualizer, a library view and finally search.

While kew can be used as a commandline tool, it has evolved into a TUI app.

Here are some example commands:

kew nirvana # Plays all of your Nirvana songs, shuffled

kew nevermind # Plays the "Nevermind" album in order

kew spirit # Plays "Smells Like Teen Spirit"

kew all # Plays all your music, shuffled

kew albums # Plays one album after the other in random order

It works best when your music library is organized like this: Artist/Album(s)/Track(s)

kew is written in C and licensed under GPLv2.

Source and screenshot: https://github.com/ravachol/kew

  • martinbaun 10 hours ago |
    This is exactly what I was looking for! I actually started writing something myself.

    And I "compiled from source" as I am using Fedora, but it was just one command.

    Thank you!

    • ravachol 10 hours ago |
      Glad you are liking it!
  • atrus 10 hours ago |
    I love the readme, and I wish that every project had one this great. And it player looks awesome as well!
    • ravachol 10 hours ago |
      Thanks, yes the readme is really important. A lot of projects would benefit from spending a bit more time on it.
    • politelemon 8 hours ago |
      I agree, the README makes me want to try it tonight when I get home. This project is very interesting and worth trying.
  • kopirgan 10 hours ago |
    Requires Debian 13?
    • ravachol 10 hours ago |
      You know I'm not sure. I think there was some problem with FFmpeg in earlier versions, but I'm not 100% sure. There shouldn't be a problem trying to install it in earlier versions though.
  • BoingBoomTschak 9 hours ago |
    It's is pretty cool, I can feel the energy poured into making your personal computing experience more seamless! Though the first thing I wondered when reading your examples is "how is ambiguity resolved?". Like albums, artists and tracks having the same string or sharing a prefix (search in this specific order, I guess?); or artists having the exact same name.

    The aspect I like the most is using the filesystem as a database, since that's what UNIX people should like (and you can use symlinks for more complex cases). In fact, I myself made a music player with that as central philosophy, though it is much more bare/suckless compared to yours: https://git.sr.ht/~q3cpma/mus

    Did you consider implementing a simple event system (maybe even IPC) for track and status change? Possibly MPRIS or something simpler. That was the main feature I kept from cmus when creating mus, so that I can easily interact with it through lemonbar and scripts.

    • ravachol 9 hours ago |
      Thank you. To answer your first question, ambiguity isn't resolved unfortunately. When the album has the same name as the artist for instance, I have sometimes resorted to renaming the album name by adding "album" to it. You can however get an exact search by adding -e so that resolves some problems.

      Yes, MPRIS is supported.

  • leapon 9 hours ago |
    brew install failed on macos

    % brew install kew

    ...

    kew: Linux is required for this software.

    Error: kew: An unsatisfied requirement failed this build.

    • ravachol 9 hours ago |
      Yes, unfortunately it only works on Linux and FreeBSD. I should add that to the readme.

      EDIT: Added.

      • jeffhuys 4 hours ago |
        Why, though?
        • jhatemyjob 3 hours ago |
          Cus they like Stallman too much
  • VyseofArcadia 8 hours ago |
    Slick! I love it.

    It doesn't fit my use-case very well, though. I'm not saying it needs to, but I'm going to put my use-case out there in case someone is looking for project ideas.

    We have oodles of music players on Linux, GUI and terminal. But we have very few choices that

    * are optimized for the absurdly, comically large library of someone who has been diligently collecting and organizing music for decades

    * collect playback statistics and allow user rating of songs

    * that can be used to create smart playlists

    I used amarok for years, but it keeps dying and reviving, and I don't trust it to stick around. I then used mpd for years, but while mpd excels at large libraries, the other two requirements have to be implemented client-side, and the experience was always at least a little janky. I currently use Strawberry, but 1) it chugs with a large library, 2) its smart playlists aren't expressive enough, and 3) it is also kind of janky, and I experience frequent crashes.

    The only player I've found that really fits my use-case like a glove is MediaMonkey, but I walked away from Microsoft years ago, and I'm not about to go back now just to wrangle my music library.

    • ravachol 8 hours ago |
      Yes, while a comically large music library is supported in principle (kew offers to cache your library if it takes a long time to search through), it might not be entirely suited for it.

      As for your other two suggestions those fall outside the scope of kew. kew is supposed to be simple with minimal bloat.

      • VyseofArcadia 6 hours ago |
        I will by trying it out on my laptop which has only a fraction of my library and I don't use often enough to want statistics or smart playlists.
    • sandreas 7 hours ago |
      Nice, thanks for sharing your thoughts. Currently, I use navidrome[1], which not really is a player but more a music server, but since it supports the "subsonic" protocol, you can use native apps to connect and manage your stuff (substreamer for android / iOS is all I really need but navidrome also comes with a handy web interface). It also has support for json based smart playlists[2].

      1: https://www.navidrome.org/ 2: https://github.com/navidrome/navidrome/issues/1417

      • worble 7 hours ago |
        Just to add an alternative, I'm using Airsonic Advanced[0] as my subsonic server of choice if for only one reason: it properly supports folder navigation. I've ranted about this before (looking at you Jellyfin) but my folder layout is sacred and any media service I use needs to respect it.

        For an android client I use tempo[1] which again was one I landed on because pretty much all the other clients didn't support folder lookup either (I think dsub also does but tempo is a lot prettier).

        0: https://github.com/kagemomiji/airsonic-advanced

        1: https://github.com/CappielloAntonio/tempo

      • VyseofArcadia 6 hours ago |
        That looks like it checks most of my boxes, but I have a personal/philosophical objection to running a service. The objection is, I don't want to[0]. I just want a local application. Not local-first, I want local-only. Just an application.

        [0] and also I think it's insane to add that much complexity to something that is single-user.

        • sandreas 5 hours ago |
          Totally understandable. I recently thought of developing a cross platform player in C# and AvaloniaUI, but cross platform audio is not as easy as it seems, especially trying to use open source libs only and minimizing dependencies.
        • lunchables an hour ago |
          I'm also a navidrome user and I run it via docker exposed via traefik so I can access my music anywhere. I can use any subsonic client on android or iOS and I can bluetooth that to my car or headphones or whatever and I can load it up on my laptop anywhere.

          As you've said you just want a local application just wanted to mention that in case that's actually something that might also be useful for you.

    • amlib 7 hours ago |
      Strawberry is a pretty solid Amarok fork that is picking up steam. They are now releasing multiple releases a month and in my opinion it's a great "fully featured", gui first, easy to use player that handles large libraries well.
  • cdaringe 8 hours ago |
    I love the idea. My music is now 50% cloud only, 50% on disk. I mean, its 100% in the cloud, i just have local files for half available. Ive been thinking about self hosting some music provider thingy (or even just supporting ssh via my dyndns-like capability) to my NAS and bringing music back to self owned files. However, it is work to do when the internet is pretty reliable, costs are low, etc.

    Those who love this conceptually but have/had cloud music, did you act? How/why?

    • reverend_gonzo 5 hours ago |
      I have a airsonic (fork of subsonic, which I used for a long time) server running on a vps. I’ve probably had this for coming on 20 years now.

      It works phenomenally.

      At some point I was going to mirror it locally, but never got around to it.

      It is all backed up in dropbox

      • lunchables 2 hours ago |
        I've also been a long time airsonic (and now airsonic-advanced) user for so long I can't even remember, but a couple years ago I switched to navidrome which is also subsonic compatible and it's sooo much nicer.

        Use whatever you want! Just wanted to suggest it.

    • nvllsvm 3 hours ago |
      I used various Subsonic clients for a number of years, but the clients were always lacking. Android clients were buggy or didn't prioritize local caching and I preferred to use mpd+ncmpcpp on my laptop.

      I ended up switching to fully-local media after realizing that my 956GB flac+mp3 would be ~159GB when converted to Opus. I now use https://github.com/nvllsvm/harmonize to maintain a 128kbps Opus version of my main library and Syncthing to synchronize it to my phone and laptop.

      --- side note, Auxio is the client I'm using on Android with my synced library.

  • molticrystal 8 hours ago |
    mpv --vo=caca
  • edgarvaldes 8 hours ago |
    Random album is great. Few players do it right.
  • udev4096 7 hours ago |
    I personally use a self hosted musikcube server [0] for playing songs. It has a great TUI and an android app. Highly recommended!

    [0] - https://musikcube.com/

  • kunley 7 hours ago |
    Apart from all the audio goodies, that's one of the few projects around that has actually working make uninstall.

    So much thanks for giving a good example

    • ravachol 7 hours ago |
      You uninstalled it. :(
      • kunley 5 hours ago |
        No, I didn't! But I was happy to see such a makefile target exists and one doesn't need to go through console logs to see wtf was installed, or just shrug and think "yet another project made like it's the center of the universe"
        • ravachol 5 hours ago |
          Oh ok, my bad! And GOOD.

          I agree it's important. kew is so small it was pretty trivial to do.

  • mass_and_energy 5 hours ago |
    Hmm I wonder how hard this would be to hook into my Jellyfin server, has anybody tried?
  • whoomp12342 4 hours ago |
    great, now my coworkers will have a new interesting way of rick rolling me -> while I run my build scripts
  • smartmic 4 hours ago |
    I use mpd with various clients, mostly also from terminal. mpd support would be great - and actually the only reason for me to try it out.

    https://www.musicpd.org/

  • jakobdabo 3 hours ago |
    I see what you've done there!

            int randomNumber = getRandomNumber(1, 808);
            if (randomNumber == 808)
                    printGlimmeringText(text, nerdFontText, lastRowColor);
    
    Nice project!
    • ravachol 3 hours ago |
      That's an easter egg! Gj! You're the first that has mentioned it.
  • n2j3 3 hours ago |
    Cool, but does it scrobble?
    • ravachol 3 hours ago |
      kew does not scrobble. It does not track any of your listening habits or anything else for that matter.
  • sigmonsays 3 hours ago |
    Trying to nix run it I get a ton of insecure warnings and it lists the CVEs

    Is this a nix thing (i'm unsure what freeimage-unstable is)

           error: Package ‘freeimage-unstable-2021-11-01’ in /nix/store/20yis5w6g397plssim663hqxdiiah2wr-source/pkgs/development/libraries/freeimage/default.nix:72 is marked as insecure, refusing to evaluate.
    
    
           Known issues:
            - CVE-2021-33367
            - CVE-2021-40262
            - CVE-2021-40263
            - CVE-2021-40264
            - CVE-2021-40265
            - CVE-2021-40266
            - CVE-2023-47992
            - CVE-2023-47993
            - CVE-2023-47994
            - CVE-2023-47995
            - CVE-2023-47996
    • ravachol 3 hours ago |
      FreeImage is used by Chafa to display the covers in the terminal.

      The version of kew packaged for Nix is very old: v1.5.2. We're at version 2.8.2. So it's more than a year old, from very early on in the project.

    • ravachol 3 hours ago |
      "Buffer Overflow vulnerability in Freeimage v3.18.0 allows attacker to cause a denial of service via a crafted JXR file."

      I don't know how relevant these vulnerabilities are to kew, which isn't run across the network in any way, it just reads your local files.

      Thank you for bringing this to light. I don't know how feasible it is to use something other than freeimage though, gonna have to investigate.

  • cebu_blue an hour ago |
    KekW
  • theandrewbailey an hour ago |

        sudo bash -c "curl https://raw.githubusercontent.com/ravachol/kew/main/install.sh | bash"
    
    Might as well run unsigned binaries straight from the internet. What is this, Windows?
    • ravachol an hour ago |
      Good point. Might be better to just have the commands installing the requirements for the different distros, in the readme.
    • shepherdjerred 42 minutes ago |
      Super weird to bring Windows into this, but, anyway? I actually really like these one liners even if they have greater potential for abuse.
      • halJordan 22 minutes ago |
        It's not weird to mention the other os where downloading and blindly double-clicking a naked exe is the standard.
      • ravachol 17 minutes ago |
        He's right actually the quick-install script is pretty barbaric.