Skip to content

getMoreBrain/bitmark-cli

Repository files navigation

@gmb/bitmark-cli

Build & Test

Try out bitmark - visit the bitmark Playground

bitmark command line tool.

Usage

$ npm install -g @gmb/bitmark-cli
$ bitmark COMMAND
running command...
$ bitmark (--version)
@gmb/bitmark-cli/1.5.1 darwin-x64 node-v18.14.2
$ bitmark --help [COMMAND]
USAGE
  $ bitmark COMMAND
...

Commands

bitmark breakscape [INPUT]

Breakscape text

USAGE
  $ bitmark breakscape [INPUT] [-a -o <value>]

ARGUMENTS
  INPUT  file to read, or text. If not specified, input will be from <stdin>

FILE OUTPUT FLAGS
  -a, --append       append to the output file (default is to overwrite)
  -o, --output=FILE  output file. If not specified, output will be to <stdout>

DESCRIPTION
  Breakscape text

EXAMPLES
  $ bitmark breakscape '[.article] Hello World'

  $ bitmark breakscape input.txt -o output.txt

See code: src/commands/breakscape.ts

bitmark convert [INPUT]

Convert between bitmark formats

USAGE
  $ bitmark convert [INPUT] [-v 2|3] [-f bitmark|json|ast] [-w] [--indent <value> -p] [--plainText]
    [--excludeUnknownProperties] [--explicitTextFormat] [--cardSetVersion 1|2] [-a -o <value>] [--parser peggy|antlr]

ARGUMENTS
  INPUT  file to read, or bitmark or json string. If not specified, input will be from <stdin>

FLAGS
  -f, --format=<option>   output format. If not specified, bitmark is converted to JSON, and JSON / AST is converted to
                          bitmark
                          <options: bitmark|json|ast>
  -v, --version=<option>  version of bitmark to use (default: latest)
                          <options: 2|3>
  -w, --warnings          enable warnings in the output

FILE OUTPUT FLAGS
  -a, --append       append to the output file (default is to overwrite)
  -o, --output=FILE  output file. If not specified, output will be to <stdout>

JSON FORMATTING FLAGS
  -p, --pretty                    prettify the JSON output with indent
      --excludeUnknownProperties  exclude unknown properties in the JSON output
      --indent=INDENT             prettify indent (default:2)
      --plainText                 output text as plain text rather than JSON (default: set by bitmark version)

BITMARK FORMATTING FLAGS
  --cardSetVersion=<option>  version of card set to use in bitmark (default: set by bitmark version)
                             <options: 1|2>
  --explicitTextFormat       include bitmark text format in bitmark even if it is the default (bitmark--)

PARSER OPTIONS FLAGS
  --parser=<option>  [default: peggy] parser to use
                     <options: peggy|antlr>

DESCRIPTION
  Convert between bitmark formats

EXAMPLES
  $ bitmark convert '[.article] Hello World'

  $ bitmark convert '[{"bitmark": "[.article] Hello World","bit": { "type": "article", "format": "bitmark--", "body": "Hello World" }}]'

  $ bitmark convert input.json -o output.bit

  $ bitmark convert input.bit -o output.json

  $ bitmark convert -f ast input.json -o output.ast.json

See code: src/commands/convert.ts

bitmark convertText [INPUT]

Convert between bitmark text formats

USAGE
  $ bitmark convertText [INPUT] [-f bitmark--|bitmark++] [--indent <value> -p] [-a -o <value>]

ARGUMENTS
  INPUT  file to read, or text or json string. If not specified, input will be from <stdin>

FLAGS
  -f, --textFormat=<option>  [default: bitmark--] conversion format
                             <options: bitmark--|bitmark++>

FILE OUTPUT FLAGS
  -a, --append       append to the output file (default is to overwrite)
  -o, --output=FILE  output file. If not specified, output will be to <stdout>

JSON FORMATTING FLAGS
  -p, --pretty         prettify the JSON output with indent
      --indent=INDENT  prettify indent (default:2)

DESCRIPTION
  Convert between bitmark text formats

EXAMPLES
  $ bitmark convertText 'Hello World'

  $ bitmark convertText '[{"type":"paragraph","content":[{"text":"Hello World","type":"text"}],"attrs":{}}]'

  $ bitmark convertText input.json -o output.txt

  $ bitmark convertText input.txt -o output.json

See code: src/commands/convertText.ts

bitmark help [COMMANDS]

Display help for bitmark.

USAGE
  $ bitmark help [COMMANDS] [-n]

ARGUMENTS
  COMMANDS  Command to show help for.

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

DESCRIPTION
  Display help for bitmark.

See code: @oclif/plugin-help

bitmark info [INFO]

Display information about bitmark

USAGE
  $ bitmark info [INFO] [-f text|json] [--bit <value> | --all | --deprecated] [--indent <value> -p] [-a -o
    <value>]

ARGUMENTS
  INFO  (list|bit) [default: list] information to return. If not specified, a list of bits will be returned

FLAGS
  -f, --format=<option>  [default: text] output format. If not specified, the ouput will be text
                         <options: text|json>
      --all              output all bits including deprecated
      --bit=<value>      bit to filter. If not specified, all bits will be returned
      --deprecated       output deprecated bits

FILE OUTPUT FLAGS
  -a, --append       append to the output file (default is to overwrite)
  -o, --output=FILE  output file. If not specified, output will be to <stdout>

JSON FORMATTING FLAGS
  -p, --pretty         prettify the JSON output with indent
      --indent=INDENT  prettify indent (default:2)

DESCRIPTION
  Display information about bitmark

EXAMPLES
  $ bitmark info

  $ bitmark info --all

  $ bitmark info list --deprecated

  $ bitmark info bit --bit=cloze

  $ bitmark info -f json -p bit --bit=still-image-film

See code: src/commands/info.ts

bitmark unbreakscape [INPUT]

Unbreakscape text

USAGE
  $ bitmark unbreakscape [INPUT] [-a -o <value>]

ARGUMENTS
  INPUT  file to read, or text. If not specified, input will be from <stdin>

FILE OUTPUT FLAGS
  -a, --append       append to the output file (default is to overwrite)
  -o, --output=FILE  output file. If not specified, output will be to <stdout>

DESCRIPTION
  Unbreakscape text

EXAMPLES
  $ bitmark unbreakscape '[^.article] Hello World'

  $ bitmark unbreakscape input.txt -o output.txt

See code: src/commands/unbreakscape.ts