A terminal-based AI coding assistant built with .NET 10 and Spectre.Console.
Your AI coding assistant in the terminal β fast, focused, and extensible.
Real-time streaming responses from AI models. Watch the answer unfold as it's generated β no waiting for complete responses.
Choose from multiple AI providers:
- Alibaba Cloud
- OpenAI
- Anthropic
Pebbles includes 5 built-in tools for autonomous task execution:
| Tool | Command | Description |
|---|---|---|
| Read File | read_file |
Read file contents |
| Write File | write_file |
Create/modify files |
| Shell | run_command |
Execute shell commands |
| List Directory | list_directory |
Browse folders |
| Search Files | search_files |
Search text patterns |
Your conversations are automatically saved and restored:
- Auto-save after each message
- Auto-load previous session on startup
- Multiple sessions supported
- Commands:
/save,/load,/sessions,/delete
Navigate and control Pebbles efficiently:
| Shortcut | Action |
|---|---|
Tab |
Accept autocomplete suggestion |
Escape |
Dismiss suggestions / Clear input |
β / β |
Navigate suggestions / History |
β / β |
Move cursor |
Home |
Jump to start of line |
End |
Jump to end of line |
Ctrl+U |
Clear current line |
Ctrl+C |
Exit Pebbles |
Command Autocomplete: Type / to see available commands. Use β/β to navigate and Tab to accept.
File Picker: Type @ to browse files interactively:
- Shows files and directories in the current folder
- Type to filter the list
- Navigate into directories by selecting them
- Press
Tabto insert the selected path
When using models that support extended reasoning (like qwen3-max-2026-01-23), Pebbles displays the AI's thinking process in a block before the response.
Full control over your session with 22 built-in commands:
| Command | Description |
|---|---|
/help |
Show available commands |
/clear |
Clear chat history |
/model |
Switch AI model |
/provider |
Show current AI provider |
/history |
Show conversation history |
/cost |
Show token usage and cost |
/context |
Show project context |
/read <path> |
Read a file |
/files |
List loaded files |
/clearfiles |
Clear loaded files |
/compress |
Compress conversation |
/autocompress |
Toggle auto-compression |
/remember <text> |
Save to memory |
/memory |
View memories |
/save |
Save current session |
/load <id> |
Load session |
/sessions |
List all sessions |
/delete <id> |
Delete session |
/reload |
Reload plugins |
/plugins |
List plugins |
/tools |
List available tools |
/exit |
Exit Pebbles |
Reference files directly in your messages using @file.cs syntax:
What does the Process method do in @Services/ChatService.cs?
Pebbles automatically loads and includes the file content in the AI context. Supports:
- All text file formats (.cs, .js, .py, .md, .json, .yaml, etc.)
- Size limit: 1MB per file
- Binary files are automatically detected and skipped
Store project-specific instructions in .pebbles/agent/AGENTS.md:
# Project Guidelines
- Use Entity Framework Core for data access
- Follow async/await patterns
- Write unit tests for all servicesPebbles automatically includes these guidelines in every AI conversation. Supports both:
- Project context:
.pebbles/agent/AGENTS.md(current directory) - Global context:
~/.pebbles/agent/AGENTS.md(user profile)
Real-time token usage and cost estimation:
β― 156 input β 423 output β’ $0.0012 β’ 579 total tokens
Track your spending with /cost command.
# Clone the repository
git clone https://github.com/yourusername/pebbles.git
cd pebbles
# Build and run
dotnet run --project src/Pebbles/Pebbles.csprojCreate appsettings.json in the application directory:
{
"Pebbles": {
"Provider": "alibabacloud",
"DefaultModel": "qwen3.5-plus",
"AlibabaCloudApiKey": "your-api-key-here"
}
}On first run, Pebbles will prompt you to select a provider and enter your API key. The key is stored as an environment variable for the session.
Alibaba Cloud Coding Plan: Use your Coding Plan-specific API key (format: sk-sp-xxxxx) from the Coding Plan page.
Alternatively, set your API key via environment variable before starting:
# Alibaba Cloud Coding Plan (use sk-sp-xxxxx format key)
export ALIBABA_CLOUD_API_KEY=sk-sp-your-key-here
# OpenAI
export OPENAI_API_KEY=your-api-key-here
# Anthropic
export ANTHROPIC_API_KEY=your-api-key-hereFor persistence, add these to your shell profile (e.g., ~/.bashrc, ~/.zshrc).
dotnet run --project src/Pebbles/Pebbles.csprojJust type your question:
β― You: How do I implement a retry pattern with Polly?
⬑ Pebbles:
Here's how to implement a retry pattern with Polly in C#:
ββ csharp ββββββββββββββββββββββββββββββββββ
β var retryPolicy = Policy
β .Handle<HttpRequestException>()
β .WaitAndRetryAsync(3, retryAttempt =>
β TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));
βββββββββββββββββββββββββββββββββββββββββββ
Use @ to reference files:
β― You: Review this code for potential issues:
@Program.cs
@Services/ChatService.cs
β Program.cs (2.5 KB)
β ChatService.cs (4.1 KB)
Loaded 2 file(s) into context
⬑ Pebbles: I've reviewed the files. Here are my suggestions...
β― You: /save
β Session saved
ID: 7a4f55d5
Messages: 24
β― You: /sessions
Saved Sessions
β 7a4f55d5
3b2c88e1
β― You: /load 3b2c88e1
β Session loaded
ID: 3b2c88e1
Messages: 18
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Program.cs β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
β β Config β β DI Containerβ β Service Provider β β
β β (Options) ββ β Setup ββ β Build & Resolve β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ChatService β
β ββββββββββββββββ βββββββββββββββββββββββββββββββββββββ β
β β InputHandler ββ β CompositeCommandHandler β β
β β (User Input) β β ββ ChatCommands (static) β β
β ββββββββββββββββ β ββ FileCommands β β
β β β ββ SessionCommands β β
β β β ββ CompressionCommands β β
β β β ββ MemoryCommands β β
β β β ββ PluginCommands β β
β β βββββββββββββββββββββββββββββββββββββ β
β β β β
β β βΌ β
β β βββββββββββββββββββββββββ β
β ββββββββββββ IAIProvider β β
β β (Streaming) β β
β βββββββββββββββββββββββββ β
β β β
β ββββββββββββββΌβββββββββββββ β
β βΌ βΌ βΌ β
β ββββββββββββ βββββββββββββ ββββββββββββ β
β βToolExec β βFileServiceβ βContext β β
β βService β β(@files) β βManager β β
β ββββββββββββ βββββββββββββ ββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Component | Responsibility |
|---|---|
ChatService |
Main application loop |
IAIProvider |
AI provider abstraction (Alibaba Cloud, OpenAI, Anthropic) |
CompositeCommandHandler |
Aggregates specialized command handlers |
ChatRenderer |
UI rendering with Spectre.Console |
InputHandler |
User input processing |
FileService |
File loading and @reference parsing |
ContextManager |
Project/global context management |
ToolRegistry |
Tool management and execution |
SessionStore |
Session persistence |
- Dependency Injection β All services registered via
IServiceCollection - Provider Pattern β
IAIProviderinterface for swappable AI backends - Options Pattern β Configuration via
PebblesOptionsclass with validation - Command Pattern β Composite pattern for slash command handling
- Registry Pattern β
ToolRegistryfor tool management - Streaming β
IAsyncEnumerable<T>for real-time token streaming
| Project | Purpose | Tests |
|---|---|---|
Pebbles.Tests |
Unit tests | 42 tests |
Pebbles.IntegrationTests |
Integration tests | 6 tests |
Pebbles.E2ETests |
End-to-end tests | 6 tests |
Pebbles.Benchmarks |
Performance benchmarks | 8 benchmarks |
# Run all tests
dotnet test
# Run with coverage
dotnet test --collect:"XPlat Code Coverage"
# Run specific project
dotnet test tests/Pebbles.Tests/Pebbles.Tests.csproj- Target: 80%+ code coverage
- Current: 85%+ coverage
- CI Pipeline: Builds and tests on every push and PR
- Release Pipeline: Creates Native AOT releases on git tags
- Windows (win-x64)
- Linux (linux-x64)
- macOS (osx-x64)
See CONTRIBUTING.md for development guidelines.
git clone https://github.com/yourusername/pebbles.git
cd pebbles
dotnet restore
dotnet build
dotnet test
dotnet run --project src/Pebbles/Pebbles.csproj| Document | Description |
|---|---|
| Architecture | System architecture and design |
| Plugins | Plugin development guide |
| Configuration | Configuration options |
| Contributing | Contribution guidelines |
Status: β 100% Feature Complete
All planned features have been implemented:
- β CI/CD pipeline
- β Integration tests
- β E2E tests
- β Session persistence
- β Multi-provider support (Alibaba Cloud, OpenAI, Anthropic)
- β Performance benchmarks
- β Complete documentation
Future enhancements will be based on community feedback.
MIT License - see LICENSE file for details.
Made with β€οΈ for developers who love the terminal