-
-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Update the CLI docs to reference the published NPM package
- Loading branch information
1 parent
ac2f78f
commit 4804f98
Showing
2 changed files
with
90 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,109 @@ | ||
# Command Line Tool (CLI) | ||
|
||
Hoarder comes with a simple CLI for those users who want to do more advanced manipulation. Currently, the CLI comes packaged as a docker container. You can run it with: | ||
Hoarder comes with a simple CLI for those users who want to do more advanced manipulation. | ||
|
||
## Features | ||
|
||
- Manipulate bookmarks, lists and tags | ||
- Mass import/export of bookmarks | ||
|
||
## Installation (NPM) | ||
|
||
``` | ||
npm install -g @hoarderapp/cli | ||
``` | ||
|
||
|
||
## Installation (Docker) | ||
|
||
``` | ||
docker run --rm ghcr.io/mohamedbassem/hoarder-cli:release --help | ||
``` | ||
|
||
## Usage | ||
|
||
``` | ||
hoarder | ||
``` | ||
|
||
``` | ||
Usage: hoarder [options] [command] | ||
A CLI interface to interact with the hoarder api | ||
Options: | ||
--api-key <key> the API key to interact with the API (env: HOARDER_API_KEY) | ||
--server-addr <addr> the address of the server to connect to (env: HOARDER_SERVER_ADDR) | ||
-V, --version output the version number | ||
-h, --help display help for command | ||
Commands: | ||
bookmarks manipulating bookmarks | ||
lists manipulating lists | ||
tags manipulating tags | ||
whoami returns info about the owner of this API key | ||
help [command] display help for command | ||
``` | ||
|
||
And some of the subcommands: | ||
|
||
``` | ||
hoarder bookmarks | ||
``` | ||
|
||
``` | ||
Usage: hoarder bookmarks [options] [command] | ||
Manipulating bookmarks | ||
Options: | ||
-h, --help display help for command | ||
Commands: | ||
add [options] creates a new bookmark | ||
get <id> fetch information about a bookmark | ||
update [options] <id> updates bookmark | ||
list [options] list all bookmarks | ||
delete <id> delete a bookmark | ||
help [command] display help for command | ||
``` | ||
|
||
``` | ||
hoarder lists | ||
``` | ||
|
||
``` | ||
Usage: hoarder lists [options] [command] | ||
Manipulating lists | ||
Options: | ||
-h, --help display help for command | ||
Commands: | ||
list lists all lists | ||
delete <id> deletes a list | ||
add-bookmark [options] add a bookmark to list | ||
remove-bookmark [options] remove a bookmark from list | ||
help [command] display help for command | ||
``` | ||
|
||
## Optaining an API Key | ||
|
||
To use the CLI, you'll need to get an API key from your hoarder settings. You can validate that it's working by running: | ||
|
||
``` | ||
docker run --rm ghcr.io/mohamedbassem/hoarder-cli:release --api-key <key> --server-addr <addr> whoami | ||
hoarder --api-key <key> --server-addr <addr> whoami | ||
``` | ||
|
||
For example: | ||
|
||
``` | ||
docker run --rm ghcr.io/mohamedbassem/hoarder-cli:release --api-key mysupersecretkey --server-addr https://try.hoarder.app whoami | ||
hoarder --api-key mysupersecretkey --server-addr https://try.hoarder.app whoami | ||
{ | ||
id: 'j29gnbzxxd01q74j2lu88tnb', | ||
name: 'Test User', | ||
email: 'test@gmail.com' | ||
} | ||
``` | ||
|
||
Check the help for the other available commands, but the main usecase for the CLI is to enable mass manipulation of your bookmarks. E.g. mass importing of bookmarks, mass deletions, etc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters