Skip to content

Commit 65ce470

Browse files
refactor(src): rename all git-agent references to ai-commit
- Rename CLI from git-agent to ai-commit across docs and code. - Update config paths and keys from git_agent to ai_commit. - Change internal service identifiers and package names to ai-commit. this refactor updates references throughout the codebase to ai-commit, including identifiers, paths, keys, and documentation, aligning the project naming with the new ai-commit branding. Co-Authored-By: Ai Commit <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 43a2bd1 commit 65ce470

18 files changed

Lines changed: 64 additions & 59 deletions

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ DESCRIPTION
2626
AI-first Git/JJ CLI for atomic commits and generated messages.
2727

2828
USAGE
29-
git-agent <subcommand> [flags]
29+
ai-commit <subcommand> [flags]
3030

3131
GLOBAL FLAGS
3232
--help, -h Show help information
@@ -36,9 +36,9 @@ GLOBAL FLAGS
3636

3737
SUBCOMMANDS
3838
commit Generate and create commit(s) with AI-generated messages.
39-
config Manage git-agent configuration.
40-
init Initialize git-agent in the current repository.
41-
version Print the git-agent version.
39+
config Manage ai-commit configuration.
40+
init Initialize ai-commit in the current repository.
41+
version Print the ai-commit version.
4242
```
4343

4444
## Goals

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@effect-x/ai-commit",
33
"version": "0.0.1",
4-
"description": "Effect rewrite of git-agent with git and jj support.",
4+
"description": "AI commit cli with git and jj support.",
55
"keywords": [
66
"cli",
77
"commit",
@@ -11,17 +11,17 @@
1111
"jujutsu",
1212
"llm"
1313
],
14-
"homepage": "https://github.com/effect-anything/git-agent-cli#readme",
14+
"homepage": "https://github.com/effect-anything/ai-commit",
1515
"bugs": {
16-
"url": "https://github.com/effect-anything/git-agent-cli/issues"
16+
"url": "https://github.com/effect-anything/ai-commit/issues"
1717
},
1818
"license": "MIT",
1919
"contributors": [
2020
"xesrevinu"
2121
],
2222
"repository": {
2323
"type": "git",
24-
"url": "git+https://github.com/effect-anything/git-agent-cli.git"
24+
"url": "git+https://github.com/effect-anything/ai-commit.git"
2525
},
2626
"bin": {
2727
"ai-commit": "dist/cli.js"

src/commands/commit.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const parseTrailers = Effect.fn("Commit.ParseTrailers")(function* (
5252
if (includeAttribution) {
5353
trailers.push({
5454
key: "Co-Authored-By",
55-
value: "Git Agent <noreply@git-agent.dev>",
55+
value: "Ai Commit <41898282+github-actions[bot]@users.noreply.github.com>",
5656
});
5757
}
5858

@@ -83,8 +83,8 @@ export const commandCommit = Command.make(
8383
Flag.withDescription("Maximum diff lines to send to the model. 0 means unlimited."),
8484
),
8585
noAttribution: Flag.boolean("no-attribution").pipe(
86-
Flag.withAlias("--no-git-agent"),
87-
Flag.withDescription("Omit the default Git Agent trailer."),
86+
Flag.withAlias("--no-ai-commit"),
87+
Flag.withDescription("Omit the default AI Commit trailer."),
8888
),
8989
coAuthor: Flag.string("co-author").pipe(
9090
Flag.withDescription("Co-author trailer. Repeat the flag or use comma-separated values."),
@@ -130,7 +130,7 @@ export const commandCommit = Command.make(
130130
if (provider.apiKey.length === 0) {
131131
return yield* new ConfigError({
132132
message:
133-
"no API key configured (hint: set --api-key, add api_key to ~/.config/git-agent/config.yml, or use build-time embedded credentials)",
133+
"no API key configured (hint: set --api-key, add api_key to ~/.config/ai-commit/config.yml, or use build-time embedded credentials)",
134134
});
135135
}
136136

@@ -140,7 +140,7 @@ export const commandCommit = Command.make(
140140
const trailers = yield* parseTrailers(
141141
input.coAuthor,
142142
input.trailer,
143-
!(provider.noGitAgentCoAuthor || projectConfig.noGitAgentCoAuthor || input.noAttribution),
143+
!(provider.noCommitCoAuthor || projectConfig.noCommitCoAuthor || input.noAttribution),
144144
provider.noModelCoAuthor || projectConfig.noModelCoAuthor,
145145
);
146146

src/commands/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,6 @@ const configSet = Command.make(
138138
).pipe(Command.withDescription("Write a configuration value."));
139139

140140
export const commandConfig = Command.make("config").pipe(
141-
Command.withDescription("Manage git-agent configuration."),
141+
Command.withDescription("Manage ai-commit configuration."),
142142
Command.withSubcommands([configShow, configGet, configSet]),
143143
);

src/commands/init.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const commandInit = Command.make(
4242
Flag.withDescription("Maximum commit count to analyze for scopes."),
4343
),
4444
local: Flag.boolean("local").pipe(
45-
Flag.withDescription("Write config to .git-agent/config.local.yml."),
45+
Flag.withDescription("Write config to .ai-commit/config.local.yml."),
4646
),
4747
hook: Flag.string("hook").pipe(
4848
Flag.withDescription("Hook to configure. Repeat the flag or use comma-separated values."),
@@ -111,7 +111,7 @@ export const commandInit = Command.make(
111111
if ((doGitignore || doScope || fullWizard) && provider.apiKey.length === 0) {
112112
return yield* new ConfigError({
113113
message:
114-
"no API key configured (hint: set --api-key or add api_key to ~/.config/git-agent/config.yml)",
114+
"no API key configured (hint: set --api-key or add api_key to ~/.config/ai-commit/config.yml)",
115115
});
116116
}
117117

@@ -154,4 +154,4 @@ export const commandInit = Command.make(
154154
yield* mergeScopes(configPath, emptyProjectConfig().scopes);
155155
}
156156
}),
157-
).pipe(Command.withDescription("Initialize git-agent in the current repository."));
157+
).pipe(Command.withDescription("Initialize ai-commit in the current repository."));

src/commands/root.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { commandConfig } from "./config.ts";
44
import { commandInit } from "./init.ts";
55
import { commandVersion } from "./version.ts";
66

7-
export const commandRoot = Command.make("git-agent").pipe(
7+
export const commandRoot = Command.make("ai-commit").pipe(
88
Command.withDescription("AI-first Git/JJ CLI for atomic commits and generated messages."),
99
Command.withSubcommands([commandCommit, commandConfig, commandInit, commandVersion]),
1010
Command.withExamples([

src/commands/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export const commandVersion = Command.make(
88
Effect.fn(function* () {
99
yield* Console.log(PackageJson.version);
1010
}),
11-
).pipe(Command.withDescription("Print the git-agent version."));
11+
).pipe(Command.withDescription("Print the ai-commit version."));

src/config/keys.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ const keyRegistry: Record<string, KeyDef> = {
2020
scopes: { type: "stringslice", allowProject: true, allowLocal: true },
2121
hook: { type: "stringslice", allowProject: true, allowLocal: true },
2222
max_diff_lines: { type: "int", allowProject: true, allowLocal: true },
23-
no_git_agent_co_author: { type: "bool", allowUser: true, allowProject: true, allowLocal: true },
23+
no_commit_co_author: { type: "bool", allowUser: true, allowProject: true, allowLocal: true },
2424
no_model_co_author: { type: "bool", allowUser: true, allowProject: true, allowLocal: true },
2525
};
2626

2727
const keyAliases: Record<string, string> = {
2828
"api-key": "api_key",
2929
"base-url": "base_url",
3030
"max-diff-lines": "max_diff_lines",
31-
"no-git-agent-co-author": "no_git_agent_co_author",
31+
"no-commit-co-author": "no_commit_co_author",
3232
"no-model-co-author": "no_model_co_author",
3333
};
3434

src/config/project.ts

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -144,27 +144,32 @@ const decodeHooks = Effect.fn(function* (pathValue: string, rawMap: RawYamlMap)
144144
return [] as Array<string>;
145145
});
146146

147-
const gitAgentPath = Effect.fn(function* (repoRoot: string, ...segments: ReadonlyArray<string>) {
147+
const gitConfigPathPath = Effect.fn(function* (
148+
repoRoot: string,
149+
...segments: ReadonlyArray<string>
150+
) {
148151
const path = yield* Path.Path;
149-
return path.join(repoRoot, ".git-agent", ...segments);
152+
return path.join(repoRoot, ".ai-commit", ...segments);
150153
});
151154

152155
export const projectConfigPath = Effect.fn(function* (repoRoot: string) {
153156
const fs = yield* FileSystem.FileSystem;
154-
const currentPath = yield* gitAgentPath(repoRoot, "config.yml");
157+
const currentPath = yield* gitConfigPathPath(repoRoot, "config.yml");
155158
if (yield* fs.exists(currentPath)) {
156159
return currentPath;
157160
}
158-
const legacyPath = yield* gitAgentPath(repoRoot, "project.yml");
161+
const legacyPath = yield* gitConfigPathPath(repoRoot, "project.yml");
159162
if (yield* fs.exists(legacyPath)) {
160163
return legacyPath;
161164
}
162165
return currentPath;
163166
});
164167

165-
export const projectConfigWritePath = (repoRoot: string) => gitAgentPath(repoRoot, "config.yml");
168+
export const projectConfigWritePath = (repoRoot: string) =>
169+
gitConfigPathPath(repoRoot, "config.yml");
166170

167-
export const localConfigPath = (repoRoot: string) => gitAgentPath(repoRoot, "config.local.yml");
171+
export const localConfigPath = (repoRoot: string) =>
172+
gitConfigPathPath(repoRoot, "config.local.yml");
168173

169174
export const loadProjectConfig = Effect.fn("Config.LoadProjectConfig")(function* (
170175
repoRoot: string,
@@ -193,21 +198,21 @@ export const loadProjectConfig = Effect.fn("Config.LoadProjectConfig")(function*
193198
const mergedHooks = localHooks.length > 0 ? localHooks : projectHooks;
194199
const maxDiffLines = localMaxDiffLines ?? projectMaxDiffLines ?? 0;
195200
const [
196-
localNoGitAgentCoAuthor,
197-
projectNoGitAgentCoAuthor,
201+
localNoCommitCoAuthor,
202+
projectNoCommitCoAuthor,
198203
localNoModelCoAuthor,
199204
projectNoModelCoAuthor,
200205
] = yield* Effect.all([
201206
decodeConfigField(
202207
localPath,
203-
"no_git_agent_co_author",
204-
localRaw["no_git_agent_co_author"],
208+
"no-commit-co-author",
209+
localRaw["no-commit-co-author"],
205210
Schema.Boolean,
206211
),
207212
decodeConfigField(
208213
projectPath,
209-
"no_git_agent_co_author",
210-
projectRaw["no_git_agent_co_author"],
214+
"no-commit-co-author",
215+
projectRaw["no-commit-co-author"],
211216
Schema.Boolean,
212217
),
213218
decodeConfigField(
@@ -223,14 +228,14 @@ export const loadProjectConfig = Effect.fn("Config.LoadProjectConfig")(function*
223228
Schema.Boolean,
224229
),
225230
]);
226-
const noGitAgentCoAuthor = localNoGitAgentCoAuthor ?? projectNoGitAgentCoAuthor ?? false;
231+
const noCommitCoAuthor = localNoCommitCoAuthor ?? projectNoCommitCoAuthor ?? false;
227232
const noModelCoAuthor = localNoModelCoAuthor ?? projectNoModelCoAuthor ?? false;
228233

229234
if (
230235
mergedScopes.length === 0 &&
231236
mergedHooks.length === 0 &&
232237
maxDiffLines === 0 &&
233-
noGitAgentCoAuthor === false &&
238+
noCommitCoAuthor === false &&
234239
noModelCoAuthor === false
235240
) {
236241
return undefined as ProjectConfig | undefined;
@@ -240,7 +245,7 @@ export const loadProjectConfig = Effect.fn("Config.LoadProjectConfig")(function*
240245
scopes: mergedScopes,
241246
hooks: mergedHooks,
242247
maxDiffLines,
243-
noGitAgentCoAuthor,
248+
noCommitCoAuthor,
244249
noModelCoAuthor,
245250
} satisfies ProjectConfig;
246251
});

src/config/provider.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const ProviderConfig = Schema.Struct({
1818
apiKey: Schema.String,
1919
baseUrl: Schema.String,
2020
model: Schema.String,
21-
noGitAgentCoAuthor: Schema.Boolean,
21+
noCommitCoAuthor: Schema.Boolean,
2222
noModelCoAuthor: Schema.Boolean,
2323
});
2424

@@ -54,7 +54,7 @@ const FileConfig = Schema.Struct({
5454
api_key: Schema.optionalKey(ExpandEnvString.pipe(Schema.UndefinedOr)),
5555
base_url: Schema.optionalKey(ExpandEnvString.pipe(Schema.UndefinedOr)),
5656
model: Schema.optionalKey(ExpandEnvString.pipe(Schema.UndefinedOr)),
57-
no_git_agent_co_author: Schema.optionalKey(Schema.Boolean.pipe(Schema.UndefinedOr)),
57+
no_commit_co_author: Schema.optionalKey(Schema.Boolean.pipe(Schema.UndefinedOr)),
5858
no_model_co_author: Schema.optionalKey(Schema.Boolean.pipe(Schema.UndefinedOr)),
5959
});
6060

@@ -86,9 +86,9 @@ export const userConfigPath = Effect.gen(function* () {
8686
});
8787

8888
if (xdgConfigHome != null) {
89-
return path.join(xdgConfigHome, "git-agent", "config.yml");
89+
return path.join(xdgConfigHome, "ai-commit", "config.yml");
9090
}
91-
return path.join(homedir(), ".config", "git-agent", "config.yml");
91+
return path.join(homedir(), ".config", "ai-commit", "config.yml");
9292
});
9393

9494
const expandEnv = Effect.fn(function* (value: string) {
@@ -149,7 +149,7 @@ const readGitConfig = (cwd: string, key: string) =>
149149
Effect.map(
150150
runProcess({
151151
command: "git",
152-
args: ["config", "--local", "--get", `git-agent.${key}`],
152+
args: ["config", "--local", "--get", `ai-commit.${key}`],
153153
cwd,
154154
allowFailure: true,
155155
}),
@@ -173,7 +173,7 @@ export const resolveProviderConfig = Effect.fn("Config.ResolveProvider")(functio
173173
apiKey: firstNonEmpty(apiKey, file.api_key, build.apiKey) ?? "",
174174
baseUrl: firstNonEmpty(baseUrl, gitBaseUrl, file.base_url, build.baseUrl) ?? DefaultBaseUrl,
175175
model: firstNonEmpty(model, gitModel, file.model, build.model) ?? DefaultModel,
176-
noGitAgentCoAuthor: file.no_git_agent_co_author ?? false,
176+
noCommitCoAuthor: file.no_commit_co_author ?? false,
177177
noModelCoAuthor: file.no_model_co_author ?? false,
178178
} satisfies ProviderConfig;
179179
});

0 commit comments

Comments
 (0)