CSharpRepl  by waf

CLI tool for C# experimentation and interactive exploration

Created 4 years ago
3,198 stars

Top 15.0% on SourcePulse

GitHubView on GitHub
Project Summary

A cross-platform command-line C# REPL for rapid experimentation and exploration of the language, libraries, and NuGet packages. It targets .NET developers seeking an interactive environment for quick code testing, debugging, and learning, offering features like IntelliSense, NuGet integration, and object exploration.

How It Works

This REPL leverages .NET's Roslyn compiler services to provide an interactive C# experience. It parses and evaluates code snippets in real-time, offering features like syntax highlighting via ANSI escape sequences, IntelliSense with documentation lookup, and automatic code formatting. It supports referencing local projects, assemblies, and NuGet packages directly within the REPL session using the #r command.

Quick Start & Requirements

  • Install via: dotnet tool install -g csharprepl
  • Requires .NET 9.
  • Supports Windows, macOS, and Linux.
  • See Configuring CSharpRepl for advanced setup.

Highlighted Details

  • IntelliSense with documentation and overload navigation.
  • NuGet package installation and referencing local projects/assemblies.
  • Object exploration with Spectre.Console formatting.
  • IL disassembly (Debug and Release modes) and Source Link navigation.
  • OpenAI integration (requires API key).

Maintenance & Community

  • Actively maintained by waf.
  • Contribution guidelines available in CONTRIBUTING.md.

Licensing & Compatibility

  • MIT License.
  • Permissive for commercial use and integration with closed-source projects.

Limitations & Caveats

  • Shift+Enter for newlines is not supported on Linux or macOS.
  • OpenAI integration requires a user-provided API key.
Health Check
Last Commit

1 week ago

Responsiveness

1 day

Pull Requests (30d)
6
Issues (30d)
1
Star History
17 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.