Richie.js CLI
Richie.js offers a Command Line Interface (CLI) for easy integration and management of rich result generation and configuration. This CLI allows you to generate SEO-rich snippets for your HTML files and initialize the tool’s configuration automatically.
Available Commands
The Richie.js CLI provides two core commands: make
and init
.
make
Command
The make
command generates rich result snippets for all HTML files and injects them automatically. This command also allows you to control the output directory and exclude specific patterns.
Usage
richie make [options]
Options
-
-d, --destDir <string>
Specifies the destination directory for the generated rich snippets (default:dist
). -
-o, --omitPatterns <patterns...>
Exclude specific directories or glob patterns from the rich result generation. -
-p, --norm
Preserve the current state of the destination directory.
Example
richie make --destDir public --omitPatterns "test/*" --norm
This command will generate rich result snippets for all HTML files, save them in the public
directory, omit files matching the test/*
pattern, and preserve the existing files in the destination directory.
Output
Once the command completes, you’ll see a success message:
✅ Rich result snippets are generated for all HTML & saved.
If there is an error during the generation, it will display:
⚠️ Error generating rich result snippets: <error details>
init
Command
The init
command initializes the Richie.js configuration required for rich result generation.
Usage
richie init
This will automatically create and set up the richiejs.config.js
file in your project directory.
Example
richie init
After running this command, you will see the following message:
🚀 Richie.js configuration initialised.
If there is an error initializing the configuration, it will display:
⚠️ Error initializing icon associations: <error details>
Conclusion
Richie.js CLI simplifies the process of generating rich SEO snippets and initializing configurations in your project. By using the make
and init
commands, you can easily enhance your site’s SEO performance and ensure all configurations are properly set up.
Keywords
- Richie.js
- API
- CLI (Command Line Interface)
- Application Programming Interface
- SEO Tool
- Search Engine Visibility
- User Experience