| src | ||
| .gitignore | ||
| build.sh | ||
| LICENSE | ||
| README.md | ||
cs-mic-cli
cs-mic-cli is a small command line client for CS-MIC, a numeric expression interpreter for .NET.
Use it when you want CS-MIC's expression syntax from a terminal: quick calculations, reusable variables in an interactive session, or a simple native executable you can call from scripts.
Downloads
Release builds provide native executables for:
- Windows x64:
csmic-win-x64.exe - Linux x64:
csmic-linux-x64
On Linux, you can rename or symlink the binary to csmic and place it somewhere on your PATH, such as ~/.local/bin.
Usage
Evaluate an expression directly:
csmic "2 + 3 * 4"
Output:
14
Use CS-MIC standard library constants and functions:
csmic "pi * 10^2"
csmic "degrees(pi / 2)"
csmic "max(0, 5 - 12)"
Start an interactive session:
csmic --interactive
or:
csmic -i
Inside the interactive prompt, enter expressions one at a time:
csmic> 2 + 2
4
csmic> exit()
Show version information:
csmic --version
Show help:
csmic --help
Options
Usage:
cs-mic-cli [<expression>...] [options]
Arguments:
<expression> Expression to evaluate.
Options:
--verbose Displays parser/runtime error details when a soft error occurs.
-i, --interactive Starts an interactive session.
-?, -h, --help Show help and usage information.
--version Show version information.
Configuration
At startup, the CLI loads an optional init file:
$XDG_CONFIG_HOME/csmic/init.csmic
If XDG_CONFIG_HOME is not set, it uses:
~/.config/csmic/init.csmic
The file is created automatically if it does not exist. Put one CS-MIC expression per line to define variables or other startup state before your command or interactive session runs.
Building
Requirements:
- .NET 8 SDK
- Linux shell environment for
build.sh
Build both release executables:
./build.sh
The script publishes:
dist/csmic-linux-x64dist/csmic-win-x64.exe
It also installs the Linux build to ~/.local/bin/csmic.
For local development, run the project directly:
dotnet run --project src/cs-mic-cli -- "2 + 3 * 4"
CS-MIC Documentation
Expression syntax, standard library functions, constants, and the embeddable .NET packages are documented at: