cli

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "0.9.0"

Variables

This section is empty.

Functions

func Usage

func Usage() string

func VersionVars

func VersionVars() map[string]string

Types

type AlbumCmd

type AlbumCmd struct {
	Info InfoAlbumCmd `kong:"cmd,help='Album info.'"`
}

type ArtistCmd

type ArtistCmd struct {
	Info InfoArtistCmd `kong:"cmd,help='Artist info.'"`
}

type AuthClearCmd

type AuthClearCmd struct{}

func (*AuthClearCmd) Run

func (cmd *AuthClearCmd) Run(ctx *app.Context) error

type AuthCmd

type AuthCmd struct {
	Status AuthStatusCmd `kong:"cmd,help='Show cookie status.'"`
	Import AuthImportCmd `kong:"cmd,help='Import browser cookies.'"`
	Paste  AuthPasteCmd  `kong:"cmd,help='Paste cookie values from the browser.'"`
	Clear  AuthClearCmd  `kong:"cmd,help='Clear stored cookies.'"`
}

type AuthImportCmd

type AuthImportCmd struct {
	Browser    string `help:"Browser name (chrome|brave|edge|firefox|safari)."`
	Profile    string `name:"browser-profile" help:"Browser profile name."`
	CookiePath string `help:"Cookie cache file path."`
	Domain     string `help:"Cookie domain suffix." default:"spotify.com"`
}

func (*AuthImportCmd) Run

func (cmd *AuthImportCmd) Run(ctx *app.Context) error

type AuthPasteCmd added in v0.3.0

type AuthPasteCmd struct {
	CookiePath string `help:"Cookie cache file path."`
	Domain     string `help:"Cookie domain suffix." default:"spotify.com"`
	Path       string `help:"Cookie path." default:"/"`
}

func (*AuthPasteCmd) Run added in v0.3.0

func (cmd *AuthPasteCmd) Run(ctx *app.Context) error

type AuthStatusCmd

type AuthStatusCmd struct{}

func (*AuthStatusCmd) Run

func (cmd *AuthStatusCmd) Run(ctx *app.Context) error

type CLI

type CLI struct {
	Globals Globals `kong:"embed"`

	Auth     AuthCmd     `kong:"cmd,help='Authentication and cookies.'"`
	Search   SearchCmd   `kong:"cmd,help='Search Spotify.'"`
	Track    TrackCmd    `kong:"cmd,help='Track operations.'"`
	Album    AlbumCmd    `kong:"cmd,help='Album operations.'"`
	Artist   ArtistCmd   `kong:"cmd,help='Artist operations.'"`
	Playlist PlaylistCmd `kong:"cmd,help='Playlist operations.'"`
	Show     ShowCmd     `kong:"cmd,help='Show operations.'"`
	Episode  EpisodeCmd  `kong:"cmd,help='Episode operations.'"`

	Play    PlayCmd    `kong:"cmd,help='Start playback.'"`
	Pause   PauseCmd   `kong:"cmd,help='Pause playback.'"`
	Next    NextCmd    `kong:"cmd,help='Skip to next.'"`
	Prev    PrevCmd    `kong:"cmd,help='Skip to previous.'"`
	Seek    SeekCmd    `kong:"cmd,help='Seek within track.'"`
	Volume  VolumeCmd  `kong:"cmd,help='Set volume.'"`
	Shuffle ShuffleCmd `kong:"cmd,help='Toggle shuffle.'"`
	Repeat  RepeatCmd  `kong:"cmd,help='Set repeat mode.'"`
	Status  StatusCmd  `kong:"cmd,help='Playback status.'"`

	Queue   QueueCmd   `kong:"cmd,help='Queue operations.'"`
	Library LibraryCmd `kong:"cmd,help='Library operations.'"`
	Device  DeviceCmd  `kong:"cmd,help='Playback devices.'"`
}

func New

func New() *CLI

type DeviceCmd

