https://github.com/devlooped/runcs
Run C# programs from gists or remote repositories
https://github.com/devlooped/runcs
csharp dnx dotnet script
Last synced: 3 months ago
JSON representation
Run C# programs from gists or remote repositories
- Host: GitHub
- URL: https://github.com/devlooped/runcs
- Owner: devlooped
- License: mit
- Created: 2025-08-14T21:45:18.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-10-22T00:11:29.000Z (3 months ago)
- Last Synced: 2025-10-22T02:31:40.157Z (3 months ago)
- Topics: csharp, dnx, dotnet, script
- Language: C#
- Homepage:
- Size: 123 KB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- License: license.txt
Awesome Lists containing this project
README
 dnx runcs
============
[](https://www.nuget.org/packages/runcs)
[](https://www.nuget.org/packages/runcs)
[](https://github.com/devlooped/runcs/blob/main/license.txt)
[](https://github.com/devlooped/runcs/actions/workflows/build.yml)
## dnx runcs
Run C# code programs from git repos on GitHub, GitLab and Azure DevOps.
```
Usage:
[dnx] runcs [--aot] [--alias ALIAS] [...]
Arguments:
Reference to remote file to run, with format [host/]owner/repo[@ref][:path]
host optional host name ([gist.]github.com|gitlab.com|dev.azure.com, default: github.com)
@ref optional branch, tag, or commit (default: default branch)
:path optional path to file in repo (default: program.cs at repo root)
Examples:
* kzu/sandbox@v1.0.0:run.cs (implied host github.com, explicit tag and file path)
* gitlab.com/kzu/sandbox@main:run.cs (all explicit parts)
* kzu/sandbox (implied host github.com, ref and path defaults)
Can be an alias previously set with --alias.
Arguments passed to the C# program that is being run.
Options:
--aot (optional) Enable dotnet AOT defaults for run file.cs. Defaults to false.
--alias ALIAS (optional) Assign an alias on first usage which can be used instead of the full ref.
```
Example:
```
dnx runcs kzu/runcs@v1:run.cs dotnet rocks
```
View [source](https://github.com/kzu/runcs/blob/v1/run.cs):
```csharp
#:package Spectre.Console@*
using Spectre.Console;
AnsiConsole.MarkupLine($"Hello world from [green]dnx[/] [yellow]gist[/] :rocket: [bold italic]{string.Join(' ', args)}[/]");
```
> [!TIP]
> The repo does not need to be public. In that case, the same authentication
> used by your local `git` will be used to access the file, via the Git Credential Manager.
When running different files from the same repo+ref, the download will be performed only once.
The last download etag is used to avoid downloading on each run.
## dnx gist
[](https://www.nuget.org/packages/gist)
[](https://www.nuget.org/packages/gist)
Run C# code programs from GitHub gists.
```
Usage: [dnx] gist [--aot] [--alias ALIAS] [...]
Arguments:
Reference to gist file to run, with format owner/gist[@commit][:path]
@commit optional gist commit (default: latest)
:path optional path to file in gist (default: program.cs or first .cs file)
Examples:
* kzu/0ac826dc7de666546aaedd38e5965381 (tip commit and program.cs or first .cs file)
* kzu/0ac826dc7de666546aaedd38e5965381@d8079cf:run.cs (explicit commit and file path)
Can be an alias previously set with --alias.
Arguments passed to the C# program that is being run.
Options:
--aot (optional) Enable dotnet AOT defaults for run file.cs. Defaults to false.
--alias ALIAS (optional) Assign an alias on first usage which can be used instead of the full ref.
```
> [!TIP]
> The gist does not need to be public. In that case, the same authentication
> used by your local `git` will be used to access the gist, via the Git Credential Manager.
Example:
```
dnx gist kzu/52b115ce24c7978ddc33245d4ff840f5 dotnet rocks
```
View [source gist](https://gist.github.com/kzu/52b115ce24c7978ddc33245d4ff840f5):
```csharp
#:package Spectre.Console@*
using Spectre.Console;
AnsiConsole.MarkupLine($"Hello world from [green]dnx[/] [yellow]gist[/] :rocket: [bold italic]{string.Join(' ', args)}[/]");
```
When running different files from the same repo+ref, the download will be performed only once.
The last download etag is used to avoid downloading on each run.
# Dogfooding
[](https://pkg.kzu.app/index.json)
We also produce CI packages from branches and pull requests so you can dogfood builds as quickly as they are produced.
The CI feed is `https://pkg.kzu.app/index.json`.
The versioning scheme for packages is:
- PR builds: *42.42.[run]-pr*`[NUMBER]`
- Branch builds: *42.42.[run]-*`[BRANCH]`
# Sponsors
[](https://github.com/clarius)
[](https://github.com/MFB-Technologies-Inc)
[](https://github.com/drivenet)
[](https://github.com/Keflon)
[](https://github.com/tbolon)
[](https://github.com/kfrancis)
[](https://github.com/unoplatform)
[](https://github.com/rbnswartz)
[](https://github.com/jfoshee)
[](https://github.com/Mrxx99)
[](https://github.com/eajhnsn1)
[](https://github.com/davidjenni)
[](https://github.com/Jonathan-Hickey)
[](https://github.com/akunzai)
[](https://github.com/KenBonny)
[](https://github.com/SimonCropp)
[](https://github.com/agileworks-eu)
[](https://github.com/arsdragonfly)
[](https://github.com/vezel-dev)
[](https://github.com/ChilliCream)
[](https://github.com/4OTC)
[](https://github.com/v-limo)
[](https://github.com/jordansjones)
[](https://github.com/DominicSchell)
[](https://github.com/jwendl)
[](https://github.com/adalon)
[](https://github.com/Eule02)
[](https://github.com/henkmartijn)
[](https://github.com/torutek)
[](https://github.com/mccaffers)
[](https://github.com/sponsors/devlooped)
[Learn more about GitHub Sponsors](https://github.com/sponsors)