Skip to content

About

The HackMD Command Line Tool

Topics

Resources

Stars

179 stars

Watchers

7 watching

Forks

Repository files navigation

hackmd-cli - The HackMD Command Line Tool

oclif Version Downloads/week License

v2 notice

hackmd-cli v2 now only supports the official HackMD instance (hackmd.io) and HackMD EE instances after version 1.38.1. CodiMD is not supported in this package.

CodiMD users: A dedicated standalone CLI is now available at hackmdio/codimd-cli. Please refer to that repository for installation and usage instructions.

Migrating from v1.x

  1. If you are using the CLI with CodiMD, please use the standalone codimd-cli instead.
  2. If you are using the CLI with HackMD(hackmd.io) or HackMD EE(Enterprise Edition) instances:
    • You're using the JSON file-based config: Remove ~/.hackmd/config.json and start over again. You can start with configuration section.
    • You're using environment variable based config: HMD_CLI_SERVER_URL has been replaced with HMD_API_ENDPOINT_URL. And HMD_API_ENDPOINT_URL may vary depending on your instance. Please check contact your instance admin to get the correct HMD_API_ENDPOINT_URL. For generating access token, please check the configuration section. You'll need to set the HMD_API_ACCESS_TOKEN environment variable.

Usage

$ npm install -g @hackmd/hackmd-cli
$ hackmd-cli COMMAND
running command...
$ hackmd-cli (--version|-v)
@hackmd/hackmd-cli/2.6.0 darwin-arm64 node-v24.21.0
$ hackmd-cli --help [COMMAND]
USAGE
  $ hackmd-cli COMMAND
...

Shell completion

Run hackmd-cli autocomplete bash, hackmd-cli autocomplete zsh, or hackmd-cli autocomplete fish and follow the printed setup instructions.

Fish completion is generated in the CLI cache. Its setup instructions copy the generated file into your user completion directory; no system directory or pkg-config is required. Run the setup again after upgrading the CLI.

Full API access

Use the focused notes, folders, and other commands for common workflows. For other API operations, use api:

hackmd-cli api operations
hackmd-cli api describe GetTeamNote
hackmd-cli api call GetTeamNote --path teampath=docs --path noteId=abc
hackmd-cli api call ListVersions --path noteId=abc --query limit=10
hackmd-cli api call CreateNote --body @note.json
hackmd-cli api call UploadNoteImage --path noteId=abc --file image=@photo.png

Use repeated --path key=value, --query key=value, and --header 'Name: value' flags. --body accepts JSON text, @file, or - for stdin. For multipart image uploads, use --file image=@path; the file extension sets its MIME type, or use --mime to override it. --include prints HTTP status and headers before the response body. Empty 204/304 responses print no body; NDJSON is printed unchanged. Errors exit nonzero.

api operations and api describe need no connection or token. They use the API client bundled with this CLI, so older HackMD EE servers may not support every operation. api call uses the same access token and endpoint configuration as other commands. Writes are not retried automatically.

Configuration

Set access token

Access token should be set before using hackmd-cli. It can be created by landing hackmd.io -> Setting -> API -> Create API token. Copy the token and set it as config variable. For more details, please follow the tutorial: How to issue an API token.

Example:

Set the access token by login command. By doing so, the access token will be saved in ~/.hackmd/config.json.

$ hackmd-cli login
Enter your access token: [hidden]

Or you don't want to keep the credentials in one file, you can set it through environment variable:

export HMD_API_ACCESS_TOKEN=MY_ACCESS_TOKEN

Or you can write the configuration file manually. Edit ~/.hackmd/config.json with the following content:

{
  "accessToken": "MY_ACCESS_TOKEN"
}

Specify HackMD API endpoint manually (optional)

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 instance, you will need to configure the API endpoint by either environment variable or JSON configuration manually.

Example:

Set environment variable in your shell profile:

export HMD_API_ENDPOINT_URL=https://my.hackmd-ee.api.endpoint

Or in JSON file (~/.hackmd/config.json):

{
  "hackmdAPIEndpointURL": "https://my.hackmd-ee.api.endpoint"
}

Configuration Reference

Run hackmd-cli config to see which config file is in use and the current settings (the access token value is never printed), or hackmd-cli config --path to print only the config file path.

All available configurations are listed in the table below.