type DeviceCmd struct {
	List DeviceListCmd `kong:"cmd,help='List devices.'"`
	Set  DeviceSetCmd  `kong:"cmd,help='Set active device.'"`
}

type DeviceListCmd

type DeviceListCmd struct{}

func (*DeviceListCmd) Run

func (cmd *DeviceListCmd) Run(ctx *app.Context) error

type DeviceSetCmd

type DeviceSetCmd struct {
	Device string `arg:"" required:"" help:"Device name or id."`
}

func (*DeviceSetCmd) Run

func (cmd *DeviceSetCmd) Run(ctx *app.Context) error

type EpisodeCmd

type EpisodeCmd struct {
	Info InfoEpisodeCmd `kong:"cmd,help='Episode info.'"`
}

type Globals

type Globals struct {
	Config   string           `help:"Config file path." env:"SPOGO_CONFIG"`
	Profile  string           `help:"Profile name." env:"SPOGO_PROFILE"`
	Timeout  time.Duration    `help:"HTTP timeout." env:"SPOGO_TIMEOUT" default:"10s"`
	Market   string           `help:"Market country code." env:"SPOGO_MARKET"`
	Language string           `help:"Language/locale." env:"SPOGO_LANGUAGE"`
	Device   string           `help:"Device name or id." env:"SPOGO_DEVICE"`
	Engine   string           `help:"Engine (auto|web|connect|applescript)." env:"SPOGO_ENGINE"`
	JSON     bool             `help:"JSON output." env:"SPOGO_JSON"`
	Plain    bool             `help:"Plain output." env:"SPOGO_PLAIN"`
	NoColor  bool             `help:"Disable color output." env:"SPOGO_NO_COLOR"`
	Quiet    bool             `short:"q" help:"Quiet output." env:"SPOGO_QUIET"`
	Verbose  bool             `short:"v" help:"Verbose output." env:"SPOGO_VERBOSE"`
	Debug    bool             `short:"d" help:"Debug output." env:"SPOGO_DEBUG"`
	NoInput  bool             `help:"Disable prompts." env:"SPOGO_NO_INPUT"`
	Version  kong.VersionFlag `help:"Print version."`
}

func (Globals) Settings

func (g Globals) Settings() (app.Settings, error)

type InfoAlbumCmd

type InfoAlbumCmd struct{ InfoArgs }

func (*InfoAlbumCmd) Run

func (cmd *InfoAlbumCmd) Run(ctx *app.Context) error

type InfoArgs

type InfoArgs struct {
	ID string `arg:"" required:"" help:"Spotify ID, URI, or URL."`
}

type InfoArtistCmd

type InfoArtistCmd struct{ InfoArgs }

func (*InfoArtistCmd) Run

func (cmd *InfoArtistCmd) Run(ctx *app.Context) error

type InfoEpisodeCmd

type InfoEpisodeCmd struct{ InfoArgs }

func (*InfoEpisodeCmd) Run

func (cmd *InfoEpisodeCmd) Run(ctx *app.Context) error

type InfoPlaylistCmd

type InfoPlaylistCmd struct{ InfoArgs }

func (*InfoPlaylistCmd) Run

func (cmd *InfoPlaylistCmd) Run(ctx *app.Context) error

type InfoShowCmd

type InfoShowCmd struct{ InfoArgs }

func (*InfoShowCmd) Run

func (cmd *InfoShowCmd) Run(ctx *app.Context) error

type InfoTrackCmd

type InfoTrackCmd struct{ InfoArgs }

func (*InfoTrackCmd) Run

func (cmd *InfoTrackCmd) Run(ctx *app.Context) error

type LibraryAlbumsAddCmd

type LibraryAlbumsAddCmd struct {
	IDs []string `arg:"" required:"" help:"Album IDs/URLs/URIs."`
}

func (*LibraryAlbumsAddCmd) Run

func (cmd *LibraryAlbumsAddCmd) Run(ctx *app.Context) error

type LibraryAlbumsCmd

