Skip to content

Search the shelves

$ grim search payment

Before writing a module, check that nobody has. grim search looks through the modules and themes your GitHub account can see and returns the ones whose name or description contains your word. When you have no word in mind and want to browse, grim list:available shows the same catalogue whole.

Usage

$ grim search payment                  # modules and themes that mention it
$ grim search bank --type=module       # modules only
$ grim search --type=theme-frontend    # no word: every frontend theme
$ grim search bank --refresh           # fetch the catalogue again first

It runs from anywhere; no project is needed. You must be logged in with grim auth:login.

Arguments and options

Search grimoiry/grim-* modules and themes available on GitHub

Usage

grim search [-t|--type TYPE] [-r|--refresh] [--] [<query>]

Arguments

Argument Description
query Free-text query (matched against name and description) (optional)

Options

Option Description
-t, --type=TYPE Filter by type: module, theme-frontend, theme-admin
-r, --refresh Force refresh of the local registry cache

What it actually does

  1. Loads the catalogue. From ~/.grim/registry-cache.json when that file is less than 24 hours old. Otherwise it lists the repositories of the grimoiry organisation on GitHub, keeps those named grim-* that are packages, and writes the cache.
  2. Filters. The query is matched as one piece of text, ignoring case, against the short name and the description. --type narrows to module, theme-frontend or theme-admin.
  3. Prints a table: name, type, description cut to 60 characters, and the date of the last push. Below it, the number of matches and the path of the cache file.

The short name is what every other command takes. grim-cart-orders is the module cart-orders; grim-theme-monitor is the frontend theme monitor; grim-theme-admin-float is the admin theme float.

Pitfalls

The query is a phrase, not keywords

grim search "bank transfer" finds only descriptions that contain those two words next to each other. Search for the one word that matters.

A new package does not show for a day

The cache is not refreshed until it is 24 hours old. After a colleague publishes a module, or after you were given access to a private one, pass --refresh.

You are told to log in with a command that does not exist

Not authenticated with GitHub. Run `grim auth login` first. The command is spelled with a colon: grim auth:login.

After it finishes

Read the entry of what you found, then add it to the project.

$ grim module:info cart-orders
$ grim require cart-orders

grim module:info and grim theme:info show the latest release and the README.

Recipes that use it