CLI References for Hawk JS
The Hawk JS CLI tool empowers you to manage and optimize sitemaps for enhanced SEO performance. It supports multiple strategies (GIndex
, IndexNow
, GWebmaster
, GWebmaster2
) not only for generating and submitting sitemaps but also for updating and ensuring the inclusion of recently updated content. Use options to define inclusion and exclusion patterns for files, ensuring precise control over which content is indexed.
Notes
- Ensure your
hawk.config.json
is configured properly for advanced settings. - Use
-h
or--help
with any command to get detailed usage information.
This structured reference guide provides users with clear instructions on how to use Hawk JS from the command line, covering various commands, options, and examples for effective sitemap management and submission.
Usage
hawk [options] [command]
Options
-s, --strategy <strategy>
: Strategy to use (GIndex
,IndexNow
,GWebmaster
,GWebmaster2
).
Default is IndexNow
.
Optional:
-
-i, --include <pattern>
: Include pattern for file selection. -
-e, --exclude <pattern>
: Exclude pattern for file selection. -
-p, --prettify
: Prettify sitemap.xml output. Default isfalse
.
Commands
genmap [options]
Generate sitemap.xml and optionally upload to Google Search Console.
Options:
All are optional nothing mandatory.
-c, --commit
: Upload generated sitemap to Google Search Console and FTP server.-i, --include <pattern>
: Include pattern for file selection.-e, --exclude <pattern>
: Exclude pattern for file selection.-p, --prettify
: Prettify sitemap.xml output. Default isfalse
.
secret
Set FTP credentials from secrets.json
to the system environment.
Examples
Set Secret Credentials:
yarn hawk secret
Generate Sitemap Only:
yarn hawk genmap
Generate and Upload Sitemap to Google Search Console and FTP:
yarn hawk genmap -c
Submit Updated Link to Search Engines Using IndexNow
Strategy:
yarn hawk -s IndexNow
Submit Updated Link to Google Using GIndex
Strategy:
yarn hawk -s GIndex
Generate and Upload Sitemap Using GWebmaster
Strategy:
yarn hawk -s GWebmaster
Generate and Upload Sitemap Using GWebmaster2
Strategy:
GWebmaster
strategyyarn hawk -s GWebmaster2
Let's get into API!
Keywords:
- CLI reference guide
- command line interface
- sitemap management