Skip to content

CLI User Guide

oleg-shilo edited this page Jul 8, 2017 · 32 revisions

Deployment

As many other tools CS-Script provides an intensive command line interface that can be used from shell/terminal (e.g. Bash, PowerShell, command-prompt). This interface is particularly useful fo environments like Linux, where working from terminal is a predominate development approach.

CS-Script deployment model exist in two distinctive distribution forms:

  • Simple
    Applicable for Windows, Linux, Mac. Basically it is an XCopy approach when yuo can bring on the target system CS-Script binaries that you need. Typically it is the script engine executable (cscs.exe). While you may also want to bring CSSRoslynProvider.dll along but strictly speaking cscs.exe is all you need ro run C# scripts.

  • Complete
    Applicable for Windows only. This model involves much dipper integration with the host OS. It involves bringing the software package (7z archive) from GitHub Releases folder unpacking it and launching the config console (css_config.exe), which performs all necessary configuration steps. Alternatively you can perform a single step deployment via the Chocolatey CS-Script package. The Complete deployment/distro contains much more than CS-Script binaries (Simple distro). It also includes extra utilities and binaries targeting various rintimes and the documentation.

    Full distro content (click to expand)   - Integration with OS: system path, envars, shell-extensions, default editor association
      - GUI configuration console
      - NuGet and Wsdl third-party tools
      - Collection of utility scripts
      - Binaries targeting legacy runtimes (e.g. .NET 3.5)
      - Complete set of Roslyn binaries
      - Intensive _Samples_ library
      - Documentation

While Complete distro contains many useful resources the Simple one is what you would need in 90% of the cases. The script engine CLI is designed in such a way that it (single executable) can produce the minimal set of CS-Script documentation, samples and required configuration. The Simple distro is applicable for all OSs and as such it is perfect as a basic environment for a crash-course in CS-Script.

Quick Start

Note if you are running CS-Script on Mono you will always need to supply the mono prefix for all commands: mono cscs.exe -ver instead of cscs -ver. However this contains all samples written in the short form for teh sake of simplicity.

Create and execute sample script

  • cscs -s - prints sample script.
  • cscs -s > sample.cs - redirects sample script content into sample.cs file
  • cscs sample.cs - execute sample.cs file

Command Line Interface

Command: version

Syntax: cscs -ver (or just cscs)

Description: Prints full information about the current CS-Script environment.


Command: commands

Syntax: cscs -cmd

Description: Prints list of supported commands (arguments).

Syntax: cscs -cmd ?

Description: Prints description of an individual command.


dsfsadf


Under development