Skip to content

Commit 4fe5b69

Browse files
docs(readme): add Codebuddy provider and console documentation
Update README with Codebuddy provider usage examples, console commands, execution options, and real CLI test instructions. Add Codebuddy.Console project to solution. Co-Authored-By: Hagicode <noreply@hagicode.com>
1 parent 97ce00b commit 4fe5b69

2 files changed

Lines changed: 58 additions & 3 deletions

File tree

HagiCode.Libs.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HagiCode.Libs.ConsoleTestin
2323
EndProject
2424
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HagiCode.Libs.Codex.Console", "src\HagiCode.Libs.Codex.Console\HagiCode.Libs.Codex.Console.csproj", "{A39579D0-AFF7-45EE-8373-E6E2166F5F6A}"
2525
EndProject
26+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HagiCode.Libs.Codebuddy.Console", "src\HagiCode.Libs.Codebuddy.Console\HagiCode.Libs.Codebuddy.Console.csproj", "{5E6B1445-BD66-4866-8862-824A3A392376}"
27+
EndProject
2628
Global
2729
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2830
Debug|Any CPU = Debug|Any CPU
@@ -129,6 +131,18 @@ Global
129131
{A39579D0-AFF7-45EE-8373-E6E2166F5F6A}.Release|x64.Build.0 = Release|Any CPU
130132
{A39579D0-AFF7-45EE-8373-E6E2166F5F6A}.Release|x86.ActiveCfg = Release|Any CPU
131133
{A39579D0-AFF7-45EE-8373-E6E2166F5F6A}.Release|x86.Build.0 = Release|Any CPU
134+
{5E6B1445-BD66-4866-8862-824A3A392376}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
135+
{5E6B1445-BD66-4866-8862-824A3A392376}.Debug|Any CPU.Build.0 = Debug|Any CPU
136+
{5E6B1445-BD66-4866-8862-824A3A392376}.Debug|x64.ActiveCfg = Debug|Any CPU
137+
{5E6B1445-BD66-4866-8862-824A3A392376}.Debug|x64.Build.0 = Debug|Any CPU
138+
{5E6B1445-BD66-4866-8862-824A3A392376}.Debug|x86.ActiveCfg = Debug|Any CPU
139+
{5E6B1445-BD66-4866-8862-824A3A392376}.Debug|x86.Build.0 = Debug|Any CPU
140+
{5E6B1445-BD66-4866-8862-824A3A392376}.Release|Any CPU.ActiveCfg = Release|Any CPU
141+
{5E6B1445-BD66-4866-8862-824A3A392376}.Release|Any CPU.Build.0 = Release|Any CPU
142+
{5E6B1445-BD66-4866-8862-824A3A392376}.Release|x64.ActiveCfg = Release|Any CPU
143+
{5E6B1445-BD66-4866-8862-824A3A392376}.Release|x64.Build.0 = Release|Any CPU
144+
{5E6B1445-BD66-4866-8862-824A3A392376}.Release|x86.ActiveCfg = Release|Any CPU
145+
{5E6B1445-BD66-4866-8862-824A3A392376}.Release|x86.Build.0 = Release|Any CPU
132146
EndGlobalSection
133147
GlobalSection(SolutionProperties) = preSolution
134148
HideSolutionNode = FALSE
@@ -142,5 +156,6 @@ Global
142156
{E43813C4-A5E0-42D4-A07D-14D88654F2FB} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
143157
{AB69C3FA-C7E9-4CBD-95D8-29B9DBAA00BA} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
144158
{A39579D0-AFF7-45EE-8373-E6E2166F5F6A} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
159+
{5E6B1445-BD66-4866-8862-824A3A392376} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
145160
EndGlobalSection
146161
EndGlobal

README.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## Projects
66

77
- `src/HagiCode.Libs.Core` - transport, process management, executable discovery, and runtime environment resolution.
8-
- `src/HagiCode.Libs.Providers` - provider abstractions, the Claude Code/Codex providers, and optional DI registration.
8+
- `src/HagiCode.Libs.Providers` - provider abstractions, the Claude Code/Codex/CodeBuddy providers, and optional DI registration.
99
- `src/HagiCode.Libs.Exploration` - Git repository discovery and state inspection.
1010
- `tests/*` - xUnit coverage for each project.
1111

@@ -19,7 +19,7 @@ dotnet test HagiCode.Libs.sln
1919

2020
## Dedicated provider console
2121

22-
`src/HagiCode.Libs.ClaudeCode.Console` and `src/HagiCode.Libs.Codex.Console` are dedicated provider consoles built on the shared `HagiCode.Libs.ConsoleTesting` harness.
22+
`src/HagiCode.Libs.ClaudeCode.Console`, `src/HagiCode.Libs.Codex.Console`, and `src/HagiCode.Libs.Codebuddy.Console` are dedicated provider consoles built on the shared `HagiCode.Libs.ConsoleTesting` harness.
2323

2424
From `repos/Hagicode.Libs`, you can use:
2525

