All Projects → hedgedoc → Cli

hedgedoc / Cli

Licence: agpl-3.0
A tiny CLI for HedgeDoc

Programming Languages

shell
77523 projects
bash
514 projects

Projects that are alternatives of or similar to Cli

Nb
CLI and local web plain text note‑taking, bookmarking, and archiving with linking, tagging, filtering, search, Git versioning & syncing, Pandoc conversion, + more, in a single portable script.
Stars: ✭ 3,846 (+3991.49%)
Mutual labels:  cli, notes, markdown, archiving
Notes Cli
A simple CLI app to take notes daily on markdown file
Stars: ✭ 58 (-38.3%)
Mutual labels:  notes, markdown
Mkcli
Markdown command line interface definition
Stars: ✭ 56 (-40.43%)
Mutual labels:  cli, markdown
Toc
🚩 TOC, zero configuration table of content generator for Markdown files, create table of contents from any Markdown file with ease.
Stars: ✭ 66 (-29.79%)
Mutual labels:  cli, markdown
Termd
Render markdown in the terminal
Stars: ✭ 32 (-65.96%)
Mutual labels:  cli, markdown
Notes
📝 Migrated to(迁移至) https://github.com/Kuangcp/Note 当前仓库已经废弃, 对应的博客网站:
Stars: ✭ 33 (-64.89%)
Mutual labels:  notes, markdown
Gitjournal
Mobile first Note Taking integrated with Git
Stars: ✭ 1,138 (+1110.64%)
Mutual labels:  notes, markdown
Codimd
CodiMD - Realtime collaborative markdown notes on all platforms.
Stars: ✭ 7,592 (+7976.6%)
Mutual labels:  notes, markdown
Enex Dump
Dump the content of .enex files, preserving attachements, some metadata and optionally converting notes to Markdown.
Stars: ✭ 73 (-22.34%)
Mutual labels:  notes, markdown
Markdownxiaoshujiang
markdownxiaoshujiang
Stars: ✭ 1,188 (+1163.83%)
Mutual labels:  notes, markdown
Flybook
✈️ FlyBook is a simple utility to generate static website such as gh-pages, manual of you projects
Stars: ✭ 76 (-19.15%)
Mutual labels:  cli, markdown
Hint
重构到 ---> https://github.com/hustcc/lint-md
Stars: ✭ 30 (-68.09%)
Mutual labels:  cli, markdown
Notes
📝 Simple delightful note taking, with more unix and less lock-in.
Stars: ✭ 939 (+898.94%)
Mutual labels:  notes, markdown
Bangjago Android Emulator
simple android emulator cli for mobile development
Stars: ✭ 56 (-40.43%)
Mutual labels:  cli-app, cli
Make Space
💾 [WIP] Free up space from the command line
Stars: ✭ 21 (-77.66%)
Mutual labels:  cli-app, cli
Ishell
Library for creating interactive cli applications.
Stars: ✭ 1,127 (+1098.94%)
Mutual labels:  cli-app, cli
Forge Node App
🛠📦🎉 Generate Node.js boilerplate with optional libraries & tools
Stars: ✭ 90 (-4.26%)
Mutual labels:  cli-app, cli
Github Spray
Draw on your GitHub contribution graph ░▒▓█
Stars: ✭ 908 (+865.96%)
Mutual labels:  cli-app, cli
Captain
command line python scripts for humans
Stars: ✭ 10 (-89.36%)
Mutual labels:  cli-app, cli
Pyinquirer
A Python module for common interactive command line user interfaces
Stars: ✭ 1,151 (+1124.47%)
Mutual labels:  cli-app, cli

hedgedoc-cli

A tiny CLI to perform common operations on HedgeDoc (the largest open-source fork of HackMD).

For more background, see the initial discussion on the hackmd codimd repo.

There is an alternative, TypeScript-based CodiMD CLI for hackmdio/codimd maintained by the HackMD team here: https://github.com/hackmdio/codimd-cli.
(it may or may not be compatible with the hedgedoc/hedgedoc server)

Install

Dependencies:

  • A HedgeDoc server running somewhere
  • curl (install via apt install curl or brew install curl on Mac)
  • wget (install via apt install wget or brew install wget on Mac)
  • jq (install via apt install jq or brew install jq on Mac)
git clone https://github.com/hedgedoc/cli
cd cli/bin
# optionally symlink the hedgedoc script somewhere into your $PATH
ln -s $PWD/hedgedoc /usr/local/bin/hedgedoc

# set HEDGEDOC_SERVER environment variable to your server's URL
# it defaults to http://127.0.0.1:3000
export HEDGEDOC_SERVER='https://hedgedoc.example.com'  

