{"id":13587910,"url":"https://github.com/mhinz/spotlight-cli","last_synced_at":"2026-03-02T10:31:00.295Z","repository":{"id":145654604,"uuid":"70348940","full_name":"mhinz/spotlight-cli","owner":"mhinz","description":" Command-line tool for Spotlight.","archived":false,"fork":false,"pushed_at":"2022-08-10T19:20:20.000Z","size":29,"stargazers_count":37,"open_issues_count":2,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-12T14:14:37.497Z","etag":null,"topics":["macos","osx","shell-script","spotlight"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhinz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-10-08T18:06:09.000Z","updated_at":"2025-02-19T15:40:22.000Z","dependencies_parsed_at":"2023-04-06T09:00:49.605Z","dependency_job_id":null,"html_url":"https://github.com/mhinz/spotlight-cli","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mhinz/spotlight-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhinz%2Fspotlight-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhinz%2Fspotlight-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhinz%2Fspotlight-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhinz%2Fspotlight-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhinz","download_url":"https://codeload.github.com/mhinz/spotlight-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhinz%2Fspotlight-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29998512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T09:59:02.300Z","status":"ssl_error","status_checked_at":"2026-03-02T09:59:02.001Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["macos","osx","shell-script","spotlight"],"created_at":"2024-08-01T15:06:25.268Z","updated_at":"2026-03-02T10:31:00.271Z","avatar_url":"https://github.com/mhinz.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"```\n$ spot\n Spotlight CLI.\n\nIf a command takes a [path], the results will be restricted to that directory.\n\napps                      Installed applications.\nattr                      Attributes that can be used with \"spot \u003cquery\u003e\".\nauthor \u003cquery\u003e [path]     Files from author.\next \u003cquery\u003e [path]        Any files with that extension.\n                          $ spot ext pdf ~\nfile \u003cquery\u003e [path]       Find files.\n                          $ spot file vimrc ~/dotfiles\ngroup \u003cgroup|gid\u003e [path]  All files from user.\n                          $ spot group $GID /etc\nsize \u003crel\u003e \u003csize\u003e [path]  Find all files of a certain size in bytes.\n                          Or (k)ilobytes, (m)egabytes, (g)igabytes.\n                          $ spot size '\u003e=' 1g ~\ntext \u003cquery\u003e [path]       Find files containing text.\n                          $ spot text 'ascii porn' ~\nuser \u003cuser|uid\u003e [path]    All files from user.\n                          $ spot user $UID /var\n\n\u003cpath\u003e                    Get all attributes for that path.\n                          $ spot ~/fancy.gif\n\u003cquery\u003e [path]            Generic query. Supports any attributes from \"spot attr\".\n                          See link at the bottom for the syntax.\n                          $ spot foo\n                          $ spot 'kMDItemMusicalGenre == *Metal*' /data/music\n\nThe Spotlight query syntax explained:\nhttps://developer.apple.com/library/mac/documentation/Carbon/Conceptual/SpotlightQuery/Concepts/QueryFormat.html\n```\n\nIt's also fiendishly easy to add new commands to spot. For adding a command\n\"music\", simply add an executable shell script called \"spot-music\" to your\n$PATH:\n\n```sh\n#!/usr/bin/env bash\n\n# The following line is optional and outputs a small reminder,\n# if not enough arguments were given to the \"music\" command.\nrequired $# '\u003cgenre\u003e'\n\nmdfind \"kMDItemMusicalGenre == $1\"\n```\n\nUsing this, you can simply list all songs of a certain genre:\n\n```\n$ spot music Metal\n$ spot music \"Alpine folk music\"\n```\n\nYou could also change spot-music to take a second optional argument, to restrict\nthe matches to a certain directory:\n\n```sh\n#!/usr/bin/env bash\n\nrequired $# '\u003cgenre\u003e'\n\ngenre=$1\ndir=$2\n\nmdfind \"kMDItemMusicalGenre == $genre\" ${dir:+ -onlyin \"$dir\"}\n```\n\nNow, you can also use it like this:\n\n```\n$ spot music Metal ~/music\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhinz%2Fspotlight-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhinz%2Fspotlight-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhinz%2Fspotlight-cli/lists"}