CLI

The scaffdog command provides several subcommands.

Commands#

scaffdog init#

Prepare to use scaffdog. Create a .scaffdog directory by default, and create a first document file.

USAGE
scaffdog init
GLOBAL FLAGS
-p, --project Directory to load the scaffdog project.
-v, --verbose Enable logging.
--help Show help.
--version Output the version number.

scaffdog generate#

Build a scaffold using the specified template. If you do not specify the template name and execute it, interactively select the template.

USAGE
scaffdog generate <name> [flags]
COMMAND FLAGS
-o, --output Output destination directory. (Relative path from the `root` option)
-a, --answer Answer to question. The answer value is the key/value separated by ":" and can be specified multiple times.
-n, --dry-run Output the result to stdout.
-f, --force Attempt to write the files without prompting for confirmation.
GLOBAL FLAGS
-p, --project Directory to load the scaffdog project.
-v, --verbose Enable logging.
--help Show help.
--version Output the version number.

Skip all interactions#

Basically, scaffdog resolves the following items at the interactive prompt:

  • Document name
  • Output directory
  • Answers to Questions
  • Confirm file overwrite

If certain tasks need to be automated, you can flag them.

The following is an example of running the command to completely skip the interactive prompt for the following template document.

---
name: 'component'
root: 'src/components'
output: '**/*'
questions:
name: 'msg'
test:
confirm: 'msg'
type:
message: 'msg'
choices: ['A', 'B', 'C']
multiple: true
---
<!-- template definition -->
$ scaffdog generate component \
--force \
--output "buttons" \
--answer "name:OutlinedButton" \
--answer "test:true" \
--answer "type:A" \
--answer "type:C"
# output --> src/components/buttons/OutlinedButton

scaffdog create#

Create a document file with the specified name.

USAGE
scaffdog create <name> [flags]
COMMAND FLAGS
-y, --yes Use default options.
GLOBAL FLAGS
-p, --project Directory to load the scaffdog project.
-v, --verbose Enable logging.
--help Show help.
--version Output the version number.

scaffdog list#

Print a list of available documents.

USAGE
scaffdog list
GLOBAL FLAGS
-p, --project Directory to load the scaffdog project.
-v, --verbose Enable logging.
--help Show help.
--version Output the version number.
Edit this page on GitHub

Last edited on

Copyright © 2022 wadackel

Released under the MIT License

Built with Next.js

Source Code