type LibraryAlbumsCmd struct {
	List   LibraryAlbumsListCmd   `kong:"cmd,help='List saved albums.'"`
	Add    LibraryAlbumsAddCmd    `kong:"cmd,help='Save albums.'"`
	Remove LibraryAlbumsRemoveCmd `kong:"cmd,help='Remove saved albums.'"`
}

type LibraryAlbumsListCmd

type LibraryAlbumsListCmd struct {
	Limit  int `help:"Limit results." default:"50"`
	Offset int `help:"Offset results." default:"0"`
}

func (*LibraryAlbumsListCmd) Run

func (cmd *LibraryAlbumsListCmd) Run(ctx *app.Context) error

type LibraryAlbumsRemoveCmd

type LibraryAlbumsRemoveCmd struct {
	IDs []string `arg:"" required:"" help:"Album IDs/URLs/URIs."`
}

func (*LibraryAlbumsRemoveCmd) Run

func (cmd *LibraryAlbumsRemoveCmd) Run(ctx *app.Context) error

type LibraryArtistsCmd

type LibraryArtistsCmd struct {
	List     LibraryArtistsListCmd     `kong:"cmd,help='List followed artists.'"`
	Follow   LibraryArtistsFollowCmd   `kong:"cmd,help='Follow artists.'"`
	Unfollow LibraryArtistsUnfollowCmd `kong:"cmd,help='Unfollow artists.'"`
}

type LibraryArtistsFollowCmd

type LibraryArtistsFollowCmd struct {
	IDs []string `arg:"" required:"" help:"Artist IDs/URLs/URIs."`
}

func (*LibraryArtistsFollowCmd) Run

func (cmd *LibraryArtistsFollowCmd) Run(ctx *app.Context) error

type LibraryArtistsListCmd

type LibraryArtistsListCmd struct {
	Limit  int    `help:"Limit results." default:"50"`
	After  string `help:"Artist ID to start after (pagination)."`
	Offset int    `help:"Offset results (not supported by Spotify)."`
}

func (*LibraryArtistsListCmd) Run

func (cmd *LibraryArtistsListCmd) Run(ctx *app.Context) error

type LibraryArtistsUnfollowCmd

type LibraryArtistsUnfollowCmd struct {
	IDs []string `arg:"" required:"" help:"Artist IDs/URLs/URIs."`
}

func (*LibraryArtistsUnfollowCmd) Run

func (cmd *LibraryArtistsUnfollowCmd) Run(ctx *app.Context) error

type LibraryCmd

type LibraryCmd struct {
	Tracks    LibraryTracksCmd    `kong:"cmd,help='Track library.'"`
	Albums    LibraryAlbumsCmd    `kong:"cmd,help='Album library.'"`
	Artists   LibraryArtistsCmd   `kong:"cmd,help='Artist library.'"`
	Playlists LibraryPlaylistsCmd `kong:"cmd,help='Playlist library.'"`
}

type LibraryPlaylistsCmd

type LibraryPlaylistsCmd struct {
	List LibraryPlaylistsListCmd `kong:"cmd,help='List playlists.'"`
}

type LibraryPlaylistsListCmd

type LibraryPlaylistsListCmd struct {
	Limit  int `help:"Limit results." default:"50"`
	Offset int `help:"Offset results." default:"0"`
}

func (*LibraryPlaylistsListCmd) Run

func (cmd *LibraryPlaylistsListCmd) Run(ctx *app.Context) error

type LibraryTracksAddCmd

type LibraryTracksAddCmd struct {
	IDs []string `arg:"" required:"" help:"Track IDs/URLs/URIs."`
}

func (*LibraryTracksAddCmd) Run

func (cmd *LibraryTracksAddCmd) Run(ctx *app.Context) error

type LibraryTracksCmd

type LibraryTracksCmd struct {
	List   LibraryTracksListCmd   `kong:"cmd,help='List saved tracks.'"`
	Add    LibraryTracksAddCmd    `kong:"cmd,help='Save tracks.'"`
	Remove LibraryTracksRemoveCmd `kong:"cmd,help='Remove saved tracks.'"`
}

