A CLI tool to run code. Inspired by edl-cr.
Item | Status |
---|---|
Repository | |
Dependencies | |
Build | |
Coverage | |
Package |
CodeRunner is packed as a .NET Tool, and is pushed to MyGet. Use the following command to install it as global tool:
dotnet tool install -g CodeRunner --version 0.0.1-pre --add-source https://www.myget.org/F/stardustdl/api/v3/index.json
See the latest action CI-CD, and download the artifacts built
for your OS.
Option | Description |
---|---|
-d --dir |
Set working directory |
-c --command |
Execute command just like in interactive mode |
-V --version |
Show CR version |
-v --verbose |
Enable DEBUG level for logging |
If you don't use --command
options, CR will run in interactive mode.
> init
Initialize CR data. It will create a directory named .cr
in current directory.
If you want to clear CR data, use this command:
> init --delete
Create a new item:
> new cpp a
It will use templates in .cr/templates/
to create item.
If you want to set current work-item with an existed file, use this:
> now -- type=file target=a.cpp
Then use run
command to run code.
# run a.cpp
a.cpp> run cpp
Not only use files, you can also use directories to create a unique environment for codes.
# Create a new directory env
> new dir a
# Set a directory env for current
> now -- type=dir target=a
# Run
@a> run dir
For run
command, it will use the command list in settings.json
in the directory. You can write your own commands in it. And these command works in the directory of current work-item.
When you meet some errors, for example, CR data loading failing, use debug
command to get some information. This is also a useful tool when you create an issue.
Command | Description |
---|---|
init [--delete] |
Initialize or delete CR data |
clear |
Clear screen |
new [Template] [Name] |
Create new item by template |
now [--clear] |
Change current work-item |
run [Operation] |
Run operation |
template [list add remove] |
Manage templates |
operation [list add remove] |
Manage operations |
debug |
Show debug data |
exit |
Exit CR |
--help |
Get help |
--version |
Get version |
The config files is at .cr/
This directory contains templates.
This directory contains operations.