id = "splash-cli" name = "Splash CLI" homepage = "https://github.com/rawnly/splash-cli" description = "A simple CLI to download Unsplash wallpapers. Nothing fancy, it just works." # The published binary is `splash`: .goreleaser.yaml has project_name: splash # and builds.binary: splash. The id keeps the project's own name because # `splash` on its own is claimed by several unrelated things. executables = ["splash"] [dotfiles] # rawnly/splash-cli, main.go init(): # viper.SetConfigType("json") # viper.SetConfigName("splash-cli") # viper.AddConfigPath("$HOME/.config") # viper.AddConfigPath("$HOME/.splash-cli") # viper.SafeWriteConfig() creates the first of those, so ~/.config/splash-cli.json # is the usual one and ~/.splash-cli/splash-cli.json the fallback location. paths = ["~/.config/splash-cli.json", "~/.splash-cli/splash-cli.json"] exclude = [] # Not a whole-file secret: download_dir, auto_like_photos and # collection_aliases are the settings the file exists for. The OAuth pair is # lifted out below. secret = [] # Read at startup, written back when a command changes a setting; no resident # process. side_effect = false # Both spellings, or the Unsplash tokens only get lifted out on a machine that # happens to use the ~/.config location. config/default_config.go: # type authConfig struct { # AccessToken string `json:"access_token"` # RefreshToken string `json:"refresh_token"` # } # stored under the `auth` key of the same document. [[dotfiles.secret_paths]] file = ["~/.config/splash-cli.json", "~/.splash-cli/splash-cli.json"] match = { key_path = ["auth.access_token", "auth.refresh_token"] } [commands] format = 1 label = "Get an Unsplash photo" description = "Download an Unsplash photo and set it as wallpaper, or only save it. Collection, topic and user filters, scale, screen and the auth/alias/settings subcommands are left out." quality = "ai-draft" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "help" kind = "help" url = "https://raw.githubusercontent.com/rawnly/splash-cli/HEAD/README.md" evidence = """ $ splash --day $ splash --query "mountains" --orientation "landscape" --day Retrieve the photo of the day --id string Retrieve a single photo by ID --no-cache Ignore cache -o, --orientation string Filter by photo orientation (default "landscape") --plain Plain output. Good for tty -q, --query string Limit selection to photos matching a search term. -s, --save Save the photo without setting it as wallpaper """ [[commands.field]] id = "query" label = "Search term" type = "string" option = ["--query", "-q"] sources = ["help"] [[commands.field]] id = "orientation" label = "Orientation" type = "string" option = ["--orientation", "-o"] suggestions = [{ value = "landscape", label = "Landscape" }, { value = "portrait", label = "Portrait" }, { value = "squarish", label = "Squarish" }] observed_default = "landscape" sources = ["help"] [[commands.field]] id = "day" label = "Photo of the day" type = "boolean" option = ["--day"] sources = ["help"] [[commands.field]] id = "photo_id" label = "Photo ID" type = "string" option = ["--id"] sources = ["help"] [[commands.field]] id = "save" label = "Save only (do not set wallpaper)" type = "boolean" option = ["--save", "-s"] sources = ["help"] [[commands.field]] id = "no_cache" label = "Ignore cache" type = "boolean" option = ["--no-cache"] sources = ["help"] [[commands.field]] id = "plain" label = "Plain output" type = "boolean" option = ["--plain"] sources = ["help"] [[commands.task]] id = "search" label = "Wallpaper from a search" fields = ["query", "orientation"] required = ["query"] [[commands.task]] id = "day" label = "Photo of the day" fields = ["day", "save"] required = ["day"] set = { day = [true] } [[commands.group]] id = "basic" label = "Basic" fields = ["query", "orientation", "day", "photo_id", "save"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["no_cache", "plain"]