
Security News
pnpm 10.16 Adds New Setting for Delayed Dependency Updates
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
@cmsgov/hpt-validator-cli
Advanced tools
CLI for validating CMS Hospital Price Transparency machine-readable files
CLI for validating CMS Hospital Price Transparency machine-readable files
These were the minimum versions used to develop the CLI tool. It is recommended to keep both Node and NPM up-to-date with the latest releases.
Install the CLI globally with
npm install -g @cmsgov/hpt-validator-cli
cms-hpt-validator --help
Usage: cms-hpt-validator [options] <filepath> <version>
Arguments:
filepath filepath to validate
version (choices: "v2.0", "v2.0.0")
Options:
-V, --version output the CLI version number
-f, --format <string> file format of file (choices: "csv", "json")
-o, --output <string> output format (choices: "table", "json", default: "table")
-e, --error-limit <value> maximum number for errors (default: 1000)
-h, --help display help for command
Basic usage:
cms-hpt-validator ./sample.csv v2.0.0
Overriding the default error limit to show 50 errors:
cms-hpt-validator ./sample.csv v2.0.0 -e 50
Overriding the default error limit to show all errors:
cms-hpt-validator ./sample.csv v2.0.0 -e 0
Using JSON output format:
cms-hpt-validator ./sample.csv v2.0.0 -o json
Using JSON output format with limited errors:
cms-hpt-validator ./sample.csv v2.0.0 -o json -e 10
The CLI supports two output formats:
The default table format provides a human-readable output with colored text, showing validation results in a structured table format.
The JSON format provides machine-readable output that includes:
Example JSON output:
{
"file": "/path/to/sample.csv",
"version": "1.10.0",
"timestamp": "2025-01-11T17:00:00.000Z",
"valid": false,
"errorCount": 2,
"alertCount": 1,
"errors": [
{
"path": "C4",
"field": "code | 1 | type",
"message": "Invalid code type"
}
],
"alerts": [
{
"path": "D5",
"field": "estimated_amount",
"message": "Nine 9s used for estimated amount"
}
]
}
The two current allowable file formats for the HPT MRFs are CSV and JSON. The CLI will auto detect the file format passed into the tool for files that end with .csv
or .json
and will run the appropriate validator for that file. The CLI can also detect files compressed by gzip. Files ending with the .gz
extension will be decompressed before validation. These file format detections can be combined, so files ending with .csv.gz
or .json.gz
will be decompressed and validated as CSV or JSON, respectively. For other files ending with .gz
, use the -f
option described above.
There may be a situation in which the CLI tool will run out of memory due to the amount of errors that are found in the file being validated. If you run into this NODE error, update the amount of errors to a smaller value that will be allowed to be collected with the -e, --error-limit
flag.
Thank you for considering contributing to an Open Source project of the US Government! For more information about our contribution guidelines, see CONTRIBUTING.md
For more information about our Security, Vulnerability, and Responsible Disclosure Policies, see SECURITY.md.
A full list of contributors can be found on https://github.cms.gov/CMSGov/hpt-validator-cli/graphs/contributors.
This project is licensed within in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.
All contributions to this project will be released under the CC0 dedication. By submitting a pull request or issue, you are agreeing to comply with this waiver of copyright interest.
FAQs
CLI for validating CMS Hospital Price Transparency machine-readable files
The npm package @cmsgov/hpt-validator-cli receives a total of 1 weekly downloads. As such, @cmsgov/hpt-validator-cli popularity was classified as not popular.
We found that @cmsgov/hpt-validator-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 53 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.