A NodeJS based CLI tool for doing useful things against the Guru KB (https://getguru.com)
Note: This tool is an open source project that is not officially supported by Guru. Use at your own risk.
This tool was made by us at Pliancy to augment the Guru administration experience. We hope it's useful to others as well!
It currently provides the following features:
- Search all cards with a powerful query language supporting regex in the title, content, collection, and board metadata.
- Verify any card. This works by generating an API token for the card's owner and using it to verify.
- Verify expired (stale) cards.
- Find and replace across all Guru cards with regex support, optional filtering, and powerful preview.
- Backup your cards to JSON format.
The NPM method is preferred since it is consistent across operating systems. The homebrew method is for convienence only.
Install Node JS 14 or greater if you do not already have it from the Offical NodeJS Download Page
npm install -g guru-cli
# or
yarn global add guru-cli
brew install pliancy/tap/guru-cli
- First, you need to authenticate to the guru API. Navigate to https://app.getguru.com/settings/api-access and generate an API token for a Guru admin account
- Log in to the cli tool
$ guru-cli login
Login to Guru API
-------------------
Guru Admin Email: example@company.com
Admin API Token: some-api-token
✅ Successfully authenticated to Guru API. You can now run guru-cli commands.
Now you're ready!
Many commands support a powerful filtering syntax with regex support. The filtering supports a familiar google-style query syntax of key:value
where key is one of collection
, board
, title
, or content
and value is any ECMAScript supported regular expression. Typically you can just fuzzy match via something like title:Overview
which logically means title contains the substring "Overview". See below for more examples of using this filtering.
If you need to ignore case sensitivity in the supplied regex you can pass the --ignore-case
or -i
flag to the command.
Find all cards with the words "Typescript" or "Javascript" in the title under the "Engineering" collection
guru-cli find 'title:Typescript|Javascript collection:Engineering'
guru-cli find 'content:Caleb.*great guy'
guru-cli verify-by-title 'card title'
guru-cli verify-by-title --collection 'collection title' 'card title'
guru-cli verify-expired
guru-cli verify-expired 'collection:Engineering title:Overview'
guru-cli find-replace -i 'G Suite' 'Google Workspace'
Once you're confident in your changes affecting the proper data in the preview:
guru-cli find-replace -i 'G Suite' 'Google Workspace' --confirm
This one is a bit more complex because it uses a regex feature known as negitive look-ahead in the filter to accomplish filtering out the relevant cards
guru-cli find-replace 'Archer' 'Lana' 'content:"^(?!.*this is how you get ants)"'
Once you're confident in your changes affecting the proper data in the preview:
guru-cli find-replace 'Archer' 'Lana' 'content:"^(?!.*this is how you get ants)"' --confirm
guru-cli backup-cards /path/to/some/folder