Skip to content

Commit eb11aca

Browse files
committed
docs: edits to README
1 parent 361167c commit eb11aca

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ Access token should be set before using `hackmd-cli`. It can be created by landi
4444

4545
#### Example:
4646

47-
Set environment variable by command:
47+
Set the access token by `login` command. By doing so, the access token will be saved in `~/.hackmd/config.json`.
4848

4949
```sh-session
5050
$ hackmd-cli login
5151
Enter your access token: My_ACCESS_TOKEN
5252
```
5353

54-
Or in your shell profile:
54+
Or you don't want to keep the credentials in one file, you can set it through environment variable:
5555

5656
```bash
5757
export HMD_API_ACCESS_TOKEN=MY_ACCESS_TOKEN
5858
```
5959

60-
Or in JSON file (`~/.hackmd/config.json`):
60+
Or you can write the configuration file manually. Edit `~/.hackmd/config.json` with the following content:
6161

6262
```json
6363
{
@@ -67,7 +67,7 @@ Or in JSON file (`~/.hackmd/config.json`):
6767

6868
### Specify HackMD API endpoint manually (optional)
6969

70-
`hackmd-cli` operates on official HackMD API endpoint (`https://api.hackmd.io/v1`) by default. If you want to use cli with a self-hosted [HackMD EE](https://hackmd.io/pricing) instance and API endpoint, you will need to configure `hackmd-cli` by either environment variable or JSON configuration.
70+
`hackmd-cli` operates on the official HackMD API endpoint (`https://api.hackmd.io/v1`) by default. If you want to use `hackmd-cli` with a custom [HackMD EE](https://hackmd.io/enterprise) instance, you will need to configure the API endpoint by either environment variable or JSON configuration manually.
7171

7272
#### Example:
7373

@@ -89,11 +89,10 @@ Or in JSON file (`~/.hackmd/config.json`):
8989

9090
All available configurations are listed in the table below.
9191

92-
| Config key | Environment Variable | Data Type | Example Value | Description |
93-
| ------------ | :--------------------------------------------- | ----------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
94-
| `hackmdAPIEndpointURL` | `HMD_API_ENDPOINT_URL` | *`string`* | `https://my.hackmd-ee.api.endpoint` | The self-hosted API endpoint URL |
95-
| `accessToken` | `HMD_API_ACCESS_TOKEN` | *`string`* | `MY_ACCESS_TOKEN` | Token to access HackMD APIs |
96-
92+
| Config key | Environment Variable | Data Type | Example Value | Description |
93+
| ---------------------- | :--------------------- | ---------- | ----------------------------------- | -------------------------------- |
94+
| `hackmdAPIEndpointURL` | `HMD_API_ENDPOINT_URL` | *`string`* | `https://my.hackmd-ee.api.endpoint` | The self-hosted API endpoint URL |
95+
| `accessToken` | `HMD_API_ACCESS_TOKEN` | *`string`* | `MY_ACCESS_TOKEN` | Token to access HackMD APIs |
9796

9897
## Commands
9998

0 commit comments

Comments
 (0)