Config key Environment Variable Data Type Example Value Description
hackmdAPIEndpointURL HMD_API_ENDPOINT_URL string https://api.hackmd.io/v1 HackMD EE API endpoint URL
accessToken HMD_API_ACCESS_TOKEN string UFHR12H7FSEF3ADFY3N9YNRN2E49VGR212NBF Token to access HackMD APIs

Commands

hackmd-cli api call OPERATIONID

Call a HackMD API operation

USAGE
  $ hackmd-cli api call OPERATIONID [--body <value>] [--file <value>...] [--header <value>...] [-h]
    [--include] [--mime <value>] [--path <value>...] [--query <value>...]

FLAGS
  -h, --help               Show CLI help.
      --body=<value>       JSON value, @file, or - for stdin
      --file=<value>...    Multipart binary field, e.g. image=@photo.png
      --header=<value>...  Request header Name: value
      --include            Include HTTP status and response headers
      --mime=<value>       MIME type override for --file
      --path=<value>...    Path parameter key=value
      --query=<value>...   Query parameter key=value

DESCRIPTION
  Call a HackMD API operation

EXAMPLES
  $ hackmd-cli api call GetTeamNote --path teampath=docs --path noteId=abc

  $ hackmd-cli api call CreateNote --body @note.json

  $ hackmd-cli api call UploadNoteImage --path noteId=abc --file image=@photo.png

See code: src/commands/api/call.ts

hackmd-cli api describe OPERATIONID

Show details for an API operation

USAGE
  $ hackmd-cli api describe OPERATIONID [-h]

FLAGS
  -h, --help  Show CLI help.

DESCRIPTION
  Show details for an API operation

See code: src/commands/api/describe.ts

hackmd-cli api operations

List available API operations

USAGE
  $ hackmd-cli api operations [-h]

FLAGS
  -h, --help  Show CLI help.

DESCRIPTION
  List available API operations

See code: src/commands/api/operations.ts

hackmd-cli autocomplete [SHELL]

Display autocomplete installation instructions

USAGE
  $ hackmd-cli autocomplete [SHELL] [-r]

ARGUMENTS
  [SHELL]  (bash|fish|zsh|powershell) Shell type

FLAGS
  -r, --refresh-cache  Refresh cache (ignores displaying instructions)

DESCRIPTION
  Display autocomplete installation instructions

EXAMPLES
  $ hackmd-cli autocomplete

  $ hackmd-cli autocomplete bash

  $ hackmd-cli autocomplete fish

  $ hackmd-cli autocomplete zsh

  $ hackmd-cli autocomplete --refresh-cache

See code: src/commands/autocomplete/index.ts

hackmd-cli config

Show config file path and current configuration (credentials are never printed)

USAGE
  $ hackmd-cli config [-h] [--path]

FLAGS
  -h, --help  Show CLI help.
      --path  print only the config file path

DESCRIPTION
  Show config file path and current configuration (credentials are never printed)

EXAMPLES
  $ hackmd-cli config
  Config file: /Users/you/.hackmd/config.json
  hackmdAPIEndpointURL: https://api.hackmd.io/v1
  accessToken: (set)

  $ hackmd-cli config --path
  /Users/you/.hackmd/config.json

See code: src/commands/config.ts

hackmd-cli export

Export note content

USAGE
  $ hackmd-cli export [-h] [--noteId <value>]

FLAGS
  -h, --help            Show CLI help.
      --noteId=<value>  HackMD note id

DESCRIPTION
  Export note content

EXAMPLES
  $ hackmd-cli export --noteId=kNFWV5E-Qz-QP7u6XnNvyQ
  # A note to be exported

See code: src/commands/export.ts

hackmd-cli folders

HackMD folders commands

USAGE
  $ hackmd-cli folders [--folderId <value>] [-h] [--columns <value> | -x] [--filter <value>] [--no-header |
    [--csv | --no-truncate]] [--output csv|json|yaml |  | ] [--sort <value>]

FLAGS
  -h, --help              Show CLI help.
  -x, --extended          show extra columns
      --columns=<value>   only show provided columns (comma-separated)
      --csv               output is csv format [alias: --output=csv]
      --filter=<value>    filter property by partial string matching, ex: name=foo
      --folderId=<value>  HackMD folder id
      --no-header         hide table header from output
      --no-truncate       do not truncate output to fit screen
      --output=<option>   output in a more machine friendly format
                          <options: csv|json|yaml>
      --sort=<value>      property to sort by (prepend '-' for descending)

