You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+86-45Lines changed: 86 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,61 +7,66 @@ For more background, see the initial [discussion](https://github.com/hackmdio/co
7
7
*There is an alternative, TypeScript-based CodiMD CLI for `hackmdio/codimd` maintained by the HackMD team here: https://github.com/hackmdio/codimd-cli.*
8
8
*(it may or may not be compatible with the `hedgedoc/hedgedoc` server)*
9
9
10
-
## Install
10
+
## Installation
11
11
12
-
Dependencies:
13
-
- A HedgeDoc server running somewhere
14
-
-`curl` (install via `apt install curl` or `brew install curl` on Mac)
15
-
-`wget` (install via `apt install wget` or `brew install wget` on Mac)
16
-
-`jq` (install via `apt install jq` or `brew install jq` on Mac)
12
+
### Dependencies
17
13
18
-
```bash
19
-
git clone https://github.com/hedgedoc/cli
20
-
cd cli/bin
21
-
# optionally symlink the hedgedoc script somewhere into your $PATH
22
-
ln -s $PWD/hedgedoc /usr/local/bin/hedgedoc
23
-
24
-
# set HEDGEDOC_SERVER environment variable to your server's URL
Optionally symlink the hedgedoc script somewhere into your $PATH to make it globally accessible. Otherwise you will have to provide the path to the script manually. This command might need admin rights (sudo)!
30
+
31
+
$ ln -s $PWD/hedgedoc /usr/local/bin/hedgedoc
32
+
33
+
Check if the new command exists. You should see the documentation
34
+
35
+
$ hedgedoc
36
+
37
+
Set `HEDGEDOC_SERVER` environment variable to your server's URL. It defaults to `http://127.0.0.1:3000` Do this once on the command line or persist it in `.profile` and/or `.bashrc`.
If you added the variable to `.profile` or `.bashrc`, re-open the terminal to read the new variable.
42
+
43
+
Test your configuration by creating a new note with FREELY access and no login required. You will receive the generated `<note_id>` for the document like `3jXcabSfSNesbH6KT72ieg`.
44
+
45
+
**Caution: You won't have the right to delete the new document if not authenticated!**
46
+
47
+
$ echo "# HedgeDoc!" > test.md
48
+
$ hedgedoc import test.md
49
+
50
+
Check for the document in the browser by concatenating the
51
+
address of your server and the `<note_id>`.
52
+
53
+
## Configuration and usage
54
+
55
+
### Variants of authentication
56
+
57
+
It's not necessary to authenticate against the server in order to make use of `hedgedoc-cli`. But without authentication you won't have access to the non-FREELY documents and everything that's accessible behind the login.
58
58
59
-
### Authenticate and get notes history
59
+
#### Authenticate with cookie
60
+
61
+
Authentication with a cookie is so far the only way if you login with GitLab and the like. Use browser extensions like [Get cookies.txt](https://chrome.google.com/webstore/detail/get-cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid) to store the cookie in `key.conf`.
62
+
63
+
Possible you have many lines in `key.conf`. You only need the line with `connect.sid` followed by a long hash!
64
+
65
+
Optionally add the HEDGEDOC_COOKIES_FILE environment variable to specify where cookies will be stored. It defaults to `~/.config/hedgedoc/key.conf`
60
66
61
67
```bash
62
-
# optionally add the HEDGEDOC_COOKIES_FILE environment variable to specify
63
-
# where cookies will be stored. It defaults to ~/.config/hedgedoc-cli/key.conf
These server endpoints are used by this project and can be unstable and undocumented, but may be of use if you're developing your own projects that need API access to HedgeDoc.
0 commit comments