Convert Figma logo to code with AI

hrkfdn logoncspot

Cross-platform ncurses Spotify client written in Rust, inspired by ncmpc and the likes.

4,927
204
4,927
139

Top Related Projects

a cross-platform, terminal-based music player, audio engine, metadata indexer, and server in c++

Spotify for the terminal written in Rust 🚀

A spotify daemon

Open Source Spotify client library

1,977

Semi-automatic OSINT framework and package manager

Quick Overview

ncspot is a cross-platform ncurses Spotify client written in Rust. It aims to provide a lightweight, fast, and feature-rich terminal-based interface for Spotify, allowing users to control and enjoy their music without leaving the command line.

Pros

  • Lightweight and resource-efficient compared to the official Spotify client
  • Cross-platform support (Linux, macOS, Windows)
  • Vim-like keybindings for efficient navigation
  • Customizable interface and keybindings

Cons

  • Requires a Spotify Premium account
  • Limited visualizations compared to the official client
  • Some features may be missing or less polished than the official client
  • Potential learning curve for users not familiar with terminal-based applications

Getting Started

  1. Install Rust and Cargo (Rust's package manager)
  2. Clone the repository:
    git clone https://github.com/hrkfdn/ncspot.git
    cd ncspot
    
  3. Build and run ncspot:
    cargo run --release
    
  4. On first run, you'll be prompted to log in to your Spotify account
  5. Use '?' to view keybindings and start exploring the interface

Note: Make sure you have the necessary dependencies installed for your operating system. Refer to the project's README for detailed instructions specific to your platform.

Competitor Comparisons

a cross-platform, terminal-based music player, audio engine, metadata indexer, and server in c++

Pros of musikcube

  • Cross-platform support (Windows, macOS, Linux)
  • Supports various audio formats and streaming services
  • Offers a plugin system for extensibility

Cons of musikcube

  • Larger codebase and potentially more complex to maintain
  • May have a steeper learning curve for new users
  • Requires more system resources due to its broader feature set

Code comparison

musikcube (C++):

void Player::Play(size_t index, ITrack* track) {
    this->Stop();
    this->QueueTrack(track);
    this->Play();
}

ncspot (Rust):

pub fn play(&mut self) -> Result<(), Error> {
    self.player.play()?;
    self.update_state(PlayerState::Playing);
    Ok(())
}

Key differences

  • Language: musikcube is written in C++, while ncspot is in Rust
  • Scope: musikcube is a full-featured music player, ncspot focuses on Spotify
  • UI: musikcube has a more complex UI with multiple views, ncspot has a simpler, Spotify-centric interface
  • Dependencies: musikcube relies on various libraries for audio playback and UI, ncspot primarily uses Spotify's libspotify

Both projects aim to provide terminal-based music playback experiences, but with different focuses and implementation approaches.

Spotify for the terminal written in Rust 🚀

Pros of spotify-tui

  • Written in Rust, offering better performance and memory safety
  • More extensive and customizable UI with multiple views and layouts
  • Supports a wider range of Spotify features, including playlist management and radio

Cons of spotify-tui

  • Requires a separate Spotify daemon (spotifyd) for playback
  • Less stable and more prone to API-related issues
  • Steeper learning curve due to more complex UI and keybindings

Code Comparison

spotify-tui (Rust):

pub fn new(config: Config, credentials: Credentials) -> Result<Client> {
    let oauth = OAuth {
        redirect_uri: "http://localhost:8888/callback".to_string(),
        scopes: scopes(),
        ..Default::default()
    };
    let cache = Cache::new(Some(credentials))?;
    Ok(Client::new(config, oauth, cache))
}

ncspot (Rust):

pub fn new(config: Config) -> Result<Spotify> {
    let session_config = SessionConfig::default();
    let credentials = Credentials::with_password(&config.username, &config.password);
    let session = Session::connect(session_config, credentials)?;
    Ok(Spotify::new(session, config))
}

Both projects use Rust and implement similar client initialization patterns, but spotify-tui relies on OAuth for authentication, while ncspot uses a simpler username/password approach.

A spotify daemon

Pros of Spotifyd

  • Lightweight and runs as a daemon, consuming fewer system resources
  • Supports multiple audio backends (ALSA, PulseAudio, PortAudio)
  • Can be controlled remotely using Spotify Connect

Cons of Spotifyd

  • Lacks a built-in user interface, requiring external control
  • Limited functionality compared to a full-featured client
  • May require additional setup for optimal audio output

Code Comparison

Spotifyd (Rust):

let (mut stream, creds) = Session::connect(config, credentials, cache, true).await?;
let (player, mixer) = audio_setup();
let mut spirc = Spirc::new(config, session, player, mixer, ident);

ncspot (Rust):

let spotify = Spotify::new(config.clone(), session.clone(), player.clone());
let queue = Queue::new(config.clone(), session.clone(), spotify.clone());
let command = Command::new(queue.clone(), spotify.clone());

Both projects are written in Rust and use similar patterns for session management and audio playback. Spotifyd focuses on backend functionality, while ncspot includes user interface components and a more comprehensive feature set for direct user interaction.

Open Source Spotify client library

Pros of librespot

  • More comprehensive Spotify API implementation
  • Supports a wider range of Spotify features
  • Can be used as a library for other projects

Cons of librespot

  • Lacks a user interface
  • Requires more setup and configuration
  • Not designed for direct end-user interaction

Code Comparison

librespot (Rust):

let session = Session::connect(config, credentials, cache, player_event_channel).await?;
let (mut player, _) = Player::new(config, session.clone(), None, move |_| {});
player.load(track_id, true, 0);
player.play();

ncspot (Rust):

let spotify = Spotify::new(config);
spotify.login(username, password)?;
let track = spotify.track(track_id)?;
spotify.player().load(track, true, 0);
spotify.player().play();

Summary

librespot is a more comprehensive Spotify client library, offering broader API coverage and flexibility for developers. However, it lacks a user interface and requires more setup. ncspot, on the other hand, provides a user-friendly terminal-based interface but may have limited features compared to librespot. The code comparison shows similarities in basic playback functionality, with librespot potentially offering more granular control over the session and player components.

1,977

Semi-automatic OSINT framework and package manager

Pros of sn0int

  • Focused on OSINT and security research, offering a wide range of modules for information gathering
  • Provides a structured database for storing and querying collected data
  • Supports scripting and automation for complex reconnaissance tasks

Cons of sn0int

  • Steeper learning curve due to its specialized nature and command-line interface
  • Less user-friendly for casual users compared to ncspot's music-focused interface
  • Requires more setup and configuration for specific use cases

Code Comparison

sn0int (Rust):

pub fn run() -> Result<()> {
    let args = cli::parse();
    let mut runtime = Runtime::new(args)?;
    runtime.run()
}

ncspot (Rust):

fn main() {
    let opts: Opts = Opts::parse();
    let mut app = App::new(opts);
    app.run();
}

Both projects use Rust and have similar main function structures, but sn0int's code reflects its more complex nature with additional error handling and runtime management.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

ncspot logo

An ncurses Spotify client written in Rust using librespot

Crates.io Gitter

ncspot search tab

ncspot is an ncurses Spotify client written in Rust using librespot. It is heavily inspired by ncurses MPD clients, such as ncmpc. My motivation was to provide a simple and resource friendly alternative to the official client as well as to support platforms that currently don't have a Spotify client, such as the *BSDs.

ncspot only works with a Spotify premium account as it offers features that are not available for free accounts.

Features

  • Support for tracks, albums, playlists, genres, searching...
  • Small resource footprint
  • Support for a lot of platforms
  • Vim keybindings out of the box
  • IPC socket for remote control
  • Automatic authentication using a password manager

Installation

ncspot is available on macOS (Homebrew), Windows (Scoop, WinGet), Linux (native package, Flathub and Snapcraft) and the BSD's. Detailed installation instructions for each platform can be found here.

Configuration

A configuration file can be provided. The default location is ~/.config/ncspot. Detailed configuration information can be found here.

Building

Building ncspot requires a working Rust installation and a Python 3 installation. To compile ncspot, run cargo build. For detailed instructions on building ncspot, there is more information here.

Packaging

Information about provided files, how to generate some of them and current package status accross platforms can be found here.