Ensure you have NodeJS 12 or later installed. Then run the following:
$ npm install --global @sloansparger/bear
Once you've installed Bear CLI, you will want to authenticate the CLI to allow for full access to Bear's features.
$ bear auth [API_TOKEN]
Additionally, Bear CLI ships with autocomplete for bash and zsh. Follow the prompts by running:
$ bear autocomplete
$ bear COMMAND
$ bear --version
$ bear --help [COMMAND]
Bear CLI includes and update helper, to get make sure you have the latest version, run:
$ bear update
Right now the project would greatly benefit from people posting their workflows using this CLI. Feel free to contribute an example by adding a markdown file to the examples
directory.
bear add-file [FILE]
bear add-text [TEXT]
bear archive [ID]
bear auth API-TOKEN
bear autocomplete [SHELL]
bear change-font [FONT]
bear change-theme [THEME]
bear commands
bear create [TEXT]
bear delete-tag [NAME]
bear grab-url [URL]
bear help [COMMAND]
bear locked [SEARCH]
bear open-note [ID]
bear open-tag [NAME]
bear rename-tag NAME [NEW-NAME]
bear search [TERM]
bear tags
bear today [SEARCH]
bear todo [SEARCH]
bear trash [ID]
bear untagged [SEARCH]
bear update [CHANNEL]
Append or prepend a file to a note identified by its title or id.
USAGE
$ bear add-file [FILE]
ARGUMENTS
FILE path to file you want to add
OPTIONS
-c, --edit place the cursor inside the note editor
-e, --new-window open the note in an external window
-h, --help show CLI help
-i, --id=id note unique identifier
-j, --filename=filename override file name including extension
-m, --mode=prepend|append|replace|replace_all [default: append] the allowed values are prepend, append, replace_all
and replace (keep the note's title untouched)
-n, --title=title note title
-o, --open-note display the new note in Bear's main or external window
-u, --header=header note title
-w, --show-window force the opening of bear main window
DESCRIPTION
This call can't be performed if the app is a locked state.
Encrypted notes can't be accessed with this call.
Returns note's contents.
See code: src/commands/add-file.ts
Append or prepend text to a note identified by its title or id.
USAGE
$ bear add-text [TEXT]
ARGUMENTS
TEXT note body
OPTIONS
-c, --edit place the cursor inside the note editor
-d, --timestamp prepend the current date and time to the text
-e, --new-window open the note in an external window
-h, --help show CLI help
-i, --id=id note unique identifier
-l, --new-line if true and mode is append force the text to appear on a new line
inside the note
-m, --mode=prepend|append|replace|replace_all [default: append] the allowed values are prepend, append, replace_all
and replace (keep the note's title untouched)
-n, --title=title note title
-o, --open-note display the new note in Bear's main or external window
-t, --tag=tag tag for note
-u, --header=header note title
-w, --show-window force the opening of bear main window
-x, --exclude-trashed exclude trashed notes
DESCRIPTION
Beta encrypted notes can't be accessed with this call.
Returns note's contents.
See code: src/commands/add-text.ts
Move a note to bear archive and select the Archive sidebar item.
USAGE
$ bear archive [ID]
ARGUMENTS
ID note unique identifier
OPTIONS
-h, --help show CLI help
-s, --search=search string to search. search term is ignored if an id is provided.
-w, --show-window force the opening of bear main window
DESCRIPTION
This call can't be performed if the app is a locked state.
Encrypted notes can't be accessed with this call.
See code: src/commands/archive.ts
Authenticates Bear CLI commands that require an app generated token to work.
USAGE
$ bear auth API-TOKEN
ARGUMENTS
API-TOKEN application token
OPTIONS
-h, --help show CLI help
DESCRIPTION
Go to Bear → Help → API Token → Copy Token and paste into this command.
See code: src/commands/auth.ts
display autocomplete installation instructions
USAGE
$ bear autocomplete [SHELL]
ARGUMENTS
SHELL shell type
OPTIONS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
EXAMPLES
$ bear autocomplete
$ bear autocomplete bash
$ bear autocomplete zsh
$ bear autocomplete --refresh-cache
See code: @oclif/plugin-autocomplete
Change the selected Bear Font.
USAGE
$ bear change-font [FONT]
ARGUMENTS
FONT font name
OPTIONS
-h, --help show CLI help
-w, --show-window force the opening of bear main window
See code: src/commands/change-font.ts
Change the selected Bear theme.
USAGE
$ bear change-theme [THEME]
ARGUMENTS
THEME theme name
OPTIONS
-h, --help show CLI help
-w, --show-window force the opening of bear main window
DESCRIPTION
Some themes may require a Bear Pro subscription.
See code: src/commands/change-theme.ts
list all the commands
USAGE
$ bear commands
OPTIONS
-h, --help show CLI help
-j, --json output in json format
--hidden also show hidden commands
See code: @oclif/plugin-commands
Create a new note. Empty notes are not allowed.
USAGE
$ bear create [TEXT]
ARGUMENTS
TEXT note body
OPTIONS
-a, --file=file path to a file attachment
-c, --edit place the cursor inside the note editor
-d, --timestamp prepend the current date and time to the text
-e, --new-window open the note in an external window
-h, --help show CLI help
-j, --filename=filename override file name including extension
-n, --title=title note title
-o, --open-note display the new note in Bear's main or external window
-p, --pin pin the note to the top of the list
-t, --tag=tag tag for note
-w, --show-window force the opening of bear main window
DESCRIPTION
Returns unique note identifier of new note.
See code: src/commands/create.ts
Delete an existing tag.
USAGE
$ bear delete-tag [NAME]
ARGUMENTS
NAME tag name
OPTIONS
-h, --help show CLI help
-w, --show-window force the opening of bear main window
DESCRIPTION
This call can't be performed if the app is a locked state.
If the tag contains any locked note this call will not be performed.
See code: src/commands/delete-tag.ts
Create a new note with the content of a web page.
USAGE
$ bear grab-url [URL]
ARGUMENTS
URL url to grab
OPTIONS
-h, --help show CLI help
-p, --pin pin the note to the top of the list
-t, --tag=tag tag for note, if tags are specified in the Bear's web content prefences this parameter is ignored
-z, --wait if false, command returns immediately without waiting for note return value
DESCRIPTION
Returns unique note identifier of new note.
See code: src/commands/grab-url.ts
display help for bear
USAGE
$ bear help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
Select the Locked sidebar item.
USAGE
$ bear locked [SEARCH]
ARGUMENTS
SEARCH string to search
OPTIONS
-h, --help show CLI help
-w, --show-window force the opening of bear main window
See code: src/commands/locked.ts
Fetch a note identified by its title or id.
USAGE
$ bear open-note [ID]
ARGUMENTS
ID note unique identifier
OPTIONS
-c, --edit place the cursor inside the note editor
-e, --new-window open the note in an external window
-f, --float makes the external window float on top
-h, --help show CLI help
-k, --selected return the note currently selected in Bear
-n, --title=title note title
-o, --open-note display the new note in Bear's main or external window
-p, --pin pin the note to the top of the list
-u, --header=header note title
-w, --show-window force the opening of bear main window
-x, --exclude-trashed exclude trashed notes
-y, --token=token [default: 493C02-3A08BB-D7BA51] bear api token. defaults to api key provided to auth command.
DESCRIPTION
Returns the matched note's contents.
See code: src/commands/open-note.ts
Fetch all the notes which have a selected tag in bear.
USAGE
$ bear open-tag [NAME]
ARGUMENTS
NAME tag name
OPTIONS
-h, --help show CLI help
-y, --token=token [default: 493C02-3A08BB-D7BA51] bear api token. defaults to api key provided to auth command.
DESCRIPTION
Returns list of unique note identifiers and note titles.
See code: src/commands/open-tag.ts
Rename an existing tag.
USAGE
$ bear rename-tag NAME [NEW-NAME]
ARGUMENTS
NAME tag name
NEW-NAME new tag name
OPTIONS
-h, --help show CLI help
-w, --show-window force the opening of bear main window
DESCRIPTION
This call can't be performed if the app is a locked state.
If the tag contains any locked note this call will not be performed.
See code: src/commands/rename-tag.ts
Fetch search results from Bear for all notes or for a specific tag.
USAGE
$ bear search [TERM]
ARGUMENTS
TERM string to search
OPTIONS
-h, --help show CLI help
-t, --tag=tag tag to search into
-w, --show-window force the opening of bear main window
-y, --token=token [default: 493C02-3A08BB-D7BA51] bear api token. defaults to api key provided to auth command.
DESCRIPTION
Returns list of unique note identifiers and note titles.
See code: src/commands/search.ts
Fetch all the tags currently displayed in Bear's sidebar.
USAGE
$ bear tags
OPTIONS
-h, --help show CLI help
-y, --token=token (required) [default: 493C02-3A08BB-D7BA51] bear api token. defaults to api key provided to auth
command.
DESCRIPTION
Returns list of tag names.
See code: src/commands/tags.ts
Fetch all notes in the Today sidebar item.
USAGE
$ bear today [SEARCH]
ARGUMENTS
SEARCH string to search
OPTIONS
-h, --help show CLI help
-w, --show-window force the opening of bear main window
-y, --token=token [default: 493C02-3A08BB-D7BA51] bear api token. defaults to api key provided to auth command.
DESCRIPTION
Returns list of unique note identifiers and note titles.
NOTE: this feature doesn't currently work as expected.
BUG: There's an issue with bear that causes notes that match search not in Today to be returned.
BUG: There's an issue where fetching Today's notes causes bear to hold process open.
See code: src/commands/today.ts
Fetch all notes in the Todo sidebar item.
USAGE
$ bear todo [SEARCH]
ARGUMENTS
SEARCH string to search
OPTIONS
-h, --help show CLI help
-w, --show-window force the opening of bear main window
-y, --tokne=tokne [default: 493C02-3A08BB-D7BA51] bear api token. defaults to api key provided to auth command.
DESCRIPTION
Returns list of unique note identifiers and note titles.
BUG: There's an issue with bear that causes notes that match search with no Todo's to be returned.
See code: src/commands/todo.ts
Move a note to bear trash and select the Trash sidebar item.
USAGE
$ bear trash [ID]
ARGUMENTS
ID note unique identifier
OPTIONS
-h, --help show CLI help
-s, --search=search string to search. search term is ignored if an id is provided.
-w, --show-window force the opening of bear main window
DESCRIPTION
This call can't be performed if the app is a locked state.
Encrypted notes can't be used with this call.
See code: src/commands/trash.ts
Fetch all notes in the Untagged sidebar item.
USAGE
$ bear untagged [SEARCH]
ARGUMENTS
SEARCH string to search
OPTIONS
-h, --help show CLI help
-w, --show-window force the opening of bear main window
-y, --token=token [default: 493C02-3A08BB-D7BA51] bear api token. defaults to api key provided to auth command.
DESCRIPTION
Returns list of unique note identifiers and note titles.
See code: src/commands/untagged.ts
update the bear CLI
USAGE
$ bear update [CHANNEL]
See code: @oclif/plugin-update