|
34 | 34 | ### Set access token
|
35 | 35 | Access token should be set before using `hackmd-cli`. It can be created by landing [hackmd.io](https://hackmd.io) -> Setting -> API -> Create API token. Copy the token and set it as config variable.
|
36 | 36 | #### Example:
|
37 |
| -Set environment variable in your shell profile: |
| 37 | + |
| 38 | +Set environment variable by command: |
| 39 | +```sh-session |
| 40 | +$ hackmd-cli login |
| 41 | +Enter your accesstoken: My_ACCESS_TOKEN |
| 42 | +``` |
| 43 | + |
| 44 | +Or in your shell profile: |
38 | 45 | ```bash
|
39 | 46 | export HMD_API_ACCESS_TOKEN=MY_ACCESS_TOKEN
|
40 | 47 | ```
|
@@ -79,6 +86,8 @@ All available configurations are listed in the table below.
|
79 | 86 | <!-- commands -->
|
80 | 87 | * [`hackmd-cli help [COMMAND]`](#hackmd-cli-help-command)
|
81 | 88 | * [`hackmd-cli history`](#hackmd-cli-history)
|
| 89 | +* [`hackmd-cli login`](#hackmd-cli-login) |
| 90 | +* [`hackmd-cli logout`](#hackmd-cli-logout) |
82 | 91 | * [`hackmd-cli notes`](#hackmd-cli-notes)
|
83 | 92 | * [`hackmd-cli notes:create`](#hackmd-cli-notescreate)
|
84 | 93 | * [`hackmd-cli notes:delete`](#hackmd-cli-notesdelete)
|
@@ -137,6 +146,46 @@ EXAMPLE
|
137 | 146 |
|
138 | 147 | _See code: [src/commands/history.ts](https://github.com/hackmdio/hackmd-cli/blob/v2.0.0/src/commands/history.ts)_
|
139 | 148 |
|
| 149 | +## `hackmd-cli login` |
| 150 | + |
| 151 | +Login to HackMD server from CLI |
| 152 | + |
| 153 | +``` |
| 154 | +USAGE |
| 155 | + $ hackmd-cli login |
| 156 | +
|
| 157 | +OPTIONS |
| 158 | + -h, --help Show CLI help. |
| 159 | +
|
| 160 | +EXAMPLE |
| 161 | + $ hackmd-cli login |
| 162 | +
|
| 163 | + Enter your access token: MY_ACCESS_TOKEN |
| 164 | +
|
| 165 | + Login successfully |
| 166 | +``` |
| 167 | + |
| 168 | +_See code: [src/commands/login.ts](https://github.com/hackmdio/hackmd-cli/blob/v2.0.0/src/commands/login.ts)_ |
| 169 | + |
| 170 | +## `hackmd-cli logout` |
| 171 | + |
| 172 | +Login to HackMD server from CLI |
| 173 | + |
| 174 | +``` |
| 175 | +USAGE |
| 176 | + $ hackmd-cli logout |
| 177 | +
|
| 178 | +OPTIONS |
| 179 | + -h, --help Show CLI help. |
| 180 | +
|
| 181 | +EXAMPLE |
| 182 | + $ hackmd-cli logout |
| 183 | +
|
| 184 | + You've logged out successfully |
| 185 | +``` |
| 186 | + |
| 187 | +_See code: [src/commands/logout.ts](https://github.com/hackmdio/hackmd-cli/blob/v2.0.0/src/commands/logout.ts)_ |
| 188 | + |
140 | 189 | ## `hackmd-cli notes`
|
141 | 190 |
|
142 | 191 | HackMD notes commands
|
@@ -410,20 +459,6 @@ EXAMPLE
|
410 | 459 | _See code: [src/commands/whoami.ts](https://github.com/hackmdio/hackmd-cli/blob/v2.0.0/src/commands/whoami.ts)_
|
411 | 460 | <!-- commandsstop -->
|
412 | 461 |
|
413 |
| -## `hackmd-cli` piping mode |
414 |
| - |
415 |
| -You can create a note by piping text stream to hackmd-cli |
416 |
| - |
417 |
| -``` |
418 |
| -USAGE |
419 |
| - $ hackmd-cli [COMMAND] |
420 |
| -
|
421 |
| -EXAMPLE |
422 |
| - $ cat README.md | hackmd-cli |
423 |
| -
|
424 |
| - Your note is available at https://hackmd.io/note-url |
425 |
| -``` |
426 |
| - |
427 | 462 | ## License
|
428 | 463 |
|
429 | 464 | MIT
|
0 commit comments