スキル一覧に戻る
yanivprusman

bash-completions

by yanivprusman

0🍴 0📅 2026年1月25日
GitHubで見るManusで実行

SKILL.md


name: bash-completions description: Instructions for adding to bash auto completions in the AutomateLinux project.

Bash Auto-Completions

This project uses a modular system for bash auto-completions. Each major command has its own completion script located in ./terminal/completions/.

1. Create the Completion Script

Create a new .bash file in the ./terminal/completions/ directory.

Basic Template

_my_command_completion() {
    local cur prev
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"

    # Define words to complete
    local opts="start stop restart status"

    if [[ ${cur} == * ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        return 0
    fi
}

complete -F _my_command_completion my_command

2. Register the Script

All completion scripts must be explicitly sourced in ./terminal/completions/completion.sh to be active in the terminal.

Add a line to source your new file:

# In ./terminal/completions/completion.sh
. $(theRealPath my_new_completion.bash)

[!NOTE] The theRealPath utility ensures the script is sourced correctly regardless of the current working directory.

3. Apply Changes

To see your new completions in action, either open a new terminal or source your bashrc:

sb  # Shorthand for sourcing ~/.bashrc

Existing Examples

For more complex logic (like handling sub-commands or dynamic arguments), refer to:

  • daemon.bash: Handles d and daemon commands.
  • cd.bash: Handles directory history navigation.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です