@@ -35,6 +35,12 @@ dotnet run --project src/HagiCode.Libs.Codex.Console
3535
dotnet run --project src/HagiCode.Libs.Codex.Console -- --test-provider codex-cli
3636
dotnet run --project src/HagiCode.Libs.Codex.Console -- --test-provider-full --sandbox workspace-write --repo .
3737
dotnet run --project src/HagiCode.Libs.Codex.Console -- --test-all codex
38+
39+
dotnet run --project src/HagiCode.Libs.Codebuddy.Console -- --help
40+
dotnet run --project src/HagiCode.Libs.Codebuddy.Console
41+
dotnet run --project src/HagiCode.Libs.Codebuddy.Console -- --test-provider codebuddy-cli
42+
dotnet run --project src/HagiCode.Libs.Codebuddy.Console -- --test-provider-full --repo .
43+
dotnet run --project src/HagiCode.Libs.Codebuddy.Console -- --test-all codebuddy
3844
```
3945

4046
- No arguments run the default Claude suite.
@@ -47,14 +53,19 @@ dotnet run --project src/HagiCode.Libs.Codex.Console -- --test-all codex
4753
- Codex 默认套件当前包含 `Ping``Simple Prompt``Complex Prompt``Session Resume`
4854
- Codex accepts `--model <model>`, `--sandbox <mode>`, `--approval-policy <mode>`, `--api-key <key>`, and `--base-url <url>` overrides.
4955
- Codex repository analysis remains opt-in via `--repo <path>` and reuses the same shared report formatter.
56+
- No arguments also run the default CodeBuddy suite.
57+
- CodeBuddy 默认套件当前包含 `Ping``Simple Prompt``Complex Prompt``Session Resume`
58+
- CodeBuddy accepts `--model <model>` and defaults to `glm-4.7` when no explicit model override is supplied.
59+
- CodeBuddy repository summary remains opt-in via `--repo <path>`.
5060

5161
## Provider usage
5262

53-
The DI registration path now exposes both built-in providers:
63+
The DI registration path now exposes all built-in providers:
5464

5565
```csharp
5666
using HagiCode.Libs.Providers;
5767
using HagiCode.Libs.Providers.ClaudeCode;
68+
using HagiCode.Libs.Providers.Codebuddy;
5869
using HagiCode.Libs.Providers.Codex;
5970
using Microsoft.Extensions.DependencyInjection;
6071

@@ -63,9 +74,29 @@ services.AddHagiCodeLibs();
6374

6475
await using var provider = services.BuildServiceProvider();
6576
var claude = provider.GetRequiredService<ICliProvider<ClaudeCodeOptions>>();
77+
var codebuddy = provider.GetRequiredService<ICliProvider<CodebuddyOptions>>();
6678
var codex = provider.GetRequiredService<ICliProvider<CodexOptions>>();
6779
```
6880

81+
CodeBuddy execution options cover the ACP-specific runtime settings without forcing raw command lines:
82+
83+
```csharp
84+
var options = new CodebuddyOptions
85+
{
86+
Model = "glm-4.7",
87+
WorkingDirectory = "/path/to/repo",
88+
EnvironmentVariables = new Dictionary<string, string?>
89+
{
90+
["CODEBUDDY_TOKEN"] = "<token>"
91+
}
92+
};
93+
94+
await foreach (var message in codebuddy.ExecuteAsync(options, "Reply with exactly the word 'pong'"))
95+
{
96+
Console.WriteLine($"{message.Type}: {message.Content}");
97+
}
98+
```
99+
69100
Codex execution options cover the common CLI settings without forcing raw command lines:
70101

71102
```csharp
@@ -110,6 +141,15 @@ HAGICODE_REAL_CLI_TESTS=1 dotnet test tests/HagiCode.Libs.ConsoleTesting.Tests/H
110141

111142
These Codex checks intentionally stay at the auth-free `codex --version` / `--test-provider` layer. Prompt execution remains covered by fake-provider integration tests so the default CI path stays deterministic.
112143

144+
CodeBuddy follows the same opt-in pattern. If `codebuddy` is installed and available on `PATH`, you can run:
145+
146+
```bash
147+
HAGICODE_REAL_CLI_TESTS=1 dotnet test tests/HagiCode.Libs.Providers.Tests/HagiCode.Libs.Providers.Tests.csproj --filter "FullyQualifiedName~Codebuddy"
148+
HAGICODE_REAL_CLI_TESTS=1 dotnet test tests/HagiCode.Libs.ConsoleTesting.Tests/HagiCode.Libs.ConsoleTesting.Tests.csproj --filter "FullyQualifiedName~Codebuddy"
149+
```
150+
151+
These CodeBuddy checks validate the ACP bootstrap ping path (`codebuddy --acp` initialize) and the dedicated `--test-provider` console flow without requiring the default deterministic suite to talk to a real external CLI.
152+
113153
## Design goals
114154

115155
- Zero heavy framework dependencies in the reusable libraries.

0 commit comments

Comments
 (0)