DESCRIPTION
  HackMD folders commands

EXAMPLES
  $ hackmd-cli folders
  ID                                   Color   Description           Icon  Name        Parent Folder ID
  ──────────────────────────────────── ─────── ───────────────────── ───── ─────────── ────────────────────────────────────
  91722050-bf47-4334-9e5d-87125a724c29 #4F46E5 Project documentation 1F600 engineering fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c

See code: src/commands/folders/index.ts

hackmd-cli folders create

Create a folder

USAGE
  $ hackmd-cli folders create [--color <value>] [--description <value>] [-h] [--icon <value>] [--name <value>]
    [--parentFolderId <value>] [--columns <value> | -x] [--filter <value>] [--no-header | [--csv | --no-truncate]]
    [--output csv|json|yaml |  | ] [--sort <value>]

FLAGS
  -h, --help                    Show CLI help.
  -x, --extended                show extra columns
      --color=<value>           folder color
      --columns=<value>         only show provided columns (comma-separated)
      --csv                     output is csv format [alias: --output=csv]
      --description=<value>     folder description
      --filter=<value>          filter property by partial string matching, ex: name=foo
      --icon=<value>            folder icon
      --name=<value>            folder name
      --no-header               hide table header from output
      --no-truncate             do not truncate output to fit screen
      --output=<option>         output in a more machine friendly format
                                <options: csv|json|yaml>
      --parentFolderId=<value>  parent folder id
      --sort=<value>            property to sort by (prepend '-' for descending)

DESCRIPTION
  Create a folder

EXAMPLES
  $ hackmd-cli folders create --name='docs' --parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c --description='Docs' --icon=1F600 --color=#4F46E5
  ID                                   Name Parent Folder ID                     Color   Description Icon
  ──────────────────────────────────── ──── ──────────────────────────────────── ─────── ─────────── ─────
  a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d docs fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c #4F46E5 Docs        1F600

See code: src/commands/folders/create.ts

hackmd-cli folders delete

Delete a folder

USAGE
  $ hackmd-cli folders delete [--folderId <value>] [-h]

FLAGS
  -h, --help              Show CLI help.
      --folderId=<value>  HackMD folder id

DESCRIPTION
  Delete a folder

EXAMPLES
  $ hackmd-cli folders delete --folderId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d

See code: src/commands/folders/delete.ts

hackmd-cli folders order

Get or update folder order

USAGE
  $ hackmd-cli folders order [-h] [--order <value>]

FLAGS
  -h, --help           Show CLI help.
      --order=<value>  folder order JSON, e.g. {"root":["folder-id"]}

DESCRIPTION
  Get or update folder order

EXAMPLES
  $ hackmd-cli folders order

  $ hackmd-cli folders order --order='{"root":["91722050-bf47-4334-9e5d-87125a724c29","fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c"]}'

See code: src/commands/folders/order.ts

hackmd-cli folders update

Update folder

USAGE
  $ hackmd-cli folders update [--clear description|icon|color...] [--color <value>] [--description <value>]
    [--folderId <value>] [-h] [--icon <value>] [--name <value>] [--parentFolderId <value>] [--root]

FLAGS
  -h, --help                    Show CLI help.
      --clear=<option>...       clear fields: description, icon, color (repeatable)
                                <options: description|icon|color>
      --color=<value>           folder color
      --description=<value>     folder description
      --folderId=<value>        HackMD folder id
      --icon=<value>            folder icon
      --name=<value>            folder name
      --parentFolderId=<value>  parent folder id
      --root                    move to the root folder

DESCRIPTION
  Update folder

EXAMPLES
  $ hackmd-cli folders update --folderId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d --name='docs' --parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c --description='Docs' --icon=1F600 --color=#4F46E5

  $ hackmd-cli folders update --folderId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d --root --clear=description

See code: src/commands/folders/update.ts

hackmd-cli help [COMMAND]

Display help for hackmd-cli.

USAGE
  $ hackmd-cli help [COMMAND...] [-n]

ARGUMENTS
  [COMMAND...]  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for hackmd-cli.

See code: @oclif/plugin-help

hackmd-cli history

List user browse history

USAGE
  $ hackmd-cli history [-h] [--limit <value>] [--columns <value> | -x] [--filter <value>] [--no-header |
    [--csv | --no-truncate]] [--output csv|json|yaml |  | ] [--sort <value>]

