Cargo script subcommand

Overview

cargo-script

cargo-script is a Cargo subcommand designed to let people quickly and easily run Rust "scripts" which can make use of Cargo's package ecosystem. It can also evaluate expressions and run filters.

Some of cargo-script's features include:

  • Reading Cargo manifests embedded in Rust scripts.
  • Caching compiled artefacts (including dependencies) to amortise build times.
  • Supporting executable Rust scripts via UNIX hashbangs and Windows file associations.
  • Evaluating expressions on the command-line.
  • Using expressions as stream filters (i.e. for use in command pipelines).
  • Running unit tests and benchmarks from scripts.
  • Custom templates for command-line expressions and filters.

Note: cargo-script does not work when Cargo is instructed to use a target architecture different to the default host architecture.

Table of contents:

Installation

The recommended method for installing cargo-script is by using Cargo's install subcommand:

cargo install cargo-script

If you have already installed cargo-script, you can update to the latest version by using:

cargo install --force cargo-script

Migrating From Previous Versions

cargo-script supports migrating data from previous versions. This is not mandatory, but may be preferred. Using cargo script --migrate-data dry-run will perform a "dry run", informing you of any applicable migrations. Using the for-real option will actually perform the migration. The following migrations may be applicable:

  • 0.1 → 0.2: On non-Windows platforms, and when CARGO_HOME is defined, moves the location for cached data from $CARGO_HOME/.cargo to $CARGO_HOME.

Cargo Features

The following features are defined:

  • suppress-cargo-output (default): if building the script takes less than 2 seconds and succeeds, cargo-script will suppress Cargo's output. Note that this disabled coloured Cargo output on Windows.

Manually Compiling and Installing

cargo-script requires Rust 1.11 or higher to build. Rust 1.4+ was supported prior to version 0.2.

Once built, you should place the resulting executable somewhere on your PATH. At that point, you should be able to invoke it by using cargo script. Note that you can run the executable directly, but the first argument will need to be script.

If you want to run cargo script from a hashbang on UNIX, or via file associations on Windows, you should also install the run-cargo-script program somewhere on PATH.

Self-Executing Scripts

On UNIX systems, you can use #!/usr/bin/env run-cargo-script as a hashbang line in a Rust script. If the script file is executable, this will allow you to execute a script file directly.

If you are using Windows, you can associate the .crs extension (which is simply a renamed .rs file) with run-cargo-script. This allows you to execute Rust scripts simply by naming them like any other executable or script.

This can be done using the cargo-script file-association command (note the hyphen in cargo-script). This command can also remove the file association. If you pass --amend-pathext to the file-assocation install command, it will also allow you to execute .crs scripts without having to specify the file extension, in the same way that .exe and .bat files can be used.

If you want to make a script usable across platforms, it is recommended that you use both a hashbang line and give the file a .crs file extension.

Usage

Generally, you will want to use cargo-script by invoking it as cargo script (note the lack of a hypen). Doing so is equivalent to invoking it as cargo-script script. cargo-script supports several other subcommands, which can be accessed by running cargo-script directly. You can also get an overview of the available options using the --help flag.

Scripts

The primary use for cargo-script is for running Rust source files as scripts. For example:

$ echo 'fn main() { println!("Hello, World!"); }' > hello.rs
$ cargo script hello.rs
Hello, World!
$ cargo script hello # you can leave off the file extension
Hello, World!

The output of Cargo will be hidden unless compilation fails, or takes longer than a few seconds.

cargo-script will also look for embedded dependency and manifest information in the script. For example, all of the following are equivalent:

  • now.crs (code block manifest with UNIX hashbang and .crs extension):

    #!/usr/bin/env run-cargo-script
    //! This is a regular crate doc comment, but it also contains a partial
    //! Cargo manifest.  Note the use of a *fenced* code block, and the
    //! `cargo` "language".
    //!
    //! ```cargo
    //! [dependencies]
    //! time = "0.1.25"
    //! ```
    extern crate time;
    fn main() {
        println!("{}", time::now().rfc822z());
    }
  • now.rs (dependency-only, short-hand manifest):

    // cargo-deps: time="0.1.25"
    // You can also leave off the version number, in which case, it's assumed
    // to be "*".  Also, the `cargo-deps` comment *must* be a single-line
    // comment, and it *must* be the first thing in the file, after the
    // hashbang.
    extern crate time;
    fn main() {
        println!("{}", time::now().rfc822z());
    }

    Note: you can write multiple dependencies by separating them with commas. E.g. time="0.1.25", libc="0.2.5".

