#script #command #directory #rs-script

app rs-script

A tool to create and edit single-file Rust scripts

20 releases

Uses new Rust 2024

new 0.2.22 May 9, 2025
0.2.21 May 3, 2025
0.2.20 Apr 30, 2025

#23 in Configuration

Download history 252/week @ 2025-04-09 892/week @ 2025-04-16 369/week @ 2025-04-23 559/week @ 2025-04-30

2,072 downloads per month

MIT/Apache

1.5MB
1.5K SLoC

RS-Script

Stores all the files and the built binary of a Rust project in a single file allowing similar usage to Python scripts.

Installation

cargo install rs-script

Config

A large number of commands will not work if you don't have an editor configured in the config file!

  • Find the config file: rss config -w

You will need to manually edit this file if you don't have the default editor

  • Modify the config with: rss config

This uses the editor configured in the config file

Example nvim configuration:

"rust_project_edit_command_blocking": {
    "command": "nvim",
    "args": [
      "$dir$"
    ],
    "inherit_shell": true
}
  • Reset the config file: rss config -r

Editing

rss edit myfile.rss

A cr-origin.sh/cr-origin.cmd script will automatically be created allowing you to cargo run in the original directory for ease of development.

Running

rss run myfile.rss

Cross Compatability

The platform a binary was compiled for is automatically saved. Should this not match the current platform, the file will be automatically recompiled.

Other Commands

  • Remove the compiled binary part of a file: rss strip myfile.rss
  • Recompile a file: rss recompile myfile.rss
  • Extract the Rust source from an rss file: rss extract myfile.rss
  • Create an rss file from an existing rust project: rss pack project_dir
  • Print statistics for an rss file: rss stats myfile.rss
  • Print the file tree within an rss file: rss tree myfile.rss
  • Print the contents of a file / files within an rss file: rss cat myfile.rss
  • Read this README: rss readme
  • Command help: rss help

Dependencies

~10–21MB
~310K SLoC