
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@beuluis/hook-cli
Advanced tools
A small hook cli
·
Report Bug
·
Request Feature
·
A small hook cli that can be used with for example husky.
I know that most of this stuff is already solved by some awesome tools. So this is really just a CLI playground for me.
npm i -D @beuluis/hook-cli
Run commands. For example using the hooks in .husky
.
```bash
npx hook-cli [command] [...]
```
Check the pattern of a commit message
Option | Description | Type | default |
---|---|---|---|
-p , --prefix | Prefix of the issue key. | string | `` |
-m , --message | Get message from command line instead of file. | string | `` |
-w , --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |
npx hook-cli checkCommitMessageIssueKey "$1" -p "HelloWorld"
npx hook-cli checkCommitMessageIssueKey .git/COMMIT_EDITMSG -p "KEY"
npx hook-cli checkCommitMessageIssueKey -m "KEY-12 message" -p "KEY"
npx hook-cli checkCommitMessageIssueKey -m "KEY-12 message" -p "KEY" -w
Check the pattern of a commit message
Option | Description | Type | default |
---|---|---|---|
-p , --pattern | Regex pattern to check the message against. | string | `` |
-m , --message | Get message from command line instead of file. | string | `` |
-w , --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |
npx hook-cli checkCommitMessagePattern "$1" -p "HelloWorld"
npx hook-cli checkCommitMessagePattern .git/COMMIT_EDITMSG -p "HelloWorld"
npx hook-cli checkCommitMessagePattern -m "I say HelloWorld" -p "HelloWorld"
npx hook-cli checkCommitMessagePattern -m "I say HelloWorld" -p "HelloWorld" -w
Check if a staged file like a changelog was changed locale or remote compared to another branch
Option | Description | Type | default |
---|---|---|---|
-b , --branch | Branch to compare to. | string | main |
-w , --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |
npx hook-cli checkForFileChanged CHANGELOG.md
npx hook-cli checkForFileChanged CHANGELOG.md -b trunk
npx hook-cli checkForFileChanged CHANGELOG.md -w
npx hook-cli checkForFileChanged CHANGELOG.md -b trunk -w
Runs a package audit and collects the results.
Option | Description | Type | default |
---|---|---|---|
-m , --package-manager | The package manager you want to use. Keep in mind that both package managers report differently. | yarn , npm | npm |
-l , --audit-level | The severity of the vulnerabilities what the script will report. | info , low , moderate , high , critical | critical |
-p , --prod | If true only run audit for prod dependencies and skip dev ones. | boolean | false |
-w , --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |
npx hook-cli checkForVulnerabilities
npx hook-cli checkForVulnerabilities --package-manager yarn
npx hook-cli checkForVulnerabilities --audit-level low
npx hook-cli checkForVulnerabilities --warn-only
npx hook-cli checkForVulnerabilities --prod
npx hook-cli checkForVulnerabilities -l high -m yarn -w -p
Check if the version field is the same for package.json and package-lock.json
Option | Description | Type | default |
---|---|---|---|
-w , --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |
npx hook-cli checkPackageVersion
Check if the version field is the same for package.json and file
Option | Description | Type | default |
---|---|---|---|
-p , --json-path | Path in json file to check | string | `` |
-w , --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |
npx hook-cli checkPackageVersionInFile hello.json -p 'path.version'
npx hook-cli checkPackageVersionInFile hello.json -p 'path.version' -w
Prints a list of packages that have updates.
Option | Description | Type | default |
---|---|---|---|
-m , --package-manager | The package manager you want to use. Keep in mind that both package managers report differently. | yarn , npm | npm |
-w , --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |
npx hook-cli updateReminder
npx hook-cli updateReminder -m yarn
npx hook-cli updateReminder -w
npx hook-cli updateReminder -m yarn -w
npx hook-cli [command] --help
npm run hook-cli -- [command]
npx tsx src/index.ts [command]
FAQs
A small hook cli that can be used with for example husky
We found that @beuluis/hook-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.