On running either of these, cargo-script will generate a Cargo package, build it, and run the result. The output may look something like:

$ cargo script now
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling winapi-build v0.1.1
   Compiling winapi v0.2.8
   Compiling libc v0.2.30
   Compiling kernel32-sys v0.2.2
   Compiling time v0.1.38
   Compiling now v0.1.0 (file:///C:/Users/drk/AppData/Local/Cargo/script-cache/file-now-37cb982cd51cc8b1)
    Finished release [optimized] target(s) in 49.7 secs
Sun, 17 Sep 2017 20:38:58 +1000

Subsequent runs, provided the script has not changed, will likely just run the cached executable directly:

$ cargo script now
Sun, 17 Sep 2017 20:39:40 +1000

Useful command-line arguments:

  • --bench: Compile and run benchmarks. Requires a nightly toolchain.
  • --debug: Build a debug executable, not an optimised one.
  • --features <features>: Cargo features to pass when building and running.
  • --force: Force the script to be rebuilt. Useful if you want to force a recompile with a different toolchain.
  • --gen-pkg-only: Generate the Cargo package, but don't compile or run it. Effectively "unpacks" the script into a Cargo package.
  • --test: Compile and run tests.

Expressions

cargo-script can also run pieces of Rust code directly from the command line. This is done by providing the --expr option; this causes cargo-script to interpret the <script> argument as source code instead of as a file path. For example, code can be executed from the command line in a number of ways:

  • cargo script --dep time --expr "extern crate time; time::now().rfc822z().to_string()"
  • cargo script --dep time=0.1.38 --expr "extern crate time; ..." - uses a specific version of time
  • cargo script -d time -e "extern crate time; ..." - short form of above
  • cargo script -D time -e "..." - guess and inject extern crate time; this only works when the package and crate names of a dependency match.
  • cargo script -d time -x time -e "..." - injects extern crate time; works when the names do not match.

The code given is embedded into a block expression, evaluated, and printed out using the Debug formatter (i.e. {:?}).

Useful command-line arguments:

  • -d/--dep: add a dependency to the generated Cargo.toml manifest.
  • -x/--extern: inject extern crate into generated script.
  • -D/--dep-extern: do both of the above.
  • -t/--template: Specify a custom template for this expression (see section on templates).

Stream Filters

You can use cargo-script to write a quick stream filter, by specifying a closure to be called for each line read from stdin, like so:

$ cat now.crs | cargo script --loop \
    "let mut n=0; move |l| {n+=1; println!(\"{:>6}: {}\",n,l.trim_right())}"
   Compiling loop v0.1.0 (file:///C:/Users/drk/AppData/Local/Cargo/script-cache/loop-58079283761aab8433b1)
     1: // cargo-deps: time="0.1.25"
     2: extern crate time;
     3: fn main() {
     4:     println!("{}", time::now().rfc822z());
     5: }

You can achieve a similar effect to the above by using the --count flag, which causes the line number to be passed as a second argument to your closure:

$ cat now.crs | cargo script --count --loop \
    "|l,n| println!(\"{:>6}: {}\", n, l.trim_right())"
   Compiling loop v0.1.0 (file:///C:/Users/drk/AppData/Local/Cargo/script-cache/loop-58079283761aab8433b1)
     1: // cargo-deps: time="0.1.25"
     2: extern crate time;
     3: fn main() {
     4:     println!("{}", time::now().rfc822z());
     5: }

Note that, like with expressions, you can specify a custom template for stream filters.

Environment Variables

The following environment variables are provided to scripts by cargo-script:

  • CARGO_SCRIPT_BASE_PATH: the base path used by cargo-script to resolve relative dependency paths. Note that this is not necessarily the same as either the working directory, or the directory in which the script is being compiled.

  • CARGO_SCRIPT_PKG_NAME: the generated package name of the script.

  • CARGO_SCRIPT_SAFE_NAME: the file name of the script (sans file extension) being run. For scripts, this is derived from the script's filename. May also be "expr" or "loop" for those invocations.

  • CARGO_SCRIPT_SCRIPT_PATH: absolute path to the script being run, assuming one exists. Set to the empty string for expressions.

Templates

You can use templates to avoid having to re-specify common code and dependencies. You can view a list of your templates by running cargo-script templates list (note the hyphen), or show the folder in which they should be stored by running cargo-script templates show. You can dump the contents of a template using cargo-script templates dump NAME.

Templates are Rust source files with two placeholders: #{prelude} for the auto-generated prelude (which should be placed at the top of the template), and #{script} for the contents of the script itself.

For example, a minimal expression template that adds a dependency and imports some additional symbols might be:

// cargo-deps: itertools="0.6.2"
#![allow(unused_imports)]
#{prelude}
extern crate itertools;
use std::io::prelude::*;
use std::mem;
use itertools::Itertools;

fn main() {
    let result = {
        #{script}
    };
    println!("{:?}", result);
}

If stored in the templates folder as grabbag.rs, you can use it by passing the name grabbag via the --template option, like so:

$ cargo script -t grabbag -e "mem::size_of::<Box<Read>>()"
16

In addition, there are three built-in templates: expr, loop, and loop-count. These are used for the --expr, --loop, and --loop --count invocation forms. They can be overridden by placing templates with the same name in the template folder. If you have not overridden them, you can dump the contents of these built-in templates using the templates dump command noted above.

Known Issues

Issue #50

There is a problem on Windows where cargo-script can hang when asking Cargo for the path to a package's compiled executable. cargo-script currently works around this by using an older heuristic to guess this path on affected versions. This can, however, lead to cargo-script being unable to correctly locate a compiled executable.

If this is a problem, cargo-script can be instructed to use the accurate-but-buggy approach by setting the CARGO_SCRIPT_IGNORE_ISSUE_50 environment variable to any non-empty string.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

Comments
  • -d and -e don't work together

    -d and -e don't work together

    ...since you can't put an "extern crate" statement in an expression (edit: I mean, you can, but it is silently ignored). A fix might be to automatically inject the extern statements in expr.rs when -d and -e are both present.

    opened by durka 14
  • Can't start the script + internal error

    Can't start the script + internal error

    $ cat time.rs
    // cargo-deps: time="0.1.34"
    extern crate time;
    
    pub fn main() {
      let ::time::Timespec { sec: s, nsec: ns } = ::time::get_time();
      let time = s as f64 + 0.001*0.001*0.001 * (ns as f64);
      println!("{}", time);
    }
    $ cargo script time.rs
        Updating registry `https://github.com/rust-lang/crates.io-index`
     Downloading libc v0.2.19
       Compiling libc v0.2.19
       Compiling winapi v0.2.8
       Compiling winapi-build v0.1.1
       Compiling kernel32-sys v0.2.2
       Compiling time v0.1.35
       Compiling time v0.1.0 (file:///home/vi/.multirust/toolchains/nightly/cargo/.cargo/script-cache/file-time-081628d1e4f892f1)
        Finished release [optimized] target(s) in 10.8 secs
    internal error: No such file or directory (os error 2)
    

    Probable cause: overridden default target for Cargo:

    $ cat ~/.cargo/config 
    [build]
    target = "x86_64-unknown-linux-gnu"
    

    So it's in /home/vi/.multirust/toolchains/nightly/cargo/.cargo/binary-cache/x86_64-unknown-linux-gnu/release/time instead of just /home/vi/.multirust/toolchains/nightly/cargo/.cargo/binary-cache/release/time.

    opened by vi 11
  • Cargo Install Failing on Windows MSVC

    Cargo Install Failing on Windows MSVC

    Running cargo install on Rust 1.17,0 nightly.

    Get the follwoing error:

    error: linking with `link.exe` failed: exit code: 1120
      |
      = note: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\link.exe" "/LIBPATH:C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\lib\\amd64" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.10240.0\\ucrt\\x64" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\8.1\\lib\\winv6.3\\um\\x64" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\Mark\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\Mark\\AppData\\Local\\Temp\\cargo-install.cmLJgLe0bggr\\release\\deps\\cargo_script-567f819a739f3787.0.o" "/OUT:C:\\Users\\Mark\\AppData\\Local\\Temp\\cargo-install.cmLJgLe0bggr\\release\\deps\\cargo_script-567f819a739f3787.exe" "/OPT:REF,ICF" "/DEBUG" "/LIBPATH:C:\\Users\\Mark\\AppData\\Local\\Temp\\cargo-install.cmLJgLe0bggr\\release\\deps" "/LIBPATH:C:\\Users\\Mark\\AppData\\Local\\Temp\\cargo-install.cmLJgLe0bggr\\release\\build\\hoedown-d145627f9c181af8\\out" "/LIBPATH:C:\\Users\\Mark\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "uuid.lib" "C:\\Users\\Mark\\AppData\\Local\\Temp\\rustc.ahQjd7f18UMo\\libhoedown-c50d084b9ceee5eb.rlib" "C:\\Users\\Mark\\AppData\\Local\\Temp\\rustc.ahQjd7f18UMo\\libcompiler_builtins-c92942f2c930f53c.rlib" "ole32.lib" "kernel32.lib" "advapi32.lib" "shell32.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "shell32.lib" "msvcrt.lib"
      = note: cargo_script-567f819a739f3787.0.o : error LNK2019: unresolved external symbol __imp_FOLDERID_LocalAppData referenced in function _ZN12cargo_script8platform5inner17get_cache_dir_for17hf2aa87629ba6be63E
              C:\Users\Mark\AppData\Local\Temp\cargo-install.cmLJgLe0bggr\release\deps\cargo_script-567f819a739f3787.exe : fatal error LNK1120: 1 unresolved externals
    

    It also fails to build on stable 1.15.0.

    opened by ark- 10
  • Automatically detect dependencies

    Automatically detect dependencies

    For one-off scripts, it'd be a little more convenient to avoid having to write dependencies twice. Once for the // cargo-deps:, and another for extern crate. Could it perhaps infer // cargo-deps: from extern crate?

    If the name has an underscore (which may or may not be a hyphen), then it could get the canonical name from crates.io.

    opened by Rufflewind 10
  • script -e: Keep temporaries around long enough to print them

    script -e: Keep temporaries around long enough to print them

    For cargo script -e, simply pass the block to println. This allows printing more expressions (those that borrow from temporaries that go out of scope at the end of the statement).

    For example, this makes cargo script -e '[1, 2, 3].iter().max()' compile.

    opened by bluss 6
  • possible cargo-script-run

    possible cargo-script-run

    Hashbang-callable and automatically suppresses cargo compile messages except on compile error. i.e. STDOUT (and stderr) of executing a successfully-compilable script is always just the product of the compiled script's execution.

    This is so for bash, python, etc. scripts which other programs/scripts execute directly and use the stdout, a rust file+cargo-script can be used as a drop-in replacement.

    #!/bin/sh
    # cargo-script-run 
    
    if ! results=`cargo script --build-only $1 2>&1`; then
        echo -e "$results"
        exit 1
    fi
    cargo script $@
    exit 0
    

    OTOH I can see the value of saying "if you're going to be using it as an executable called by other programs, make it into an actual rust project." So it's just an idea.

    opened by nathanross 6
  • Allow running files without any cargo script header or doc comment at the top

    Allow running files without any cargo script header or doc comment at the top

    Allow running files without any cargo script header or doc comment at the top

    The minimal required header is just ///, right now, but it could maybe be even less (nothing)?

    opened by bluss 5
  • Can

    Can "cargo script" be used to run examples from existing projects that require additional heavy dependencies?

    Imagine lightweight project where one of example demonstrate it's use with a heavyweight thing.

    You don't want to point this dependency even in dev-deps, but still want the example to be easily runnable.

    Can cargo script help in this case?

    opened by vi 5
  • Support for Rust 2018 edition

    Support for Rust 2018 edition

    It'd be nice if we could just add this to the embedded manifest and just be good to go, like with normal cargo manifests, once the new edition is out:

    //! ```cargo
    //! edition = "2018"
    //! ...
    //! ```
    
    opened by ErichDonGubler 4
  • bump clap to 2.13.0

    bump clap to 2.13.0

    This version of clap reverts the confusing delimiter behavior that was introduced in 2.0, so --expr and --loop expressions containing commas work again.

    Fixes #28.

    opened by durka 4
  • Allow external Cargo.toml

    Allow external Cargo.toml

    This may seem like a weird request for the nature of this tool, but it would be very useful to be able to use this for scripts in existing cargo projects. (copying assets and such)

    It would also be useful to have this when you have a bunch of scripts and you just want to have the dependencies together in one file.

    opened by LaylBongers 4
  • How do you deal with lack of autocompletion linting?

    How do you deal with lack of autocompletion linting?

    VSCode refuses to show autocompletion, even if I set Rust as a language and it recognizes the syntax. I think it’s because it doesn’t recognize it as a Cargo project.

    Any way to trick the IDE into doing that? Workarounds?

    opened by youCantLose 0
  • Pass flags to cargo (specifically `--offline`)

    Pass flags to cargo (specifically `--offline`)

    Surprisingly, due to cargo checking for dependencies on each run, it is not possible to run scripts when there is no network connection.

    Being able to forward arguments to cargo makes this possible.

    opened by mamins1376 0
  • add support for input from terminal stdin

    add support for input from terminal stdin

    Is it possible to add support for input from terminal stdin like below?

    cargo script <<'EOF'
    // cargo-deps: time
    use time;
    fn main(){
      println!("I'm from stdin! {}", time::now().rfc822z());
    }
    EOF
    

    That way it's very straight forward to experiment in the air without any file storage.

    opened by futurist 0
  • updatet rustc_version version to

    updatet rustc_version version to "0.3.3" and updated build.rs

    A quick fix of "Impossible to install cargo-script #79" after rustc_version version "0.1.7" had been yanked. Updated rustc_version to "0.3.3" and rewrote "build.rs"'s logic in the the new rustc_version.

    opened by dorian-faerber 2
  • Impossible to install cargo-script

    Impossible to install cargo-script

    casie:~/Downloads  ⇢  cargo install --force cargo-script
        Updating crates.io index
      Downloaded cargo-script v0.2.8
      Downloaded 1 crate (50.4 KB) in 1.19s
      Installing cargo-script v0.2.8
    error: failed to compile `cargo-script v0.2.8`, intermediate artifacts can be found at `/var/folders/7x/29hsrskd67bdbb0dqwwt4shc0000gp/T/cargo-installOpbo35`
    
    Caused by:
      failed to select a version for the requirement `rustc_version = "^0.1.7"`
      candidate versions found which didn't match: 0.3.3, 0.3.2, 0.3.1, ...
      location searched: crates.io index
      required by package `cargo-script v0.2.8`
    
    opened by dmilith 1
Releases(v0.1.2)
  • v0.1.2(Aug 20, 2015)

    v0.1.2

    New:

    • Added -e and -l as shorthands for --expr and --loop.
    • Added --dep-extern/-D. This introduces a dependency and causes an appropriate #[macro_use] extern crate $name; item to be added. This only applies to expression and loop scripts.
    • Added --extern/-x. This adds a explicit #[macro_use] extern crate $name item. This only applies to expression and loop scripts.
    Source code(tar.gz)
    Source code(zip)
    cargo-script-0.1.2-i686-pc-windows-gnu.7z(1.01 MB)
  • v0.1.1(Jun 2, 2015)

    v0.1.1

    New:

    • Not-Windows support, contributed by @Ryman (issue #1).
    • Added support for two new embedded manifest formats: short comment manifests and code block manifests. Compared to prefix manifests, these have the advantage of allowing scripts to be valid Rust code, as well as having a measure of self-documentation.
    • You can now pass arguments to scripts. If you want to pass switches, you'll need to add -- after the script name so cargo script knows to stop looking for switches.
    • Added the --clear-cache flag. This deletes all cached scripts. It can be provided by itself or as part of a regular invocation.
    • Added the --pkg-path PATH flag. This lets you specify where to create the Cargo package.
    • Added the --gen-pkg-only flag. This causes cargo script to output a Cargo package, but not attempt to build or run it.

    Changed:

    • Expressions and loop closures are now wrapped in blocks, rather than an expression. This means you can have multiple statements, link to crates, use things, etc. without having to define a block yourself.
    • Expressions now have their output displayed using the {:?} format specifier. This allows more types to work without extra effort, but does make strings a bit ugly.
    • Changed to a not-as-slow argument parser.

    Removed:

    • Removed content hashing for scripts. No longer will even minor changes cause Cargo to go back and re-fetch and re-compile all dependencies! Scripts are cached based on a hash of their absolute path, instead. Expressions and loop closures are still cached based on a content hash.
    Source code(tar.gz)
    Source code(zip)
    cargo-script-0.1.1-i686-pc-windows-gnu.7z(1.00 MB)
Owner
Daniel Keep
Daniel Keep
Dead simple, memoized cargo subcommand to hoist cargo-built binaries into the current working directory, written in Rust.

cargo-hoist Dead simple cargo subcommand to hoist cargo-built binaries into scope. stable Install | User Docs | Crate Docs | Reference | Contributing

refcell.eth 6 Nov 9, 2023
A very simple third-party cargo subcommand to execute a custom command

cargo-x A very simple third-party cargo subcommand to execute a custom command Usage install cargo-x cargo install cargo-x or upgrade cargo install -

刘冲 9 Dec 26, 2022
a cargo subcommand for counting lines of code in Rust projects

cargo-count Linux: A cargo subcommand for displaying line counts of source code in projects, including a niave unsafe counter for Rust source files. T

Kevin K. 125 Dec 1, 2022
A cargo subcommand for checking and applying updates to installed executables

cargo-update A cargo subcommand for checking and applying updates to installed executables Documentation Manpage Installation Firstly, ensure you have

наб 827 Jan 4, 2023
Cargo subcommand `release`: everything about releasing a rust crate.

cargo release Features Ensure you are in a good state for release, including: Right branch Up-to-date with remote Clean tree Supports workspaces using

null 933 Jan 8, 2023
A cargo subcommand that displays ghidra function output through the use of the rizin rz-ghidra project.

cargo-rz-ghidra A cargo subcommand that displays ghidra function output through the use of the rizin rz-ghidra project. Install cargo install --git ht

wcampbell 4 Nov 5, 2022
Cargo subcommand to easily run targets/examples

cargo-select Cargo subcommand to easily run targets/examples/tests Fuzzy match against targets, examples or tests in current rust project. cargo-selec

null 13 Sep 15, 2022
A cargo plugin to shrink cargo's output

cargo single-line A simple cargo plugin that shrinks the visible cargo output to a single line (okay, in the best case scenario). In principle, the pl

Denis 5 Oct 30, 2022
Cargo-eval - A cargo plugin to quickly evaluate some Rust source code.

cargo eval A cargo plugin to quickly evaluate some Rust source code. Installation $ cargo install --git https://github.com/timClicks/cargo-eval.git Us

Tim McNamara 9 Dec 21, 2022
Cargo-about - 📜 Cargo plugin to generate list of all licenses for a crate 🦀

?? cargo-about Cargo plugin for generating a license listing for all dependencies of a crate See the book ?? for in-depth documentation. Please Note:

Embark 281 Jan 1, 2023
comfy is a flexible command script manager / runner written in Rust

comfy is a cross-platform command script manager / runner tool, which allows you to run commands in the command line itself, but being these predefined in a portable and universal .comfy file.

daCoUSB 17 Nov 12, 2021
Replace an app's icon from a png with a single terminal script. Made with Rust

Replace macOS App Icon Replace an app's icon from a png with a single terminal CLI. Made with Rust

Kunal Bagaria 8 Aug 3, 2022
An elegant language for script-kiddies and terminal squatters.

Tonic An elegant language for script-kiddies and terminal squatters. About I started Tonic to complete the Advent of Code 2021. My eventual goal is to

Ryan Chandler 12 Nov 22, 2022
❗️ Small script to view GitHub notifications in the terminal

github-notifications Small script to view GitHub notifications in the terminal Shows and color-codes the notification source, eg if you're the owner o

Brian Shaginaw 1 Jan 10, 2022
Nvm - Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

Node Version Manager Table of Contents Intro About Installing and Updating Install & Update Script Additional Notes Troubleshooting on Linux Troublesh

nvm.sh 63.8k Jan 7, 2023
Write a simple CLI script, that when given a 64-byte encoded string

Write a simple CLI script, that when given a 64-byte encoded string, it finds a suitable 4-byte prefix so that, a SHA256 hash of the prefix combined with the original string of bytes, has two last bytes as 0xca, 0xfe. Script should expect the original content of the string to be passed in hexadecimal format and should return two lines, first being the SHA256 string found and second 4-byte prefix used (in hexadecimal format).

Andy Bell 0 Feb 4, 2022
A Rust-based shell script to create a folder structure to use for a single class every semester. Mostly an excuse to use Rust.

A Rust Course Folder Shell Script PROJECT IN PROGRESS (Spring 2022) When completed, script will create a folder structure of the following schema: [ro

Sebastián Romero Cruz 1 Apr 10, 2022
A small script to facilitate the making of .src.spm.tar.gz packges

SPM-Helper Rust version: Installation PYTHON: install python and git Clone the repo with this command: git clone -b Python https://github.com/Soviet-L

Soviet Linux 3 Jun 24, 2022
A bit like tee, a bit like script, but all with a fake tty. Lets you remote control and watch a process

teetty teetty is a wrapper binary to execute a command in a pty while providing remote control facilities. This allows logging the stdout of a process

Armin Ronacher 259 Jan 3, 2023