In the Git repository specified by the user, create a local version tag pointing to the current HEAD via the cyeam CLI.
Invoke
| User input | Execute command |
|---|---|
/git-tag or $git-tag |
cyeam tag minor |
/git-tag minor |
cyeam tag minor |
/git-tag major |
cyeam tag major |
/git-tag minor --dry-run |
cyeam tag minor --dry-run |
/git-tag major --dry-run |
cyeam tag major --dry-run |
$git-tag supports the same arguments. When only --dry-run is provided, the mode is still minor.
Minor version:v1.2.3 → v1.3.0; major version:v1.2.3 → v2.0.0。
Execution flow
- Use the repository specified by the user; if none is specified, use the repository that the current working directory belongs to.
- Parse the mode and
--dry-run. When no mode is specified, useminor; unsupported arguments should raise an error, and do not guess a mapping or concatenate them into shell execution. - An explicit invocation or an explicit request to tag has authorized creating a local tag; directly execute the corresponding
cyeam tagcommand, with no need to confirm again, and no need to do a preview first. - Read the CLI result and report the old version, the new tag, and the target commit; when previewing, clearly state that no tag has been created yet. In the default JSON envelope,
datacontainsprevious、tag、commit、dry_run。
Versioning and failure handling
- Version calculation is delegated to the CLI: based on the local maximum stable version
vMAJOR.MINOR.PATCH, ignoring other formats and pre-release tags; when there is no matching tag, start fromv0.0.0. - The CLI requires a clean working tree, including staged and untracked files. On failure, show the reason and stop; do not automatically commit, stash, delete files, or overwrite tags. When a commit is needed, use git-cmsg。
- according to the user's intent. Direct execution does not mean
git tag -for force push; this entry point does not accept--force。 - By default, only create a local tag. Pull or push only when the user explicitly requests it; push the exact tag successfully created this time, and do not push all tags or force-overwrite the remote.
- If the CLI is not installed or does not support
tag, explain that cyeam needs to be installed or updated; do not temporarily calculate the version by hand and fall back to nativegit tag. If the current task is to develop this CLI, you may build it from source into a temporary directory and run that binary in the target repository.