Zhengqbbb / cz-git

cz-git | czg 🛠️ DX first and more engineered, lightweight, customizable, standard output format Commitizen adapter and CLI
https://cz-git.qbb.sh
MIT License
1.05k stars 39 forks source link

[Deprecated] (czg !) - using switch flag to replace sub commands #147

Closed Zhengqbbb closed 9 months ago

Zhengqbbb commented 9 months ago

Deprecated The ISSUE

During testing in v1.8.1-beta.2, I found that using switch flags when initiating the input command causes hesitation and delays, mainly due to casing issues. Andgit commit already occupies many options and option aliases.

It's possible my reasoning is flawed, so I'll refrain from updating to a breaking change version for now.


Using switch flag

Actually, subcmd is intended for functional categorization within commands. e.g git branch and git config. Or is action of command like add rm. e.g bun add npm uninstall

Initially designed as czg ai or czg emoji were aimed at highlighting configure activation. However, it might be better for both to be switch flags (like czg --retry|-r). For example, when we need to activate more than two switches, the input becomes quite redundant, which hampers the quick use of the command.

- czg emoji gpg
+ czg -E -S
- git czg emoji checkbox
+ git czg -cb -E

Args => using search keywords for types items

czg ix ==> will pin the fix item to the top of choose list ==> Enter

This design helps individuals whose subconscious is already familiar with the types, enabling a swift transition to inputting the subject (short description)


💡 Proposed Solution

- SUBCOMMAND:
-    ai               Turn on OpenAI generate subject mode
-    break            Turn on appends a ! after the type/scope
-    emoji            Turn on output message with emoji mode
-    checkbox         Turn on scope checkbox mode
-    gpg              Turn on use GPG sign commit message
  1. remove gpg. czg extends 'git commit' options that can directly use czg -S | czg --gpg-sign
  2. Actually, I really want to use -C, --checkbox. But -C and -c already exists 'git commit' options
+ FLAG:
+    -ai, --ai         Turn on OpenAI generate subject mode
+    -b, --break       Turn on appends a ! after the type/scope
+    -E, --emoji       Turn on output message with emoji mode
+    -cb, --checkbox   Turn on scope checkbox mode


NAME:
    czg - Interactive Commitizen CLI that generate standardized git commit message

WEBSITE:
    https://cz-git.qbb.sh/cli/
    https://github.com/Zhengqbbb/cz-git

SYNOPSIS:
    czg [flag|options...] [git-commit-options...] [type list item search keywords]

FLAG:
    -r, --retry      Directly retry submit by the last message
    -a, --all        Automatically stage files that have been modified and deleted (Not new files)
    -b, --break      Turn on appends a ! after the type/scope
    -E, --emoji      Turn on output message with emoji mode
    -S, --gpg-sign   Turn on use GPG sign commit message
    -cb, --checkbox  Turn on scope checkbox mode
    -ai, --ai        Turn on OpenAI generate subject mode
    --no-ai          Turn off OpenAI prompt mode in this session
    --unset-proxy    Unset request API proxy on local configure
    -h, --help       Show help
    -v, --version    Show version

OPTIONS:
    :, --alias=      Directly submit the defined commit message
    --config=        Specify the configuration file to use

  OpenAI:
    -N=,--ai-num=    Setting AI return number subjects and Turn on choose mode
    --api-key=       Setup request OpenAI API secret key to local (.config/.czrc)
    --api-proxy=     Setup request OpenAI API proxy      to local (.config/.czrc)
    --api-endpoint=  Setup request OpenAI API endpoint   to local (.config/.czrc)
                     [default: "https://api.openai.com/v1"]

EXAMPLES:
    czg
    czg ch | czg ix
    czg -a -E
    czg :fd
    czg --config="./config/cz.json"
    czg --api-key="sk-XXXXX"
    czg -ai -N=3

Extends 'git commit' options.
See 'git commit --help' for more information.