# Test by creating a new note
hedgedoc login --email
hedgedoc import test.md

Documentation

Create/import a new note

$ hedgedoc import <input_path> [note_id]     # takes a local path to a text file, and an optional note id for the new note
qhmNmwmxSmK1H2oJmkKBQQ                     # returns <note_id> on success

You can open the new note on the server by going to $HEDGEDOC_SERVER/<note_id>.

Publish an existing note

$ hedgedoc publish qhmNmwmxSmK1H2oJmkKBQQ   # takes a <note_id>
S1ok9no3f                                 # returns public note id

You can open the published note on the server by going to $HEDGEDOC_SERVER/s/<public_note_id>.

Export an existing note

$ hedgedoc export --pdf qhmNmwmxSmK1H2oJmkKBQQ             # takes a <note_id>, outputs to <note_id>.pdf by default
$ hedgedoc export --md qhmNmwmxSmK1H2oJmkKBQQ my_note.md   # or you can specify an output path explicitly
$ hedgedoc export --html qhmNmwmxSmK1H2oJmkKBQQ
$ hedgedoc export --slides qhmNmwmxSmK1H2oJmkKBQQ my_slides.zip

Authenticate and get notes history

# optionally add the HEDGEDOC_COOKIES_FILE environment variable to specify
# where cookies will be stored. It defaults to ~/.config/hedgedoc-cli/key.conf
$ export HEDGEDOC_COOKIES_FILE=~/.config/hedgedoc-cli/key.conf

Authenticate with email

$ hedgedoc login --email [email protected] p4sW0rD  # takes an email and password as optional args
$ hedgedoc login --email                            # or pass them via stdin prompt instead

Authenticate with LDAP

$ hedgedoc login --ldap username p4sW0rD            # takes a username and a password as optional args
$ hedgedoc login --ldap                             # or pass them via stdin prompt instead

Get auth status, history, and logout

$ hedgedoc profile
You are logged in to a HedgeDoc server.

HEDGEDOC_SERVER=https://hedgedoc.example.com
HEDGEDOC_COOKIES_FILE=/Users/someuser/.config/hedgedoc/key.conf

USER_NAME=alice
USER_ID=abc93e9b-bf57-490f-a4c6-0d7a842b7cd4
USER_PHOTO=https://cdn.libravatar.org/avatar/ba8b1ebe25440cd38748639eebdc8eaf?s=96

$ hedgedoc history
ID  Title
fCbvG5pdSYOLobNN1SDUhg  Example-note-title
...

$ hedgedoc logout

Your hedgedoc auth session cookie is written to $HEDGEDOC_COOKIES_FILE (which defaults to ~/.config/hedgedoc/key.conf).

You may need to log in again if:

  • your session expired
  • the hedgedoc server was restarted (which force-expires all sessions as a side-effect)
  • the is$HEDGEDOC_COOKIES_FILE deleted, moved, or becomes unreadable by hedgedoc-cli

API Endpoints

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.

  • https://<hedgedoc_server>/login
  • https://<hedgedoc_server>/logout
  • https://<hedgedoc_server>/me
  • https://<hedgedoc_server>/history (requires auth)
  • https://<hedgedoc_server>/new
  • https://<hedgedoc_server>/new/<note_id>
  • https://<hedgedoc_server>/<note_id>/publish
  • https://<hedgedoc_server>/<note_id>/download
  • https://<hedgedoc_server>/<note_id>/pdf
  • https://<hedgedoc_server>/<note_id>/slide

Help contribute!

We'd love a PR for any one of these commands!

  • hedgedoc edit <note_id> < new_content.md
  • hedgedoc inviteuser <email_to_invite>
  • hedgedoc chmod <permissions> <note_id>
  • hedgedoc chown <user> <note_id>
  • hedgedoc delete <note_id>
  • hedgedoc list --all list all notes on the server by id: title
  • hedgedoc list <user_email> list notes for a given user by id: title
  • hedgedoc search <query> find a note ids matching a given query

Inspiration

If you want to build something with this CLI, here are some ideas that the community has requested:

Import/Export:

Permission management:

  • Support permission of invitee only: ./hedgedoc inviteuser --permissions r <user_email> could work by first chmod and chowning the note, then sending an email invite to that note
  • Find the notes by the owner: ./hedgedoc list <user_email> works as a rudimentary API to do this form the command line
  • Add user administration: setup a script that creates all the users & their notes from .md files on disk, chown & chmods them to their proper permissions, then invites all the users to join. Would be possible to run this on a timer to do regularly as well.

Sync backends:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].