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:151

Handles spotify devices. Lists all available playback devices.


nextCommand

const nextCommand: CommandHandler

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

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


nowCommand

const nowCommand: CommandHandler

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

Handles spotify now.

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


pauseCommand

const pauseCommand: CommandHandler

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

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


playCommand

const playCommand: CommandHandler

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

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:61

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


queueAddCommand

const queueAddCommand: CommandHandler

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

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:117

Handles spotify queue. Outputs the current playback queue.


recentCommand

const recentCommand: CommandHandler

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

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:107

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


seekCommand

const seekCommand: CommandHandler

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

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:97

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


transferCommand

const transferCommand: CommandHandler

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

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

Transfers playback to a different device.


volumeCommand

const volumeCommand: CommandHandler

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

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.