Getting Started
「czg」 requires Node >=v12.20
As global use
Recommend: Compared with the npm or npx startup method, Node.js can be started more directly once, that you to use the
czgCLI in any project at a faster speed
sh
npm install -g czgnpm install -g czgsh
brew install czgbrew install czgsh
# https://x-cmd.com/pkg/czg
# Adapt `x-cmd theme` colorizen & command native completion
x env use czg# https://x-cmd.com/pkg/czg
# Adapt `x-cmd theme` colorizen & command native completion
x env use czgsh
# check the installation is successful
czg --help
git czg -h# check the installation is successful
czg --help
git czg -hAs a dev dependency use
sh
npm install -D czgnpm install -D czgsh
yarn add -D czgyarn add -D czgsh
pnpm install -D czgpnpm install -D czgsh
bun add -d czgbun add -d czgAdd script in package.json try it npm cz
json
{
"scripts": {
"cz": "czg"
}
}{
"scripts": {
"cz": "czg"
}
}As npx use
You can start the CLI in different project, but the
npxstartup speed will be slower than global install
sh
npx czgnpx czgsh
bunx czgbunx czgAs git hooks use
WARNING
Not recommended usage
This will alter the original behavior of the git commit command, losing the ability for quick commits
like git commit -m "chore: ..."
However, czg still supports it because it can enforce and restrict your team's commit behavior
e.g: husky(.husky/prepare-commit-msg)
sh
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
exec < /dev/tty && npx czg --hook || true#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
exec < /dev/tty && npx czg --hook || trueOpening a like vim editor after submitting the message ? ==> See FAQ for solution
cz-git