binocle
Brilliant Instance Navigation, Organisation and Cleaning Looker Executable
This CLI tool was initially developed during the Hack@Home 2021 Hackathon organized by Looker.
It uses the environment variables described in the Looker Codegen SDK.
It aims at providing a set of tools to better understand, organise and document your Looker instance.
Usage
$ npm install -g binocle
$ binocle COMMAND
running command...
$ binocle (-v|--version|version)
binocle/0.2.1 darwin-arm64 node-v19.6.0
$ binocle --help [COMMAND]
USAGE
$ binocle COMMAND
...
Commands
binocle copy ID [TYPE] [FOLDER_ID]
binocle edit ID [TYPE]
binocle help [COMMAND]
binocle ls [FOLDER_ID]
binocle pause CONTENT_ID [TYPE] [USER_ID]
binocle restore ID [TYPE]
binocle share
binocle copy ID [TYPE] [FOLDER_ID]
Copies a dashboard into a specified folder.
USAGE
$ binocle copy ID [TYPE] [FOLDER_ID]
ARGUMENTS
ID
TYPE (l|d) [default: l] look (l) or dashboard (d)
FOLDER_ID
OPTIONS
-c, --client_id=client_id (required) API3 credential client_id
-h, --help show CLI help
-r, --rename Allows to rename the content that will be copied.
-s, --client_secret=client_secret (required) API3 credential client_id
-u, --base_url=base_url (required) Sets base url like https://my.looker.com:19999
See code: src/commands/copy.ts
binocle edit ID [TYPE]
Edit queries of Looks and Dashboard tiles.
USAGE
$ binocle edit ID [TYPE]
ARGUMENTS
ID
TYPE (l|d) [default: l] look (l) or dashboard (d)
OPTIONS
-b, --bulk Allows to edit dashboard tiles in bulk.
-c, --client_id=client_id (required) API3 credential client_id
-e, --edit_dashboard_properties Allows to edit the properties of the dashboard before editing the dashboard
elements. (Ex : Edit filters)
-h, --help show CLI help
-p, --get_properties Display the properties of the content you want to edit, before editing it.
-r, --rename Allows to rename the content that will be copied.
-s, --client_secret=client_secret (required) API3 credential client_id
-u, --base_url=base_url (required) Sets base url like https://my.looker.com:19999
See code: src/commands/edit.ts
binocle help [COMMAND]
display help for binocle
USAGE
$ binocle help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
binocle ls [FOLDER_ID]
Lists the content of the selected folder and its subfolders.
USAGE
$ binocle ls [FOLDER_ID]
OPTIONS
-c, --client_id=client_id (required) API3 credential client_id
-d, --depth=depth [default: 2] Sets the subfolders depth to display. Unlimited depth : -1
-h, --help show CLI help
-i, --image Creates an image of the listing in the current directory
-s, --client_secret=client_secret (required) API3 credential client_id
-u, --base_url=base_url (required) Sets base url like https://my.looker.com:19999
--show_content Displays Looks and Dashboards in the listing
DESCRIPTION
Use the options to save the output to a png image, display the looks and dashboards and set the depth in the folder
binocle must search in. Click on the contents and folders ids in your terminal (provided it supports it, use iTerm2
for instance) to open them in your default browser.
EXAMPLE
$ binocle ls 123 -d 2
📁 Folder A #123 (D:0 - L:0)
| 📁 Folder B #145 (D:0 - L:2)
| | 📁 Folder D #547 (D:0 - L:3)
| 📁 Folder C #156 (D:1 - L:7)
See code: src/commands/ls.ts
binocle pause CONTENT_ID [TYPE] [USER_ID]
Gets all schedules of a Look/Dashboard and enables pausing/unpausing them. NB: if any runs were skipped while it was paused, it will run once after being unpaused.
USAGE
$ binocle pause CONTENT_ID [TYPE] [USER_ID]
ARGUMENTS
CONTENT_ID
TYPE (l|d) [default: l] look (l) or dashboard (d)
USER_ID If no user_id is provided defaults to the API3 Key owner
OPTIONS
-c, --client_id=client_id (required) API3 credential client_id
-h, --help show CLI help
-r, --revert Revert: displays paused schedules and enabling unpausing them
-s, --client_secret=client_secret (required) API3 credential client_id
-u, --base_url=base_url (required) Sets base url like https://my.looker.com:19999
ALIASES
$ binocle schedule:pause
See code: src/commands/pause.ts
binocle restore ID [TYPE]
Check if a look or dashboard has been deleted by id and restore it if possible in a chosen folder.
USAGE
$ binocle restore ID [TYPE]
ARGUMENTS
ID
TYPE (l|d) [default: l] look (l) or dashboard (d)
OPTIONS
-c, --client_id=client_id (required) API3 credential client_id
-h, --help show CLI help
-s, --client_secret=client_secret (required) API3 credential client_id
-u, --base_url=base_url (required) Sets base url like https://my.looker.com:19999
See code: src/commands/restore.ts
binocle share
Shares a folder and its parents up until the shared/users root folder to a group or a user. It deactivates the inheritance of access levels from parents for all these folders.
USAGE
$ binocle share
OPTIONS
-c, --client_id=client_id (required) API3 credential client_id
-e, --edit_right Shares the folder with edit rights (and parents with view rights)
-f, --folder_id=folder_id (required) API3 credential client_id
-g, --is_group The provided id is the one of a group, not a user
-h, --help show CLI help
-i, --id=id (required) Group or user id
-s, --client_secret=client_secret (required) API3 credential client_id
-u, --base_url=base_url (required) Sets base url like https://my.looker.com:19999
See code: src/commands/share.ts