Command Line Options



This page lists and delineates all the command line options that Bestatic can process. You can view a list by typing bestatic -h on terminal.


Positional arguments:


Add bestatic before each of these arguments.

Name of the Argument for bestatic Description of action
version Prints the currently installed version of bestatic and exits.
quickstart Creates a minimal config.yaml file by accepting user input, creates two pages and two posts, and finally build the website in _output directory.

Note: If a proper theme is not present in themes folder, then bestatic quickstart will not be able to generate a website.
newpage filepath This will create a new page file at filepath location. The ".md" extension will be added automatically.

For example, bestatic newpage testpage1 will create testpage1.md within ./pages folder. On the other hand, bestatic newpage sub/directory/testpage2 will create testpage2.md at the ./pages/sub/directory folder. All the subdirectories will be generated automatically.
newpost filepath This will create a new post file at filepath location. The ".md" extension will be added automatically.

For example, bestatic newpost testpost1 will create testpost1.md within ./posts folder. On the other hand, bestatic newpost sub/directory/testpost2 will create testpost2.md at the ./pages/sub/directory folder. All the subdirectories will be generated automatically.
generator (or no argument, i.e., just bestatic command) This is the default action. If everything is in order in current working directory, bestatic will build your website into _output directory (which can be changed; see below for details).

If config.yaml file or themes directory is not present (or does not have a proper theme) in current working directory, bestatic prints that message.

This command should be used to build the final version of the website (either locally or on cloud).



Flags or Options:


Add bestatic before each of these flags.

Shorter version Longer version Description of action
-h --help Prints the help message and exit. This should not be used with any positional arguments or flags.
-d DIRECTORY --directory DIRECTORY If DIRECTORY is specified, the final servable version of the website will be available in ./DIRECTORY folder, instead of ./_output folder.
-t THEME --theme THEME This can be used to specify the theme to be used to build the website. Make sure that the theme you are supplying here in the command line is actually present in the ./themes folder. If nothing is specified, bestatic will use the 'Amazing' theme, provided is there in the themes directory. Note that theme can also be specified in the config.yaml file.
-s --serve This can be used to start the bestatic server right after the build is complete. You can visit https://localhost:8080 to view the live version of your webpage locally.
-a --autoreload When '-a' or '--autoreload' is specified, bestatic will watch the current directory recursively for for any changes in files and if there are any changes, then will automatically rebuild the website. This flag used in conjunction with -s (--serve) flag. You can also include -d (--directory) flag or -t (--theme) flag with it as well.

For example, use bestatic -sa, make changes in files, save them, and reload https://localhost:8080 to see your changes in action live (no need to run bestatic again).