Skip to content

spotify-cli


spotify-cli / commands/player

commands/player

CLI command handlers for playback control.

Variables

devicesCommand

const devicesCommand: CommandHandler

Defined in: src/commands/player.ts:149

Handles spotify devices. Lists all available playback devices.


nextCommand

const nextCommand: CommandHandler

Defined in: src/commands/player.ts:54

Handles spotify next [--device <id>].


nowCommand

const nowCommand: CommandHandler

Defined in: src/commands/player.ts:19

Handles spotify now.

Outputs the currently playing track, or {"status": "not_playing"} if idle.


pauseCommand

const pauseCommand: CommandHandler

Defined in: src/commands/player.ts:48

Handles spotify pause [--device <id>].


playCommand

const playCommand: CommandHandler

Defined in: src/commands/player.ts:29

Handles spotify play [--uri <uri>] [--context <uri>] [--device <id>] [--offset <n>] [--position <ms>].

Starts or resumes playback, optionally targeting a specific device, URI, or position.


prevCommand

const prevCommand: CommandHandler

Defined in: src/commands/player.ts:60

Handles spotify prev [--device <id>].


queueAddCommand

const queueAddCommand: CommandHandler

Defined in: src/commands/player.ts:126

Handles spotify queue add <uri> [--device <id>].

Adds a track to the end of the playback queue.


queueCommand

const queueCommand: CommandHandler

Defined in: src/commands/player.ts:116

Handles spotify queue. Outputs the current playback queue.


recentCommand

const recentCommand: CommandHandler

Defined in: src/commands/player.ts:172

Handles spotify recent [--limit N] [--after <timestamp>] [--before <timestamp>].

Lists recently played tracks with optional cursor-based pagination.


repeatCommand

const repeatCommand: CommandHandler

Defined in: src/commands/player.ts:106

Handles spotify repeat <off|track|context> [--device <id>].


seekCommand

const seekCommand: CommandHandler

Defined in: src/commands/player.ts:70

Handles spotify seek <ms> [--device <id>].

Seeks to a position in the currently playing track. Position must be non-negative.


shuffleCommand

const shuffleCommand: CommandHandler

Defined in: src/commands/player.ts:96

Handles spotify shuffle <on|off> [--device <id>].


transferCommand

const transferCommand: CommandHandler

Defined in: src/commands/player.ts:159

Handles spotify transfer <device_id> [--play].

Transfers playback to a different device.


volumeCommand

const volumeCommand: CommandHandler

Defined in: src/commands/player.ts:84

Handles spotify volume <0-100> [--device <id>].

Sets playback volume. Value must be between 0 and 100 inclusive.

MIT Licensed. Not affiliated with or endorsed by Spotify AB.