Workflows & Internals
How it works
- Parse command arguments.
- Check whether the current folder is a Git repository.
- Add a remote when
--remoteis provided. - Detect first commit state.
- Handle branch selection, creation, or open source mode.
- Stage files when no staged diff exists.
- Generate an AI commit message when
--genieand a key are available. - Commit the final message.
- Push, merge, or clean up branches depending on flags.
Common workflows
Feature with AI and push:
gg "add oauth flow" --type feat --scope auth --genie
Direct quick fix on main:
gg "fix typo in README" --no-branch --genie
Initialize a new repo with remote:
gg "initial commit" --no-branch --remote https://github.com/you/repo.git --genie