FLAGS
  -h, --help             Show CLI help.
  -x, --extended         show extra columns
      --columns=<value>  only show provided columns (comma-separated)
      --csv              output is csv format [alias: --output=csv]
      --filter=<value>   filter property by partial string matching, ex: name=foo
      --limit=<value>    maximum number of history items to return
      --no-header        hide table header from output
      --no-truncate      do not truncate output to fit screen
      --output=<option>  output in a more machine friendly format
                         <options: csv|json|yaml>
      --sort=<value>     property to sort by (prepend '-' for descending)

DESCRIPTION
  List user browse history

EXAMPLES
  $ hackmd-cli history
  ID                     Title                            User Path               Team Path
  ────────────────────── ──────────────────────────────── ────────────────────── ────────
  raUuSTetT5uQbqQfLnz9lA CLI test note                    gvfz2UB5THiKABQJQnLs6Q null
  BnC6gN0_TfStV2KKmPPXeg Welcome to your team's workspace null                   CLI-test

  $ hackmd-cli history --limit=10

See code: src/commands/history.ts

hackmd-cli login

Login to HackMD server from CLI

USAGE
  $ hackmd-cli login [-h]

FLAGS
  -h, --help  Show CLI help.

DESCRIPTION
  Login to HackMD server from CLI

EXAMPLES
  $ hackmd-cli login
  Enter your access token: MY_ACCESS_TOKEN
  Login successfully

See code: src/commands/login.ts

hackmd-cli logout

Login to HackMD server from CLI

USAGE
  $ hackmd-cli logout [-h]

FLAGS
  -h, --help  Show CLI help.

DESCRIPTION
  Login to HackMD server from CLI

EXAMPLES
  $ hackmd-cli logout
  You've logged out successfully

See code: src/commands/logout.ts

hackmd-cli notes

HackMD notes commands

USAGE
  $ hackmd-cli notes [-h] [--noteId <value>] [--columns <value> | -x] [--filter <value>] [--no-header |
    [--csv | --no-truncate]] [--output csv|json|yaml |  | ] [--sort <value>]

FLAGS
  -h, --help             Show CLI help.
  -x, --extended         show extra columns
      --columns=<value>  only show provided columns (comma-separated)
      --csv              output is csv format [alias: --output=csv]
      --filter=<value>   filter property by partial string matching, ex: name=foo
      --no-header        hide table header from output
      --no-truncate      do not truncate output to fit screen
      --noteId=<value>   HackMD note id
      --output=<option>  output in a more machine friendly format
                         <options: csv|json|yaml>
      --sort=<value>     property to sort by (prepend '-' for descending)

DESCRIPTION
  HackMD notes commands

EXAMPLES
  $ hackmd-cli notes
  ID                     Title                            User Path               Team Path
  ────────────────────── ──────────────────────────────── ────────────────────── ────────
  raUuSTetT5uQbqQfLnz9lA CLI test note                    gvfz2UB5THiKABQJQnLs6Q null

See code: src/commands/notes/index.ts

hackmd-cli notes create

Create a note

USAGE
  $ hackmd-cli notes create [--commentPermission <value>] [--content <value>] [--description <value>] [-e] [-h]
    [--parentFolderId <value>] [--readPermission <value>] [--tags <value>] [--title <value>] [--writePermission <value>]
    [--columns <value> | -x] [--filter <value>] [--no-header | [--csv | --no-truncate]] [--output csv|json|yaml |  | ]
    [--sort <value>]

FLAGS
  -e, --editor                     create note with $EDITOR
  -h, --help                       Show CLI help.
  -x, --extended                   show extra columns
      --columns=<value>            only show provided columns (comma-separated)
      --commentPermission=<value>  set comment permission: disabled, forbidden, owners, signed_in_users, everyone
      --content=<value>            new note content
      --csv                        output is csv format [alias: --output=csv]
      --description=<value>        note description
      --filter=<value>             filter property by partial string matching, ex: name=foo
      --no-header                  hide table header from output
      --no-truncate                do not truncate output to fit screen
      --output=<option>            output in a more machine friendly format
                                   <options: csv|json|yaml>
      --parentFolderId=<value>     parent folder id
      --readPermission=<value>     set note permission: owner, signed_in, guest
      --sort=<value>               property to sort by (prepend '-' for descending)
      --tags=<value>               set note tags, comma-separated (e.g. tag1,tag2)
      --title=<value>              new note title
      --writePermission=<value>    set note permission: owner, signed_in, guest

DESCRIPTION
  Create a note

EXAMPLES
  $ hackmd-cli notes create --content='# A new note' --readPermission=owner --writePermission=owner --commentPermission=disabled
  ID                     Title                            User Path               Team Path
  ────────────────────── ──────────────────────────────── ────────────────────── ────────
  raUuSTetT5uQbqQfLnz9lA A new note                       gvfz2UB5THiKABQJQnLs6Q null     

  $ hackmd-cli notes create --parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c --content='# A new note' --readPermission=owner --writePermission=owner --commentPermission=disabled
  ID                     Title                            User Path               Team Path
  ────────────────────── ──────────────────────────────── ────────────────────── ────────
  raUuSTetT5uQbqQfLnz9lA A new note                       gvfz2UB5THiKABQJQnLs6Q null     

  Or you can pipe content via Unix pipeline:

  cat README.md | hackmd-cli notes create

  $ hackmd-cli notes create --title='My note' --description='Short summary'

See code: src/commands/notes/create.ts

hackmd-cli notes delete

Delete a note

USAGE
  $ hackmd-cli notes delete [-h] [--noteId <value>]

FLAGS
  -h, --help            Show CLI help.
      --noteId=<value>  HackMD note id

DESCRIPTION
  Delete a note

EXAMPLES
  $ hackmd-cli notes delete --noteId=WNkLM6gkS0Cg2cQ8rv7bYA

See code: src/commands/notes/delete.ts

hackmd-cli notes update

Update note

USAGE
  $ hackmd-cli notes update [--clear description...] [--content <value>] [--description <value>] [-h] [--noteId
    <value>] [--parentFolderId <value>] [--permalink <value>] [--readPermission <value>] [--root] [--tags <value>]
    [--title <value>] [--writePermission <value>]

FLAGS
  -h, --help                     Show CLI help.
      --clear=<option>...        clear fields: description (repeatable)
                                 <options: description>
      --content=<value>          new note content
      --description=<value>      note description
      --noteId=<value>           HackMD note id
      --parentFolderId=<value>   parent folder id
      --permalink=<value>        note permalink
      --readPermission=<value>   set note permission: owner, signed_in, guest
      --root                     move to the root folder
      --tags=<value>             set note tags, comma-separated (e.g. tag1,tag2)
      --title=<value>            new note title
      --writePermission=<value>  set note permission: owner, signed_in, guest

DESCRIPTION
  Update note

EXAMPLES
  $ hackmd-cli notes update --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --title='A new title'

  $ hackmd-cli notes update --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --content='# A new title'

  $ hackmd-cli notes update --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c --content='# A new title'

  $ hackmd-cli notes update --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --readPermission=owner --writePermission=owner

  $ hackmd-cli notes update --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --tags=tag1,tag2

  $ cat README.md | hackmd-cli notes update --noteId=WNkLM6gkS0Cg2cQ8rv7bYA

  $ hackmd-cli notes update --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --description='Updated summary' --root

  $ hackmd-cli notes update --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --clear=description

See code: src/commands/notes/update.ts

hackmd-cli team-folders

HackMD team folders commands

USAGE
  $ hackmd-cli team-folders [--folderId <value>] [-h] [--teamPath <value>] [--columns <value> | -x] [--filter
    <value>] [--no-header | [--csv | --no-truncate]] [--output csv|json|yaml |  | ] [--sort <value>]

FLAGS
  -h, --help              Show CLI help.
  -x, --extended          show extra columns
      --columns=<value>   only show provided columns (comma-separated)
      --csv               output is csv format [alias: --output=csv]
      --filter=<value>    filter property by partial string matching, ex: name=foo
      --folderId=<value>  HackMD folder id
      --no-header         hide table header from output
      --no-truncate       do not truncate output to fit screen
      --output=<option>   output in a more machine friendly format
                          <options: csv|json|yaml>
      --sort=<value>      property to sort by (prepend '-' for descending)
      --teamPath=<value>  HackMD team path

DESCRIPTION
  HackMD team folders commands

EXAMPLES
  $ hackmd-cli team-folders --teamPath engineering
  ID                                   Color   Description     Icon  Name       Parent Folder ID
  ──────────────────────────────────── ─────── ─────────────── ───── ────────── ────────────────────────────────────
  91722050-bf47-4334-9e5d-87125a724c29 #4F46E5 Team handbook    1F600 team-docs fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c

See code: src/commands/team-folders/index.ts

hackmd-cli team-folders create

Create a team folder

USAGE
  $ hackmd-cli team-folders create [--color <value>] [--description <value>] [-h] [--icon <value>] [--name <value>]
    [--parentFolderId <value>] [--teamPath <value>] [--columns <value> | -x] [--filter <value>] [--no-header | [--csv |
    --no-truncate]] [--output csv|json|yaml |  | ] [--sort <value>]

FLAGS
  -h, --help                    Show CLI help.
  -x, --extended                show extra columns
      --color=<value>           folder color
      --columns=<value>         only show provided columns (comma-separated)
      --csv                     output is csv format [alias: --output=csv]
      --description=<value>     folder description
      --filter=<value>          filter property by partial string matching, ex: name=foo
      --icon=<value>            folder icon
      --name=<value>            folder name
      --no-header               hide table header from output
      --no-truncate             do not truncate output to fit screen
      --output=<option>         output in a more machine friendly format
                                <options: csv|json|yaml>
      --parentFolderId=<value>  parent folder id
      --sort=<value>            property to sort by (prepend '-' for descending)
      --teamPath=<value>        HackMD team path

DESCRIPTION
  Create a team folder

EXAMPLES
  $ hackmd-cli team-folders create --teamPath=CLI-test --name='team-docs' --parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c --description='Docs' --icon=1F600 --color=#4F46E5
  ID                                   Name      Parent Folder ID                     Color   Description Icon
  ──────────────────────────────────── ───────── ──────────────────────────────────── ─────── ─────────── ─────
  a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d team-docs fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c #4F46E5 Docs        1F600

See code: src/commands/team-folders/create.ts

hackmd-cli team-folders delete

Delete a team folder

USAGE
  $ hackmd-cli team-folders delete [--folderId <value>] [-h] [--teamPath <value>]

FLAGS
  -h, --help              Show CLI help.
      --folderId=<value>  HackMD folder id
      --teamPath=<value>  HackMD team path

DESCRIPTION
  Delete a team folder

EXAMPLES
  $ hackmd-cli team-folders delete --teamPath=CLI-test --folderId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d

See code: src/commands/team-folders/delete.ts

hackmd-cli team-folders order

Get or update team folder order

USAGE
  $ hackmd-cli team-folders order [-h] [--order <value>] [--teamPath <value>]

FLAGS
  -h, --help              Show CLI help.
      --order=<value>     folder order JSON, e.g. {"root":["folder-id"]}
      --teamPath=<value>  HackMD team path

DESCRIPTION
  Get or update team folder order

EXAMPLES
  $ hackmd-cli team-folders order --teamPath=CLI-test

  $ hackmd-cli team-folders order --teamPath=CLI-test --order='{"root":["91722050-bf47-4334-9e5d-87125a724c29","fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c"]}'

See code: src/commands/team-folders/order.ts

hackmd-cli team-folders update

Update team folder

USAGE
  $ hackmd-cli team-folders update [--clear description|icon|color...] [--color <value>] [--description <value>]
    [--folderId <value>] [-h] [--icon <value>] [--name <value>] [--parentFolderId <value>] [--root] [--teamPath <value>]

FLAGS
  -h, --help                    Show CLI help.
      --clear=<option>...       clear fields: description, icon, color (repeatable)
                                <options: description|icon|color>
      --color=<value>           folder color
      --description=<value>     folder description
      --folderId=<value>        HackMD folder id
      --icon=<value>            folder icon
      --name=<value>            folder name
      --parentFolderId=<value>  parent folder id
      --root                    move to the root folder
      --teamPath=<value>        HackMD team path

DESCRIPTION
  Update team folder

EXAMPLES
  $ hackmd-cli team-folders update --teamPath=CLI-test --folderId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d --name='team-docs' --parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c --description='Docs' --icon=1F600 --color=#4F46E5

  $ hackmd-cli team-folders update --teamPath=CLI-test --folderId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d --root --clear=description

See code: src/commands/team-folders/update.ts

hackmd-cli team-notes

HackMD team-notes commands

USAGE
  $ hackmd-cli team-notes [-h] [--noteId <value>] [--teamPath <value>] [--columns <value> | -x] [--filter
    <value>] [--no-header | [--csv | --no-truncate]] [--output csv|json|yaml |  | ] [--sort <value>]

FLAGS
  -h, --help              Show CLI help.
  -x, --extended          show extra columns
      --columns=<value>   only show provided columns (comma-separated)
      --csv               output is csv format [alias: --output=csv]
      --filter=<value>    filter property by partial string matching, ex: name=foo
      --no-header         hide table header from output
      --no-truncate       do not truncate output to fit screen
      --noteId=<value>    HackMD note id
      --output=<option>   output in a more machine friendly format
                          <options: csv|json|yaml>
      --sort=<value>      property to sort by (prepend '-' for descending)
      --teamPath=<value>  HackMD team path

DESCRIPTION
  HackMD team-notes commands

EXAMPLES
  $ hackmd-cli team-notes --teamPath=CLI-test
  ID                     Title                            User path Team path
  ────────────────────── ──────────────────────────────── ──────── ────────
  WNkLM6gkS0Cg2cQ8rv7bYA a team note                      null     CLI-test
  BnC6gN0_TfStV2KKmPPXeg Welcome to your team's workspace null     CLI-test

  $ hackmd-cli team-notes --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA

See code: src/commands/team-notes/index.ts

hackmd-cli team-notes create

Create a team note

USAGE
  $ hackmd-cli team-notes create [--commentPermission <value>] [--content <value>] [--description <value>] [-e] [-h]
    [--parentFolderId <value>] [--readPermission <value>] [--tags <value>] [--teamPath <value>] [--title <value>]
    [--writePermission <value>] [--columns <value> | -x] [--filter <value>] [--no-header | [--csv | --no-truncate]]
    [--output csv|json|yaml |  | ] [--sort <value>]

FLAGS
  -e, --editor                     create note with $EDITOR
  -h, --help                       Show CLI help.
  -x, --extended                   show extra columns
      --columns=<value>            only show provided columns (comma-separated)
      --commentPermission=<value>  set comment permission: disabled, forbidden, owners, signed_in_users, everyone
      --content=<value>            new note content
      --csv                        output is csv format [alias: --output=csv]
      --description=<value>        note description
      --filter=<value>             filter property by partial string matching, ex: name=foo
      --no-header                  hide table header from output
      --no-truncate                do not truncate output to fit screen
      --output=<option>            output in a more machine friendly format
                                   <options: csv|json|yaml>
      --parentFolderId=<value>     parent folder id
      --readPermission=<value>     set note permission: owner, signed_in, guest
      --sort=<value>               property to sort by (prepend '-' for descending)
      --tags=<value>               set note tags, comma-separated (e.g. tag1,tag2)
      --teamPath=<value>           HackMD team path
      --title=<value>              new note title
      --writePermission=<value>    set note permission: owner, signed_in, guest

DESCRIPTION
  Create a team note

EXAMPLES
  $ hackmd-cli team-notes create --teamPath=CLI-test --content='# A new note' --readPermission=owner --writePermission=owner --commentPermission=disabled
  ID                     Title                            User Path              Team Path
  ────────────────────── ──────────────────────────────── ────────────────────── ────────
  raUuSTetT5uQbqQfLnz9lA A new note                       gvfz2UB5THiKABQJQnLs6Q null     

  $ hackmd-cli team-notes create --teamPath=CLI-test --parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c --content='# A new note' --readPermission=owner --writePermission=owner --commentPermission=disabled
  ID                     Title                            User Path              Team Path
  ────────────────────── ──────────────────────────────── ────────────────────── ────────
  raUuSTetT5uQbqQfLnz9lA A new note                       gvfz2UB5THiKABQJQnLs6Q null     

  Or you can pipe content via Unix pipeline:

  cat README.md | hackmd-cli team-notes create --teamPath=CLI-test

  $ hackmd-cli team-notes create --teamPath=CLI-test --title='My note' --description='Short summary'

See code: src/commands/team-notes/create.ts

hackmd-cli team-notes delete

Delete a team note

USAGE
  $ hackmd-cli team-notes delete [-h] [--noteId <value>] [--teamPath <value>]

FLAGS
  -h, --help              Show CLI help.
      --noteId=<value>    HackMD note id
      --teamPath=<value>  HackMD team path

DESCRIPTION
  Delete a team note

EXAMPLES
  $ hackmd-cli team-notes delete --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA

See code: src/commands/team-notes/delete.ts

hackmd-cli team-notes update

Update team note