type LibraryTracksListCmd

type LibraryTracksListCmd struct {
	Limit  int `help:"Limit results." default:"50"`
	Offset int `help:"Offset results." default:"0"`
}

func (*LibraryTracksListCmd) Run

func (cmd *LibraryTracksListCmd) Run(ctx *app.Context) error

type LibraryTracksRemoveCmd

type LibraryTracksRemoveCmd struct {
	IDs []string `arg:"" required:"" help:"Track IDs/URLs/URIs."`
}

func (*LibraryTracksRemoveCmd) Run

func (cmd *LibraryTracksRemoveCmd) Run(ctx *app.Context) error

type NextCmd

type NextCmd struct{}

func (*NextCmd) Run

func (cmd *NextCmd) Run(ctx *app.Context) error

type PauseCmd

type PauseCmd struct{}

func (*PauseCmd) Run

func (cmd *PauseCmd) Run(ctx *app.Context) error

type PlayCmd

type PlayCmd struct {
	Item    string `arg:"" optional:"" help:"Spotify ID/URL/URI."`
	Type    string `help:"Type for raw IDs (track|album|playlist|show|episode)."`
	Shuffle bool   `help:"Enable shuffle before playing."`
}

func (*PlayCmd) Run

func (cmd *PlayCmd) Run(ctx *app.Context) error

type PlaylistAddCmd

type PlaylistAddCmd struct {
	Playlist string   `arg:"" required:"" help:"Playlist ID/URL/URI."`
	Tracks   []string `arg:"" required:"" help:"Track IDs/URLs/URIs."`
}

func (*PlaylistAddCmd) Run

func (cmd *PlaylistAddCmd) Run(ctx *app.Context) error

type PlaylistCmd

type PlaylistCmd struct {
	Info   InfoPlaylistCmd   `kong:"cmd,help='Playlist info.'"`
	Create PlaylistCreateCmd `kong:"cmd,help='Create playlist.'"`
	Add    PlaylistAddCmd    `kong:"cmd,help='Add tracks to playlist.'"`
	Remove PlaylistRemoveCmd `kong:"cmd,help='Remove tracks from playlist.'"`
	Tracks PlaylistTracksCmd `kong:"cmd,help='List playlist tracks.'"`
}

type PlaylistCreateCmd

type PlaylistCreateCmd struct {
	Name   string `arg:"" required:"" help:"Playlist name."`
	Public bool   `help:"Create public playlist."`
	Collab bool   `help:"Create collaborative playlist."`
}

func (*PlaylistCreateCmd) Run

func (cmd *PlaylistCreateCmd) Run(ctx *app.Context) error

type PlaylistRemoveCmd

type PlaylistRemoveCmd struct {
	Playlist string   `arg:"" required:"" help:"Playlist ID/URL/URI."`
	Tracks   []string `arg:"" required:"" help:"Track IDs/URLs/URIs."`
}

func (*PlaylistRemoveCmd) Run

func (cmd *PlaylistRemoveCmd) Run(ctx *app.Context) error

type PlaylistTracksCmd

type PlaylistTracksCmd struct {
	Playlist string `arg:"" required:"" help:"Playlist ID/URL/URI."`
	Limit    int    `help:"Limit results." default:"50"`
	Offset   int    `help:"Offset results." default:"0"`
}

func (*PlaylistTracksCmd) Run

func (cmd *PlaylistTracksCmd) Run(ctx *app.Context) error

type PrevCmd

type PrevCmd struct{}

func (*PrevCmd) Run

func (cmd *PrevCmd) Run(ctx *app.Context) error

type QueueAddCmd

type QueueAddCmd struct {
	Item string `arg:"" required:"" help:"Track URI/URL/ID."`
}

func (*QueueAddCmd) Run

func (cmd *QueueAddCmd) Run(ctx *app.Context) error

type QueueClearCmd

type QueueClearCmd struct{}

