百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pier

> 开发工具
开源

一个 CLI 用于组织和运行短 Unix 命令行脚本

596 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个 CLI 用于组织和运行短 Unix 命令行脚本

pier ~ A CLI to organize and run short Unix shell scripts

A central repository to manage all your one-liners, scripts, tools, and CLIs. Add, remove, list, and run scripts - storing metadata to easily find them later. No more digging through your bin folder...

Description

If you've spent any amount of time in the terminal you no doubt have built up a lovely collection of one-liners, scripts, useful tools, and CLIs. Whenever you want to use them you dig through your bin folder trying to remember what you called the script... Linux users love hard-to-remember naming conventions.

Scripts should be first-class citizens. In a GUI world we can find our programs using a menu of sorts. In the terminal scripts get lost.

The idea behind pier is to create a central repository for all your scripts, and provide a way to attach metadata about these scripts. Using pier you can add, remove, list, and run scripts. These can be managed by pier in a human-readable TOML config, or you can use it to catalog existing scripts that you may have lying around - you'd then simply add the metadata for the specific script, and attach it to the name in the PATH.

Installation

From Crates.io: cargo install pier

From GitHub release: simply download the release binary

Using Nix package manager:

  1. From GitHub release: make install or nix-env -if derivation.nix
  2. From source: update src in derivation to ./.

Recent Breaking Changes

Version 0.1.4:

The configuration variable default_interpreter has been removed:

toml
default_interpreter = ["foorunner", "-c"]

So when upgrading from to 0.1.4 from an earlier version you will need to instead specify the variable in this format:

toml
[default]
interpreter = ["foorunner", "-c"]

Operation

Use pier --help to display help on commandline or see src/cli.rs for a more detailed spec.

…
  • pier list
  • pier add "ip link set wlp58s0 down && sleep 5 && ip link set wlp58s0 up" --alias refresh-wifi
  • pier refresh-wifi

Example pier TOML config

toml
[scripts.refresh-wifi]
command = "ip link set wlp58s0 down && sleep 5 && ip link set wlp58s0 up"

[scripts.twa-analyze]
command = "docker run --rm -t trailofbits/twa -vw"
tags = [ "infosec" ]

[scripts.enabled-services]
command = "systemctl list-unit-files --state=enabled"

[scripts.flush-docker]
command = "docker container stop $(docker container ls -a -q) && docker system prune -a -f --volumes"
description = "A script to clear out old Docker containers and images"
tags = [ "docker", "flush" ]

Example pier list output

…

Execute pier scripts in any interpreted languages

Scripts starting with a shebang #! will be run with the specified interpeter just like it would in a normal script. Pier does this by creating a temp file from your script, executing it and then finally cleaning the file up. This allows you to write your pier script in python, node.js etc. even compiled languages can be run if using something like scriptisto.

Shebang example config

[scripts.run_rust_script]
command = '''
#!/usr/bin/env scriptisto

// scriptisto-begin
// script_src: src/main.rs
// build_cmd: cargo build --release && strip ./target/release/script
// target_bin: ./target/release/script
// files:
//  - path: Cargo.toml
//    content: |
//     package = { name = "script", version = "0.1.0", edition = "2018"}
//     [dependencies]
// scriptisto-end

fn main() {
    println!("This is a rust script!");
}

'''

[scripts.run_python]
command = '''
#!/usr/bin/env python3
import sys

print("Running python with version {}".format(sys.version))

'''

Setting the default shell / interpreter

By default if no shebang is specified pier will try to use your default shell to execute the script inline. This can be overwritten with the variable interpreter. It needs to be a list with the first item being the binary and the rest is any flags necessary.

Default interpreter example config

# Sets the default interpreter, the first item in the list should be the binary and the rest are the arguments for the interpreter cli option.
[default]
interpreter = ["node", "-e"]

# Runs as the fallback interpreter nodejs as it's lacking a shebang
[scripts.hello_world_nodejs]
command = '''
console.log("Hello world!")

'''

# This will be run as a posix sh script as it has a shebang
[scripts.a_shell_script]
command = '''
#!/bin/sh

nohup st > /dev/null 2>&1&

'''

Origin

Originally intended as a way to manage Docker one-liners, the name pier continues along the same maritime theme. I realized Pier can manage a lot more than just Docker scripts.

Roadmap to v1.0.0

  • Fuzzy search + autocomplete e.g. prompts for alias
  • Complete base features: mv, tag
  • Rework testing
  • Update documentation e.g. contributor guidelines, templates

Star History

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustclislinuxrusttools

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具