Recommended command line tools for rust implementation

Time:2021-11-30

Command line tools implemented by rust

As the rust ecosystem becomes more and more prosperous, more and more gadgets are implemented using rust. Here are four tools I think are good after trying

starship

starshipIs a beautification tool similar to oh my Zsh, and it also supports Bash and fish.

Recommended command line tools for rust implementation

It has many features, but my favorite is the customizable and informative git branch and workspace information, the current workspace project version information and background task tips.
For more features, please refer tofile

Its installation and configuration are also very simple.

First of all, you need to install a powerline font. All the fonts that have been used oh-my-zsh should be installed. If not, you can tryFira Code

Then install starship. Homebrew can be used on Mac

brew install starship

If rust 1.33 + is installed on the machine, it can also be usedcargo installInstallation.

#PKG config and libssl dev are required
sudo apt install -y pkg-config libssl-dev

cargo install starship

You can also download the compiled file directly

curl -L https://github.com/starship/starship/releases/download/v0.13.1/starship-v0.13.1-x86_64-unknown-linux-gnu.tar.gz -o /tmp/starship.tar.gz

cd /tmp && tar zxvf /tmp/starship.tar.gz

mv x86_64-unknown-linux-gnu/starship /usr/local/bin/starship

Then in.zshrcAdd the following

eval $(starship init zsh)

The configuration file for starship defaults to~/.config/starship.toml, my sample configuration file is as follows:

add_newline = false

[package]
disabled = true

[character]
symbol = "➜"
error_symbol = "✗"
use_symbol_for_status = true

[git_branch]
symbol = "? "

[golang]
symbol = "G "

[line_break]
disabled = true

[python]
pyenv_version_name = false
pyenv_prefix = "foo "

[rust]
symbol = "⚙️ "

Full configuration item interpretation referencestarship configuration

bat

batIt is a substitute for cat commands. Although it is a substitute for simple commands such as cat, bat’s star on GitHub project has been 15009. It can be seen that everyone loves bat.

Compared with cat, bat adds many features such as syntax highlighting and git integration. And there are detailedChinese documents
I won’t repeat how to install and use it, just put a GIF as a reference.

Recommended command line tools for rust implementation

ffsend

Firefox has launched a free burn after read encrypted file sharing servicefirefox send, you can upload the file, set the file saving time and the number of times it can be downloaded, and then download the file
Share links with others to share files. The maximum upload size of 2.5G files is very useful when sharing small files without being limited by Baidu cloud.

ffsendIs a command line tool that uses the Firefox send service. It allows you to upload and download files from the command line.

At present, ffsend is still in the alpha stage, and the download methods are limited. The simplest way is

cargo install ffsend

For other installation methods, please refer to ffsend’s documentation.

The usage of ffsend is also very simple

#Upload file
ffsend upload my-file.txt
https://send.firefox.com/#sample-share-url

#More upload parameter settings
#- up to 20 Downloads
#- enter the password to encrypt the uploaded file
#- archive files before uploading
#- copy the sharing link to the clipboard
#- open sharing link in browser
$ ffsend upload --downloads 20 --password --archive --copy --open my-file.txt
Password: ******
https://send.firefox.com/#sample-share-url

procs

procsyespsAn alternative to the order. Compared with PS various parameter options, procs is relatively simple, the information display is more intuitive, and syntax highlighting is added.

The installation method is as follows:

# homebrew
sudo brew install procs

#Cargo installation
cargo install procs

The procs command without parameters shows all processes.

procs

Recommended command line tools for rust implementation

If you want to display all the processes of a user, it is also very simple

procs rookie

More and more complex usages can be found in the readme of the project, which will not be repeated here.

This work adoptsCC agreement, reprint must indicate the author and the link to this article

How many things are never urgent. Heaven and earth turn, time is pressing.