func (*QueueClearCmd) Run

func (cmd *QueueClearCmd) Run(ctx *app.Context) error

type QueueCmd

type QueueCmd struct {
	Add   QueueAddCmd   `kong:"cmd,help='Add to queue.'"`
	Show  QueueShowCmd  `kong:"cmd,help='Show queue.'"`
	Clear QueueClearCmd `kong:"cmd,help='Clear queue (if supported).'"`
}

type QueueShowCmd

type QueueShowCmd struct{}

func (*QueueShowCmd) Run

func (cmd *QueueShowCmd) Run(ctx *app.Context) error

type RepeatCmd

type RepeatCmd struct {
	Mode string `arg:"" required:"" help:"off|track|context."`
}

func (*RepeatCmd) Run

func (cmd *RepeatCmd) Run(ctx *app.Context) error

type SearchAlbumCmd

type SearchAlbumCmd struct{ SearchArgs }

func (*SearchAlbumCmd) Run

func (cmd *SearchAlbumCmd) Run(ctx *app.Context) error

type SearchArgs

type SearchArgs struct {
	Query  string `arg:"" required:"" help:"Search query."`
	Limit  int    `help:"Limit results." default:"20"`
	Offset int    `help:"Offset results." default:"0"`
}

type SearchArtistCmd

type SearchArtistCmd struct{ SearchArgs }

func (*SearchArtistCmd) Run

func (cmd *SearchArtistCmd) Run(ctx *app.Context) error

type SearchCmd

type SearchCmd struct {
	Track    SearchTrackCmd    `kong:"cmd,help='Search tracks.'"`
	Album    SearchAlbumCmd    `kong:"cmd,help='Search albums.'"`
	Artist   SearchArtistCmd   `kong:"cmd,help='Search artists.'"`
	Playlist SearchPlaylistCmd `kong:"cmd,help='Search playlists.'"`
	Episode  SearchEpisodeCmd  `kong:"cmd,help='Search episodes.'"`
	Show     SearchShowCmd     `kong:"cmd,help='Search shows.'"`
}

type SearchEpisodeCmd

type SearchEpisodeCmd struct{ SearchArgs }

func (*SearchEpisodeCmd) Run

func (cmd *SearchEpisodeCmd) Run(ctx *app.Context) error

type SearchPlaylistCmd

type SearchPlaylistCmd struct{ SearchArgs }

func (*SearchPlaylistCmd) Run

func (cmd *SearchPlaylistCmd) Run(ctx *app.Context) error

type SearchShowCmd

type SearchShowCmd struct{ SearchArgs }

func (*SearchShowCmd) Run

func (cmd *SearchShowCmd) Run(ctx *app.Context) error

type SearchTrackCmd

type SearchTrackCmd struct{ SearchArgs }

func (*SearchTrackCmd) Run

func (cmd *SearchTrackCmd) Run(ctx *app.Context) error

type SeekCmd

type SeekCmd struct {
	Position string `arg:"" required:"" help:"Position ms or mm:ss."`
}

func (*SeekCmd) Run

func (cmd *SeekCmd) Run(ctx *app.Context) error

type ShowCmd

type ShowCmd struct {
	Info InfoShowCmd `kong:"cmd,help='Show info.'"`
}

type ShuffleCmd

type ShuffleCmd struct {
	State string `arg:"" required:"" help:"on|off."`
}

func (*ShuffleCmd) Run

func (cmd *ShuffleCmd) Run(ctx *app.Context) error

type StatusCmd

type StatusCmd struct{}

func (*StatusCmd) Run

func (cmd *StatusCmd) Run(ctx *app.Context) error

type TrackCmd

type TrackCmd struct {
	Info InfoTrackCmd `kong:"cmd,help='Track info.'"`
}

type VolumeCmd

type VolumeCmd struct {
	Level int `arg:"" required:"" help:"Volume 0-100."`
}

func (*VolumeCmd) Run

func (cmd *VolumeCmd) Run(ctx *app.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL