npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hackmd/codimd-cli

v1.0.3

Published

codimd-cli - The CodiMD Command Line Tool ===

Downloads

13

Readme

codimd-cli - The CodiMD Command Line Tool

oclif Version Downloads/week License

Usage

$ npm install -g @hackmd/codimd-cli
$ codimd-cli COMMAND
running command...
$ codimd-cli (-v|--version|version)
@hackmd/codimd-cli/1.0.3 linux-x64 node-v8.17.0
$ codimd-cli --help [COMMAND]
USAGE
  $ codimd-cli COMMAND
...

Configuration

codimd-cli support both JSON file config and environment variable config.

The config file is located at ~/.codimd/config.json, it should be like this:

{
  "serverUrl": "https://my.codimd-domain.dev"
}

Change the serverUrl value to your hosted CodiMD instance URL.

You can also speicify config as environment variable. For example, append this line to your .bashrc:

export CMD_CLI_SERVER_URL=https://my.codimd-domain.dev

All available configurations are listed in the table below.

| Config key | Environment Variable | Data Type | Example Value | Description | | ------------ |:--------------------- | ---------- | ------------------------------ | ------------------------------------ | | serverUrl | CMD_CLI_SERVER_URL | string | https://my.codimd-domain.dev | The CodiMD instance URL | | cookiePath | CMD_CLI_COOKIE_PATH | string | ~/.codimd/cookies.json | File for storing login cookie states |

Commands

codimd-cli export [NOTEID] [OUTPUT]

Export note to local file

USAGE
  $ codimd-cli export [NOTEID] [OUTPUT]

OPTIONS
  -h, --help  show CLI help
  --html
  --md
  --pdf

EXAMPLE
  $ codimd-cli export [--pdf|--md|--html] <note_id> <output_file>

See code: src/commands/export.ts

codimd-cli help [COMMAND]

display help for codimd-cli

USAGE
  $ codimd-cli help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

codimd-cli history

List history

USAGE
  $ codimd-cli history

OPTIONS
  -h, --help              show CLI help
  -x, --extended          show extra columns
  --columns=columns       only show provided columns (comma-separated)
  --csv                   output is csv format [alias: --output=csv]
  --filter=filter         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=csv|json|yaml  output in a more machine friendly format
  --sort=sort             property to sort by (prepend '-' for descending)

EXAMPLE
  $ codimd-cli history

  ID                     Name
  A58r8ehYTlySO94oiC_MUA Note1
  EeNHDGocSTi70ytMMGQaaQ Note2

See code: src/commands/history.ts

codimd-cli import [FILE]

Create a note from markdown file

USAGE
  $ codimd-cli import [FILE]

OPTIONS
  -h, --help  show CLI help

EXAMPLE
  $ codimd-cli import /path/to/markdown/file.md

  Your note is available at https://codimd.domain/note-url

See code: src/commands/import.ts

codimd-cli login

Login HackMD instance from CLI

USAGE
  $ codimd-cli login

OPTIONS
  -h, --help         show CLI help
  -u, --email=email  Login email

EXAMPLE
  $ codimd-cli login

  Enter your email: [email protected]
  Enter your password: *******

  Login as HMD successfully!

See code: src/commands/login.ts

codimd-cli logout

Logout from CLI

USAGE
  $ codimd-cli logout

OPTIONS
  -h, --help  show CLI help

EXAMPLE
  $ codimd-cli logout

  You've logged out successfully

See code: src/commands/logout.ts

codimd-cli whoami

Show logged in account info

USAGE
  $ codimd-cli whoami

OPTIONS
  -h, --help  show CLI help

EXAMPLE
  $ codimd-cli whoami

  You are logged in codimd.domain as {YOUR NAME} [user-id]

See code: src/commands/whoami.ts

codimd-cli piping mode

You can create a note by piping text stream to codimd-cli

USAGE
  $ codimd-cli [COMMAND]

EXAMPLE
  $ cat README.md | codimd-cli

  Your note is available at https://codimd.domain/note-url

License

MIT