SharpCoder 0.3.0-alpha.3
See the version list below for details.
dotnet add package SharpCoder --version 0.3.0-alpha.3
NuGet\Install-Package SharpCoder -Version 0.3.0-alpha.3
<PackageReference Include="SharpCoder" Version="0.3.0-alpha.3" />
<PackageVersion Include="SharpCoder" Version="0.3.0-alpha.3" />
<PackageReference Include="SharpCoder" />
paket add SharpCoder --version 0.3.0-alpha.3
#r "nuget: SharpCoder, 0.3.0-alpha.3"
#:package SharpCoder@0.3.0-alpha.3
#addin nuget:?package=SharpCoder&version=0.3.0-alpha.3&prerelease
#tool nuget:?package=SharpCoder&version=0.3.0-alpha.3&prerelease
SharpCoder
A standalone, embeddable autonomous coding agent for .NET — built on Microsoft.Extensions.AI.
SharpCoder gives any IChatClient (OpenAI, Ollama, Azure, Anthropic, etc.) the ability to read files, write code, search codebases, and execute shell commands autonomously. Plug it into your app with a few lines of code.
Features
- Provider-agnostic — works with any
IChatClientimplementation - Built-in tools — file read/write/edit, glob, grep, bash, and skills
- Security by default — path traversal protection, bash disabled by default
- Workspace-aware — auto-loads
AGENTS.mdand.github/copilot-instructions.md - Rich results — token usage, tool call count, full message history
- Targets
netstandard2.1— runs on .NET Core 3+, .NET 5–10, and beyond
Quick Start
dotnet add package SharpCoder
using Microsoft.Extensions.AI;
using SharpCoder;
// Use any IChatClient — OpenAI, Ollama, Azure, etc.
IChatClient chatClient = new OllamaChatClient("http://localhost:11434", "qwen2.5-coder");
var agent = new CodingAgent(chatClient, new AgentOptions
{
WorkDirectory = "/path/to/your/project",
MaxSteps = 15
});
var result = await agent.ExecuteAsync("Add unit tests for the Calculator class");
Console.WriteLine($"Status: {result.Status}");
Console.WriteLine($"Tool calls: {result.ToolCallCount}");
Console.WriteLine($"Tokens used: {result.Usage?.TotalTokenCount}");
Console.WriteLine(result.Message);
Configuration
All behavior is controlled through AgentOptions:
var options = new AgentOptions
{
// Where the agent operates (default: current directory)
WorkDirectory = "/my/project",
// Max tool call iterations before stopping (default: 25)
MaxSteps = 25,
// Enable shell command execution (default: false — security risk!)
EnableBash = false,
// File system tools (default: true)
EnableFileOps = true,
EnableFileWrites = true,
// Skill loading from .github/skills/ (default: true)
EnableSkills = true,
// Override the default system prompt
SystemPrompt = "You are a test-writing expert.",
// Append custom instructions to the system prompt
CustomInstructions = "Always use xUnit. Prefer Arrange-Act-Assert.",
// Auto-load AGENTS.md and copilot-instructions.md (default: true)
AutoLoadWorkspaceInstructions = true,
// Add your own custom AITools
CustomTools = new List<AITool>
{
AIFunctionFactory.Create(MyCustomTool)
}
};
Built-in Tools
| Tool | Description | Enabled by |
|---|---|---|
read_file |
Read file contents with line numbers and pagination | EnableFileOps |
write_file |
Create or overwrite files | EnableFileWrites |
edit_file |
Exact string replacement (single occurrence) | EnableFileWrites |
glob |
Find files by pattern (e.g. src/**/*.cs) |
EnableFileOps |
grep |
Search file contents with regex | EnableFileOps |
execute_bash_command |
Run shell commands | EnableBash |
list_skills / load_skill |
Discover and load project skills | EnableSkills |
Agent Result
ExecuteAsync returns an AgentResult with:
result.Status // "Success" or "Error"
result.Message // Final text response from the agent
result.Messages // Full conversation history (all messages, tool calls, results)
result.ToolCallCount // Number of tool invocations made
result.ModelId // Model that produced the response
result.FinishReason // Why the model stopped (e.g. "stop", "length")
result.Usage // Token counts (InputTokenCount, OutputTokenCount, TotalTokenCount)
Skills
The agent can discover and load project-specific skills from .github/skills/. Each skill is a Markdown file with YAML frontmatter:
---
name: build
description: How to build this project
---
# Build Instructions
Run `dotnet build` to compile the solution.
The agent calls list_skills to discover what's available and load_skill to read the full instructions.
Security
- Path traversal protection — all file operations are confined to
WorkDirectory - Bash disabled by default — opt in explicitly with
EnableBash = true - No sandboxing for bash — when enabled, the agent has full shell access with the process's privileges. Only enable in trusted environments (containers, CI runners)
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Microsoft.Extensions.AI (>= 10.4.1)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.6.0 | 135 | 3/31/2026 |
| 0.6.0-beta-beta.36 | 35 | 3/30/2026 |
| 0.6.0-beta-beta.35 | 42 | 3/30/2026 |
| 0.6.0-beta.42 | 27 | 3/31/2026 |
| 0.6.0-beta.40 | 30 | 3/31/2026 |
| 0.6.0-beta.39 | 25 | 3/31/2026 |
| 0.6.0-beta.38 | 29 | 3/31/2026 |
| 0.6.0-beta.37 | 151 | 3/30/2026 |
| 0.5.1-beta.34 | 40 | 3/29/2026 |
| 0.5.0 | 247 | 3/29/2026 |
| 0.5.0-beta.32 | 40 | 3/29/2026 |
| 0.5.0-beta.31 | 184 | 3/28/2026 |
| 0.4.4 | 94 | 3/26/2026 |
| 0.4.3 | 43 | 3/26/2026 |
| 0.4.2 | 43 | 3/25/2026 |
| 0.4.1 | 40 | 3/25/2026 |
| 0.4.0 | 46 | 3/25/2026 |
| 0.4.0-alpha.3 | 35 | 3/25/2026 |
| 0.4.0-alpha.2 | 37 | 3/25/2026 |
| 0.3.0-alpha.3 | 46 | 3/23/2026 |