Skip to content
Back to skills

Bash Completions

BSecurity

Instructions for adding to bash auto completions in the AutomateLinux project.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
toolsbash

Works with

  • terminal

Security analysis

B88/100
  • criticalModifies startup scripts or system services for persistence

Pro shows the line behind each finding and how to fix it

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill bash-completions --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bash Completions?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Bash Completions
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-bash-completions/badge)](https://www.skillsdirectory.com/skills/david-li0406-bash-completions)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
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
```bash
_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:

```bash
# 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`:

```bash
sb  # Shorthand for sourcing ~/.bashrc
```

## Existing Examples
For more complex logic (like handling sub-commands or dynamic arguments), refer to:
- [daemon.bash](file:///home/yaniv/coding/automateLinux/terminal/completions/daemon.bash): Handles `d` and `daemon` commands.
- [cd.bash](file:///home/yaniv/coding/automateLinux/terminal/completions/cd.bash): Handles directory history navigation.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…