docmodel show menu hide menu

CLI Reference

The table below lists all of the option available when using the docmodel command line tool. Most actions can be initiated with a long (--) or a short (-) flag. It's worth noting that short flags can be combined. The following commands are all equivalent:

docmodel -bsw
docmodel -b -s -w
docmodel --bake --serve --watch

If you're working on a smaller project (several dozen files), the following command will add a watch to your project and automatically re-bake all files whenever you make a change:

docmodel -bsw

If you're working on a larger project, and full bakes are taking too long (it would have to be quite a sizable project for this to become an issue), then you can limit baking to a single file with the --only argument. The only argument should be a path to the source file you're working on, relative to your project's documents directory:

docmodel -bsw --only path/to/a/document.md

Or, for a shorter version:

docmodel -bswo path/to/a/document.md

Please note that the --only option can not be used to bake the site index page (if you're using one). Additionally, when using the --watch option, project configuration will not be reloaded / refreshed while the watch is maintained.

Long flag Short flag args Description
--init -i none Initialize a new project in the current directory
--local -l none Initialize a new local theme for the current project. This will copy the default theme to a theme directory in your project. To use this theme, you must set the configuration option theme.name to local.
--dir -d string Specify a project directory to run against (instead of using the current directory)
--force -f none Force an action that you have been warned may be unsafe
--help -h none Show the help file (essentially, a copy of this table in your terminal)
--bake -b none Bake a project in full.
--only -o string Use in combination with --bake to bake a single file only. Pass a path relative to your project's documents directory.
--lang string Use in combination with --only to bake a particular language variant (affects the theme).
--vers string Use in combination with --only to bake a particular version (affects the theme).
--serve -s none Start a server to display your project, and launch the project in your default browser. If used in combination with --only, your browser will open to the chosen document. Please note that a refresh signal is not sent to the browser when serving--you will likely have to manually refresh pages to see your latest changes.
--view -v string View your project's resolved configuration (i.e. the configuration file after all includes and extends have been resolved, and all other internal values to be used for baking have been calculated). Optionally, you can filer down to a specific configuration property: --view theme. For deeper filtering, traverse levels with spaces. E.g. to view the theme.name property: --view theme name. Although it's not a direct property, you can use --view bake_paths to print the linear list of documents docmodel uses to bake your project.
--watch -w none Use in combination with --bake and --serve to automatically re-bake the project when there is a file change. If used in combination with --only it will only re-bake the specified file. Project configuration is not reloaded / refreshed while a watch is maintained.
« PreviousNext »