CShell

A simple, yet powerful, C# scripting IDE

View project onGitHub

What is CShell?

CShell is an interactive C# scripting environment. It allows you to use C# without any fluff right in a console like environment called a read-eval-print-loop (REPL). Your code is directly evaluated and executed in a shell window, no separate executable has to be compiled and then run in a different process. More elaborate code can be written in a C# script and then evaluated as one file, only one line, or a selection. Then, your results can be easily dumped to HTML (like LINQPad) or viewed as a data grid or plotted to a chart.

CShell is perfect to explore data and quickly drill deeper into information since you can write one line of code, evaluate it, check out the results, and then write some more code, evaluate it again, and so forth.

If you just want to test one or two lines of C# code without creating a new console project in Visual Studio just fire up CShell, type the code you wanna test and you immediately can see if it works the way you want.

Screenshot

Features

  • Read Eval Print Loop (REPL): Evalutes C# code on the fly (built using Mono.CSharp). Includes code completions right in the command line.
  • C# Code Editor: A powerful editor with code completion that supports C# scripts (.csx files) and normal C# (.cs) files and many more file types. Code from the scripts can be directly sent to the REPL.
  • Workspace Explorer: The place to keep all the scripts and other files organized, manages references, and edit the ".cshell" file, in which the whole CShell IDE can be configured using C# code (not XML).
  • Sinks: Out of the box there are several ways of viewing any resulting data: Simple console output, LINQPad like XHTML dump, data grids, and plotting.
  • Extend CShell: The whole project was built with extensibility in mind, modules that add new editors or sinks and more can be quickly develped and loaded in CShell.

Getting Started

  1. Install CShell: This is an early beta release, currently there's no installer available, either download the binaries zip file or build from the sources yourself.
  2. To work with CShell you need to create a workspace, which is relatively permanent, i.e., you won't have to create a new workspace for everything you do. Think of it as your general environment where your scripts reside. To create the workspace: File > New Workspace...
  3. Now you're ready to start using the REPL, just start typing C# code and hit enter.
  4. Tutorial: This might now be a good time to go through the tutorial script which you can find in the CShell binary directory: CShell/Templates/Tutorial.csx

Why CShell?

We developed CShell because we needed it for ourselves. Visual Studio was often too heavy weight and LINQPad has no REPL loop. What if you load 2-3 GB of data and then wanna start exploring it, without having to load all the data every time the program is executed? With a REPL loop this is possible. Also we felt the time is ready for a more mature C# scripting environment with projects like NRefactory, Mono.CSharp and Roslyn quickly filling the gaps that remained to realize such a project.

License

CShell is released under the Apache 2.0 license.