#script #tool #hyper #query #template #lovers #scripter

bin+lib hyper-scripter

脚本爱好者的脚本管理工具

22 个版本

0.7.5 2024年4月18日
0.7.1 2023年10月3日
0.6.8 2022年12月23日
0.6.1 2022年6月18日
0.3.3 2020年11月9日

#747命令行工具

Download history 40/week @ 2024-04-19 3/week @ 2024-04-26 8/week @ 2024-05-17 2/week @ 2024-05-24 8/week @ 2024-05-31 10/week @ 2024-06-07 9/week @ 2024-06-14 12/week @ 2024-06-21 2/week @ 2024-06-28 66/week @ 2024-07-05 53/week @ 2024-07-26 8/week @ 2024-08-02

每月61次下载

MIT/Apache

375KB
11K SLoC

Rust 10K SLoC // 0.0% comments Ruby 1K SLoC // 0.1% comments SQL 34 SLoC

脚本爱好者的(过度杀戮)脚本管理工具。

demo

安装

caargo install hyper-scripter

快速开始

hs edit # edit whatever you want in editor
hs -    # run the newest script, and voila!

主要功能

全局管理您的脚本

使用更少的按键查找您的脚本

hs 支持两种查找脚本的方式: 模糊搜索时间相关搜索搜索

按标签和命名空间组织您的脚本

可追溯

如何使用

USAGE:
    hyper-scripter [FLAGS] [OPTIONS] [SUBCOMMAND]

FLAGS:
    -a, --all         Shorthand for `-s=all,^remove`
    -h, --help        Prints help information
        --no-alias
        --timeless    Show scripts of all time.
    -V, --version     Prints version information

OPTIONS:
    -s, --select <select>      Select by tags, e.g. `all,^mytag`
    -H, --hs-home <hs-home>    Path to hyper script home
        --recent <recent>      Show scripts within recent days.

SUBCOMMANDS:
    alias    Manage alias
    cat      Print the script to standard output
    cp       Copy the script to another one
    edit     Edit hyper script
    help     Prints this message, the help of the given subcommand(s), or a script's help message.
    ls       List hyper scripts
    mv       Move the script to another one
    rm       Remove the script
    run      Run the script
    tags     Manage script tags. If a tag selector is given, set it as default, otherwise show tag information.
    which    Execute the script query and get the exact file

自定义 hyper-scripter

您可以在 ~/.config/hyper_scripter/.config.toml 找到配置文件。以下是一个示例

# Filter out scripts within recent days.
recent = 999999

# Alias you may find handy
[alias.la]
after = ['ls', '-a']
[alias.gc]
after = ['rm', '-s', 'remove', '*']

# ...
# Type and tag selectors will be discussed later

类型和模板

您可以在此处添加自己的脚本类型。例如,您可能希望使用 irb 运行 ruby 脚本,而不是简单地使用 ruby。以下是实现此功能的方法

# Type and templates
[categories.irb]
ext = 'rb' # file extensions is same as any ruby scripts.
color = 'bright red' # colors shown in `hs ls` and other places.
# tmplate is powred by handlebars
template = [
    '# Hello, scripter!',
    '''Dir.chdir("#{ENV['HOME']}/{{birthplace_rel}}")''',
    "NAME = '{{name}}'",
    '',
    'def {{name}}',
    '    {{#each content}}{{{this}}}',
    '    {{/each}} ',
    'end'
]
# the exact program you want to run scripts with
cmd = 'irb'
# arguments are also templates
args = ['-r', '{{path}}']
# environment variables
env = []

高级主题

标签选择器

脚本查询

bang!

列表查询

依赖

~59MB
~1M SLoC