cs-script.cli
4.8.24
dotnet tool install --global cs-script.cli --version 4.8.24
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local cs-script.cli --version 4.8.24
#tool dotnet:?package=cs-script.cli&version=4.8.24
nuke :add-package cs-script.cli --version 4.8.24
CS-Script (CLI)
CS-Script is a CLR based scripting system which uses ECMA-compliant C# as a programming language.
CS-Script is one of the most mature C# scripting solutions. It became publicly available in 2004, just two years after the first release of .NET. And it was the first comprehensive scripting platform for .NET.
CS-Script allows direct single-step execution of files containing ECMA-compliant C# code (either from shell or from the application).
Canonical "Hello World" script (script.cs):
using System;
Console.WriteLine("Hello World!");
The script can be executed fom the terminal:
css
is a native executable. It simply launches the script engine assembly (cscs.dll) without the need to invoke .NET launcher dotnet
.
css script.cs
You can read in more details about script engine on the product home page: https://github.com/oleg-shilo/cs-script/wiki/CLI-Script-Execution.
From the start, CS-Script was heavily influenced by Python and the developer experiences it delivers. Thus, it tries to match the most useful Python features (apart from the Python syntax). Here are some highlights of the CS-Script features. - Scripts are written in plain vanilla CLS-compliant C#. Though classless scripts (top-level statements) are also supported. - Remarkable execution speed matching performance of compiled managed applications. - Including (referencing) dependency scripts from the main script. - Referencing external assemblies from the script. - Automatic referencing external assemblies based on analyses of the script-imported namespaces ('usings'). - Automatic resolving (downloading and referencing) NuGet packages. - Building a self-sufficient executable from the script. - Possibility to plug in external compiling services for supporting alternative script syntax (e.g. VB, C++) - Scripts can be executed on Windows, Linux and MacOS (.NET5 needs to be present). - Full integration with Windows, Visual Studio, VSCode, Notepad++ (CS-Script plugin for Notepad++ brings true IntelliSense to the 'peoples editor'), Sublime Text 3
Note, when upgrading or uninstalling CS-Script CLI .NET tool you may need to ensure that you stop any running instances of the script engine. You can do that by executing this simple command: css -servers:stop
(or even simpler: css -kill
).
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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 is compatible. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
4.8.24 | 91 | 12/21/2024 |
4.8.23 | 230 | 12/14/2024 |
4.8.22 | 332 | 11/27/2024 |
4.8.21.1 | 251 | 11/18/2024 |
4.8.21 | 160 | 11/18/2024 |
4.8.19 | 436 | 10/31/2024 |
4.8.18 | 2,380 | 8/10/2024 |
4.8.17 | 460 | 7/13/2024 |
4.8.16 | 991 | 5/21/2024 |
4.8.15 | 1,105 | 4/11/2024 |
4.8.12 | 3,924 | 12/16/2023 |
4.8.10 | 952 | 11/25/2023 |
4.8.9 | 415 | 11/15/2023 |
4.8.8 | 227 | 11/15/2023 |
4.8.7 | 262 | 11/7/2023 |
4.8.6 | 482 | 10/22/2023 |
4.8.5 | 393 | 10/14/2023 |
4.8.1 | 1,221 | 7/7/2023 |
4.7.1 | 1,326 | 4/2/2023 |
4.7.0 | 497 | 3/27/2023 |
---
## Changes
### CLI
- #400: Timeout in CI/CD script
- Assorted nuget support improvements triggered by #400
- removed doc zip files to not to upset WinDefender
- removed unnecessary nuget restore step for adding package dll's location to the search dir. It was adding no value since search dirs play no role in nuget related scenarios.
- Now nuget restore and asembly lookup are both respecting `CSSCRIPT_NUGET_PACKAGES` nvar. Previously only lookup did. Triggered by #400.
### CSScriptLib
- no changes