oclif example Hello World CLI
$ npm install -g chptr
$ chptr COMMAND
running command...
$ chptr (--version)
chptr/1.0.0 darwin-arm64 node-v20.10.0
$ chptr --help [COMMAND]
USAGE
$ chptr COMMAND
...
chptr add [NAME] [NUMBER]
chptr build
chptr build compact
chptr build metadata
chptr commit [NUMBERORFILENAME]
chptr compile
chptr del [NAME]
chptr delete [NAME]
chptr edit [CHAPTERIDS]
chptr hello PERSON
chptr hello world
chptr help [COMMANDS]
chptr init [NAME]
chptr mod [CHAPTERIDS]
chptr modify [CHAPTERIDS]
chptr move [DESTINATIONID] [ORIGINID]
chptr plugins
chptr plugins:install PLUGIN...
chptr plugins:inspect PLUGIN...
chptr plugins:install PLUGIN...
chptr plugins:link PLUGIN
chptr plugins:uninstall PLUGIN...
chptr plugins reset
chptr plugins:uninstall PLUGIN...
chptr plugins:uninstall PLUGIN...
chptr plugins update
chptr rename [CHAPTERIDORFILENAME] [NEWNAME]
chptr reorder [DESTINATIONID] [ORIGINID]
chptr save [NUMBERORFILENAME]
chptr setup [NAME]
chptr track [FILENAME]
Adds a file or set of files as a new chapter, locally and in repository
USAGE
$ chptr add [NAME] [NUMBER] [-c]
ARGUMENTS
NAME name of chapter to add
NUMBER [default: end] force this number to be used, if available. AtNumbering will be determined by the presence or
absence of @ sign. Defaults to `end`.
FLAGS
-c, --compact Compact chapter numbers at the same time
DESCRIPTION
Adds a file or set of files as a new chapter, locally and in repository
See code: src/commands/add.ts
Takes all original Markdown files and outputs a single file without metadata and comments. Handles these output formats: md, pdf, docx, html, epub, tex. Gives some insight into writing rate.
USAGE
$ chptr build [-c] [-d] [-s] [-w yes|no|overwrite] [-P | [-D | ]] [-t md|pdf|docx|html|epub|tex|all] [-i]
FLAGS
-D, --outputToPreProd Keep paragraph numbers, but clean markup as if doing an output to Prod.
-P, --outputToProd Remove paragraph numbers, clean markup in output and remove chapter titles. When
false, adds summaries in output.
-c, --compact Compact chapter numbers at the same time
-d, --datetimestamp adds datetime stamp before output filename
-i, --withFullIntermediaryOutput With full intermediary output as .md file
-s, --save Commit to git at the same time.
-t, --type=<option>... filetype to export to. Can be set multiple times.
<options: md|pdf|docx|html|epub|tex|all>
-w, --showWritingRate=<option> [default: yes] Show word count per day. Overwrite option recalculates it all from
scratch.
<options: yes|no|overwrite>
DESCRIPTION
Takes all original Markdown files and outputs a single file without metadata and comments. Handles these output
formats: md, pdf, docx, html, epub, tex. Gives some insight into writing rate.
ALIASES
$ chptr compile
See code: src/commands/build/index.ts
Only compacts numbers of files
USAGE
$ chptr build compact [-s]
FLAGS
-s, --save Commit to git at the same time.
DESCRIPTION
Only compacts numbers of files
See code: src/commands/build/compact.ts
Updates only metadata files
USAGE
$ chptr build metadata [-c] [-d] [-s] [-w yes|no|overwrite]
FLAGS
-c, --compact Compact chapter numbers at the same time
-d, --datetimestamp adds datetime stamp before output filename
-s, --save Commit to git at the same time.
-w, --showWritingRate=<option> [default: yes] Show word count per day. Overwrite option recalculates it all from
scratch.
<options: yes|no|overwrite>
DESCRIPTION
Updates only metadata files
See code: src/commands/build/metadata.ts
Parse modified text files, adjust sentence and paragraph endings, and commit files to repository.
USAGE
$ chptr commit [NUMBERORFILENAME] [-c] [-e | -m <value>] [-n <value> | -f <value>] [-t ]
ARGUMENTS
NUMBERORFILENAME Chamber number to save, or tracked filename or filename pattern to save to repository
FLAGS
-c, --compact Compact chapter numbers at the same time
-e, --empty No manual message in commit
-f, --filename=<value> Tracked filename or filename pattern to filter which files to stage before saving to
repository
-m, --message=<value> Message to use in commit to repository
-n, --number=<value> Chapter number to filter which files to stage before saving to repository
-t, --track Force tracking of file if not already in repository
DESCRIPTION
Parse modified text files, adjust sentence and paragraph endings, and commit files to repository.
ALIASES
$ chptr commit
Takes all original Markdown files and outputs a single file without metadata and comments. Handles these output formats: md, pdf, docx, html, epub, tex. Gives some insight into writing rate.
USAGE
$ chptr compile [-c] [-d] [-s] [-w yes|no|overwrite] [-P | [-D | ]] [-t md|pdf|docx|html|epub|tex|all] [-i]
FLAGS
-D, --outputToPreProd Keep paragraph numbers, but clean markup as if doing an output to Prod.
-P, --outputToProd Remove paragraph numbers, clean markup in output and remove chapter titles. When
false, adds summaries in output.
-c, --compact Compact chapter numbers at the same time
-d, --datetimestamp adds datetime stamp before output filename
-i, --withFullIntermediaryOutput With full intermediary output as .md file
-s, --save Commit to git at the same time.
-t, --type=<option>... filetype to export to. Can be set multiple times.
<options: md|pdf|docx|html|epub|tex|all>
-w, --showWritingRate=<option> [default: yes] Show word count per day. Overwrite option recalculates it all from
scratch.
<options: yes|no|overwrite>
DESCRIPTION
Takes all original Markdown files and outputs a single file without metadata and comments. Handles these output
formats: md, pdf, docx, html, epub, tex. Gives some insight into writing rate.
ALIASES
$ chptr compile
Delete a chapter or tracked file locally and in the repository
USAGE
$ chptr del [NAME] [-c] [-s]
ARGUMENTS
NAME chapter number or filename to delete
FLAGS
-c, --compact Compact chapter numbers at the same time
-s, --save Commit to git at the same time.
DESCRIPTION
Delete a chapter or tracked file locally and in the repository
ALIASES
$ chptr del
Delete a chapter or tracked file locally and in the repository
USAGE
$ chptr delete [NAME] [-c] [-s]
ARGUMENTS
NAME chapter number or filename to delete
FLAGS
-c, --compact Compact chapter numbers at the same time
-s, --save Commit to git at the same time.
DESCRIPTION
Delete a chapter or tracked file locally and in the repository
ALIASES
$ chptr del
See code: src/commands/delete.ts
Adjust sentence and paragraph endings to allow for easier editing. Commit changes with SAVE command.
USAGE
$ chptr edit [CHAPTERIDS] [-t all|summary|chapter]
ARGUMENTS
CHAPTERIDS Chapter number(s) to modify, comma-separated or dash-separated for a range.
FLAGS
-t, --type=<option> [default: all] Edit either chapter file, summary file or all.
<options: all|summary|chapter>
DESCRIPTION
Adjust sentence and paragraph endings to allow for easier editing. Commit changes with SAVE command.
ALIASES
$ chptr modify
$ chptr mod
See code: src/commands/edit.ts
Say hello
USAGE
$ chptr hello PERSON -f <value>
ARGUMENTS
PERSON Person to say hello to
FLAGS
-f, --from=<value> (required) Who is saying hello
DESCRIPTION
Say hello
EXAMPLES
$ oex hello friend --from oclif
hello friend from oclif! (./src/commands/hello/index.ts)
See code: src/commands/hello/index.ts
Say hello world
USAGE
$ chptr hello world
DESCRIPTION
Say hello world
EXAMPLES
$ chptr hello world
hello world! (./src/commands/hello/world.ts)
See code: src/commands/hello/world.ts
Display help for chptr.
USAGE
$ chptr 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 chptr.
See code: @oclif/plugin-help
Generates basic config files for a new novel project
USAGE
$ chptr init [NAME] [-a <value>] [-d /|chapters/|chapters/number/|] [-e <value>] [-f <value>] [-r
<value>] [-l <value>] [-s <value>]
ARGUMENTS
NAME Name of project
FLAGS
-a, --author=<value> Name of author of project
-d, --directorystructure=<option> Directory structure initially written in config file
<options: /|chapters/|chapters/number/|>
-e, --email=<value> Email of author of project
-f, --force=<value> [default: false] Overwrite config files if they exist. Specify a filename to
overwrite only one; write `true` to overwrite all.
-l, --language=<value> Language of project
-r, --gitRemote=<value> Git address of remote repository.
-s, --style=<value> Config files in JSON5 or YAML?
DESCRIPTION
Generates basic config files for a new novel project
ALIASES
$ chptr setup
See code: src/commands/init.ts
Adjust sentence and paragraph endings to allow for easier editing. Commit changes with SAVE command.
USAGE
$ chptr mod [CHAPTERIDS] [-t all|summary|chapter]
ARGUMENTS
CHAPTERIDS Chapter number(s) to modify, comma-separated or dash-separated for a range.
FLAGS
-t, --type=<option> [default: all] Edit either chapter file, summary file or all.
<options: all|summary|chapter>
DESCRIPTION
Adjust sentence and paragraph endings to allow for easier editing. Commit changes with SAVE command.
ALIASES
$ chptr modify
$ chptr mod
Adjust sentence and paragraph endings to allow for easier editing. Commit changes with SAVE command.
USAGE
$ chptr modify [CHAPTERIDS] [-t all|summary|chapter]
ARGUMENTS
CHAPTERIDS Chapter number(s) to modify, comma-separated or dash-separated for a range.
FLAGS
-t, --type=<option> [default: all] Edit either chapter file, summary file or all.
<options: all|summary|chapter>
DESCRIPTION
Adjust sentence and paragraph endings to allow for easier editing. Commit changes with SAVE command.
ALIASES
$ chptr modify
$ chptr mod
Takes a chapter and modifies its index number to fit another ordering place
USAGE
$ chptr move [DESTINATIONID] [ORIGINID] [-c] [-s]
ARGUMENTS
DESTINATIONID Number it will become (write `end` or `@end`to put at the end of each stack).
ORIGINID Chapter number to move
FLAGS
-c, --compact Compact chapter numbers at the same time
-s, --save Commit to git at the same time.
DESCRIPTION
Takes a chapter and modifies its index number to fit another ordering place
ALIASES
$ chptr move
List installed plugins.
USAGE
$ chptr plugins [--json] [--core]
FLAGS
--core Show core plugins.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
List installed plugins.
EXAMPLES
$ chptr plugins
See code: @oclif/plugin-plugins
Installs a plugin into the CLI.
USAGE
$ chptr plugins:install PLUGIN...
ARGUMENTS
PLUGIN Plugin to install.
FLAGS
-f, --force Run yarn install with force flag.
-h, --help Show CLI help.
-s, --silent Silences yarn output.
-v, --verbose Show verbose yarn output.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Installs a plugin into the CLI.
Can be installed from npm or a git url.
Installation of a user-installed plugin will override a core plugin.
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
the CLI without the need to patch and update the whole CLI.
ALIASES
$ chptr plugins add
EXAMPLES
$ chptr plugins add myplugin
$ chptr plugins add https://github.com/someuser/someplugin
$ chptr plugins add someuser/someplugin
Displays installation properties of a plugin.
USAGE
$ chptr plugins:inspect PLUGIN...
ARGUMENTS
PLUGIN [default: .] Plugin to inspect.
FLAGS
-h, --help Show CLI help.
-v, --verbose
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Displays installation properties of a plugin.
EXAMPLES
$ chptr plugins inspect myplugin
See code: @oclif/plugin-plugins
Installs a plugin into the CLI.
USAGE
$ chptr plugins:install PLUGIN...
ARGUMENTS
PLUGIN Plugin to install.
FLAGS
-f, --force Run yarn install with force flag.
-h, --help Show CLI help.
-s, --silent Silences yarn output.
-v, --verbose Show verbose yarn output.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Installs a plugin into the CLI.
Can be installed from npm or a git url.
Installation of a user-installed plugin will override a core plugin.
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
the CLI without the need to patch and update the whole CLI.
ALIASES
$ chptr plugins add
EXAMPLES
$ chptr plugins install myplugin
$ chptr plugins install https://github.com/someuser/someplugin
$ chptr plugins install someuser/someplugin
See code: @oclif/plugin-plugins
Links a plugin into the CLI for development.
USAGE
$ chptr plugins:link PLUGIN
ARGUMENTS
PATH [default: .] path to plugin
FLAGS
-h, --help Show CLI help.
-v, --verbose
--[no-]install Install dependencies after linking the plugin.
DESCRIPTION
Links a plugin into the CLI for development.
Installation of a linked plugin will override a user-installed or core plugin.
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
command will override the user-installed or core plugin implementation. This is useful for development work.
EXAMPLES
$ chptr plugins link myplugin
See code: @oclif/plugin-plugins
Removes a plugin from the CLI.
USAGE
$ chptr plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ chptr plugins unlink
$ chptr plugins remove
EXAMPLES
$ chptr plugins remove myplugin
Remove all user-installed and linked plugins.
USAGE
$ chptr plugins reset
See code: @oclif/plugin-plugins
Removes a plugin from the CLI.
USAGE
$ chptr plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ chptr plugins unlink
$ chptr plugins remove
EXAMPLES
$ chptr plugins uninstall myplugin
See code: @oclif/plugin-plugins
Removes a plugin from the CLI.
USAGE
$ chptr plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ chptr plugins unlink
$ chptr plugins remove
EXAMPLES
$ chptr plugins unlink myplugin
Update installed plugins.
USAGE
$ chptr plugins update [-h] [-v]
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Update installed plugins.
See code: @oclif/plugin-plugins
Modify chapter title in text, metadata and filename or tracked filename
USAGE
$ chptr rename [CHAPTERIDORFILENAME] [NEWNAME] [-a -t] [-s]
ARGUMENTS
CHAPTERIDORFILENAME Chapter number or tracked filename to modify
NEWNAME New chapter name
FLAGS
-a, --all Will run on every chapter file. Will ignore a `chapterIdOrFilename argument.`
-s, --save Commit to git at the same time.
-t, --title Use chapter's title as new name. Will supercede a `newName` argument.
DESCRIPTION
Modify chapter title in text, metadata and filename or tracked filename
See code: src/commands/rename.ts
Takes a chapter and modifies its index number to fit another ordering place
USAGE
$ chptr reorder [DESTINATIONID] [ORIGINID] [-c] [-s]
ARGUMENTS
DESTINATIONID Number it will become (write `end` or `@end`to put at the end of each stack).
ORIGINID Chapter number to move
FLAGS
-c, --compact Compact chapter numbers at the same time
-s, --save Commit to git at the same time.
DESCRIPTION
Takes a chapter and modifies its index number to fit another ordering place
ALIASES
$ chptr move
See code: src/commands/reorder.ts
Parse modified text files, adjust sentence and paragraph endings, and commit files to repository.
USAGE
$ chptr save [NUMBERORFILENAME] [-c] [-e | -m <value>] [-n <value> | -f <value>] [-t ]
ARGUMENTS
NUMBERORFILENAME Chamber number to save, or tracked filename or filename pattern to save to repository
FLAGS
-c, --compact Compact chapter numbers at the same time
-e, --empty No manual message in commit
-f, --filename=<value> Tracked filename or filename pattern to filter which files to stage before saving to
repository
-m, --message=<value> Message to use in commit to repository
-n, --number=<value> Chapter number to filter which files to stage before saving to repository
-t, --track Force tracking of file if not already in repository
DESCRIPTION
Parse modified text files, adjust sentence and paragraph endings, and commit files to repository.
ALIASES
$ chptr commit
See code: src/commands/save.ts
Generates basic config files for a new novel project
USAGE
$ chptr setup [NAME] [-a <value>] [-d /|chapters/|chapters/number/|] [-e <value>] [-f <value>] [-r
<value>] [-l <value>] [-s <value>]
ARGUMENTS
NAME Name of project
FLAGS
-a, --author=<value> Name of author of project
-d, --directorystructure=<option> Directory structure initially written in config file
<options: /|chapters/|chapters/number/|>
-e, --email=<value> Email of author of project
-f, --force=<value> [default: false] Overwrite config files if they exist. Specify a filename to
overwrite only one; write `true` to overwrite all.
-l, --language=<value> Language of project
-r, --gitRemote=<value> Git address of remote repository.
-s, --style=<value> Config files in JSON5 or YAML?
DESCRIPTION
Generates basic config files for a new novel project
ALIASES
$ chptr setup
Add a file to be tracked in repository that is not a chapter, summary or metadata file.
USAGE
$ chptr track [FILENAME]
ARGUMENTS
FILENAME Filename to track
DESCRIPTION
Add a file to be tracked in repository that is not a chapter, summary or metadata file.
See code: src/commands/track.ts