USAGE
  $ hackmd-cli team-notes update [--clear description...] [--content <value>] [--description <value>] [-h] [--noteId
    <value>] [--parentFolderId <value>] [--permalink <value>] [--readPermission <value>] [--root] [--tags <value>]
    [--teamPath <value>] [--title <value>] [--writePermission <value>]

FLAGS
  -h, --help                     Show CLI help.
      --clear=<option>...        clear fields: description (repeatable)
                                 <options: description>
      --content=<value>          new note content
      --description=<value>      note description
      --noteId=<value>           HackMD note id
      --parentFolderId=<value>   parent folder id
      --permalink=<value>        note permalink
      --readPermission=<value>   set note permission: owner, signed_in, guest
      --root                     move to the root folder
      --tags=<value>             set note tags, comma-separated (e.g. tag1,tag2)
      --teamPath=<value>         HackMD team path
      --title=<value>            new note title
      --writePermission=<value>  set note permission: owner, signed_in, guest

DESCRIPTION
  Update team note

EXAMPLES
  $ hackmd-cli team-notes update --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --title='A new title'

  $ hackmd-cli team-notes update --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --content='# A new title'

  $ hackmd-cli team-notes update --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c --content='# A new title'

  $ hackmd-cli team-notes update --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --readPermission=owner --writePermission=owner

  $ hackmd-cli team-notes update --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --tags=tag1,tag2

  $ cat README.md | hackmd-cli team-notes update --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA

  $ hackmd-cli team-notes update --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --description='Updated summary' --root

  $ hackmd-cli team-notes update --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --clear=description

See code: src/commands/team-notes/update.ts

hackmd-cli teams

List teams

USAGE
  $ hackmd-cli teams [-h] [--columns <value> | -x] [--filter <value>] [--no-header | [--csv |
    --no-truncate]] [--output csv|json|yaml |  | ] [--sort <value>]

FLAGS
  -h, --help             Show CLI help.
  -x, --extended         show extra columns
      --columns=<value>  only show provided columns (comma-separated)
      --csv              output is csv format [alias: --output=csv]
      --filter=<value>   filter property by partial string matching, ex: name=foo
      --no-header        hide table header from output
      --no-truncate      do not truncate output to fit screen
      --output=<option>  output in a more machine friendly format
                         <options: csv|json|yaml>
      --sort=<value>     property to sort by (prepend '-' for descending)

DESCRIPTION
  List teams

EXAMPLES
  $ hackmd-cli teams
  ID                                   Name          Path     Owner ID
  ──────────────────────────────────── ───────────── ──────── ────────────────────────────────────
  f76308a6-d77a-41f6-86d0-8ada426a6fb4 CLI test team CLI-test 82f7f3d9-4079-4c78-8a00-14094272ece9

See code: src/commands/teams.ts

hackmd-cli version

USAGE
  $ hackmd-cli version [--json] [--verbose]

FLAGS
  --verbose  Show additional information about the CLI.

GLOBAL FLAGS
  --json  Format output as json.

FLAG DESCRIPTIONS
  --verbose  Show additional information about the CLI.

    Additionally shows the architecture, node version, operating system, and versions of plugins that the CLI is using.

See code: @oclif/plugin-version

hackmd-cli whoami

Show current user information

USAGE
  $ hackmd-cli whoami [-h] [--columns <value> | -x] [--filter <value>] [--no-header | [--csv |
    --no-truncate]] [--output csv|json|yaml |  | ] [--sort <value>]

FLAGS
  -h, --help             Show CLI help.
  -x, --extended         show extra columns
      --columns=<value>  only show provided columns (comma-separated)
      --csv              output is csv format [alias: --output=csv]
      --filter=<value>   filter property by partial string matching, ex: name=foo
      --no-header        hide table header from output
      --no-truncate      do not truncate output to fit screen
      --output=<option>  output in a more machine friendly format
                         <options: csv|json|yaml>
      --sort=<value>     property to sort by (prepend '-' for descending)

DESCRIPTION
  Show current user information

EXAMPLES
  $ hackmd-cli whoami
  ID                                   Name           Email User path
  ──────────────────────────────────── ────────────── ───── ──────────────────────
  82f7f3d9-4079-4c78-8a00-14094272ece9 Ming-Hsiu Tsai null  gvfz2UB5THiKABQJQnLs6Q

See code: src/commands/whoami.ts

License

MIT

Changelog

See CHANGELOG.md for a list of changes and version history.

About

The HackMD Command Line Tool

Topics

Resources

Stars

179 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages