Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,13 @@ export GROQ_API_KEY="your-api-key"
## Usage

```bash
# Basic: stage + generate + confirm + commit
git add .
# Basic: stage files + generate + confirm + commit
git add file1.ts file2.ts
git-commit-ai

# Stage all changes and commit
git-commit-ai --all

# Auto-commit without confirmation
git add .
git-commit-ai -y
Expand All @@ -300,6 +303,9 @@ git-commit-ai -y
git add .
git-commit-ai --push

# Stage all changes and commit (equivalent to git add . && git-commit-ai)
git-commit-ai --all

# Commit each modified file separately
git-commit-ai --individual

Expand Down Expand Up @@ -454,6 +460,7 @@ ignore_patterns = ["dist/*", "*.generated.ts"]

| Option | Description |
|--------|-------------|
| `-a, --all` | Stage all changes before committing |
| `-p, --push` | Push after commit |
| `-y, --yes` | Skip confirmation |
| `-i, --individual` | Commit files individually |
Expand Down
5 changes: 3 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ export function createProgram(): Command {
.option("--issue <ref>", "Reference an issue (e.g., 123 or #123)")
.option("--breaking", "Mark as breaking change (adds ! to type)")
.option("--co-author <author>", "Add co-author (can be used multiple times)", (val: string, prev: string[]) => prev.concat([val]), [] as string[])
.option("-a, --all", "Stage all changes before committing")
.action(async (options) => {
if (options.debug) {
enableDebug();
Expand Down Expand Up @@ -537,8 +538,8 @@ export function createProgram(): Command {
coAuthors: options.coAuthor,
};

// Don't stage files if amending
if (!options.amend) {
// Stage all files only if --all flag is used
if (options.all && !options.amend) {
addFiles(".");
}

Expand Down