bash-script-framework

Create organized bash script structure with color output, menu systems, error handling, and cross-platform support. Standardizes CLI tooling.

5 stars

Best use case

bash-script-framework is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Create organized bash script structure with color output, menu systems, error handling, and cross-platform support. Standardizes CLI tooling.

Teams using bash-script-framework should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/bash-script-framework/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/_core/bash/bash-script-framework/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/bash-script-framework/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How bash-script-framework Compares

Feature / Agentbash-script-frameworkStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Create organized bash script structure with color output, menu systems, error handling, and cross-platform support. Standardizes CLI tooling.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Bash Script Framework

## Quick Start

```bash
# Create script directory structure
/bash-script-framework init

# Create new script with menu
/bash-script-framework new my-script --menu

# Add to existing scripts directory
/bash-script-framework add utility-script
```

## When to Use

**USE when:**
- Creating CLI tools for repository
- Building menu-driven automation
- Standardizing script organization
- Cross-platform script development

**DON'T USE when:**
- Python script is more appropriate
- Simple one-liner needed
- Windows-only environment

> For Windows/Git Bash-compatible scripts, see `_core/bash/cross-platform-compat`.

## Prerequisites

- Bash 4.0+
- Unix-like environment (Linux, macOS, WSL)

## Overview

Creates organized bash scripts following workspace-hub patterns:

1. **Color utilities** - Consistent terminal output
2. **Menu systems** - Multi-level navigation
3. **Error handling** - Proper exit codes
4. **Logging** - Timestamped output
5. **Cross-platform** - Linux/macOS/WSL support

## Directory Structure

```
scripts/
├── workspace                  # Main entry point
├── lib/
│   ├── colors.sh             # Color definitions
│   ├── logging.sh            # Logging utilities
│   ├── menu.sh               # Menu system
│   └── utils.sh              # General utilities
├── bash/
│   ├── git/                  # Git operations
│   └── dev/                  # Development tools
├── python/                   # Python utilities
└── powershell/               # Windows scripts
```

## Core Templates

### 1. Color Library (lib/colors.sh)

```bash
#!/bin/bash
# lib/colors.sh - Color definitions for terminal output
# Source this file: source lib/colors.sh

# Reset
NC='\033[0m'              # No Color / Reset

# Regular Colors
BLACK='\033[0;30m'

*See sub-skills for full details.*
### 2. Logging Library (lib/logging.sh)

```bash
#!/bin/bash
# lib/logging.sh - Logging utilities
# Source this file after colors.sh

# Log levels
LOG_LEVEL_DEBUG=0
LOG_LEVEL_INFO=1
LOG_LEVEL_WARN=2
LOG_LEVEL_ERROR=3

*See sub-skills for full details.*
### 3. Menu System (lib/menu.sh)

```bash
#!/bin/bash
# lib/menu.sh - Menu system utilities
# Source after colors.sh

# Display menu and get selection
show_menu() {
    local title="$1"
    shift
    local options=("$@")

*See sub-skills for full details.*
### 4. Utilities (lib/utils.sh)

```bash
#!/bin/bash
# lib/utils.sh - General utilities

# Check if command exists
command_exists() {
    command -v "$1" &> /dev/null
}

# Check required commands

*See sub-skills for full details.*
### 5. Main Script Template

```bash
#!/bin/bash
# scripts/my-tool - Main entry point
# Description: Tool description here

set -e  # Exit on error

# Get script directory and load libraries
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/lib/colors.sh"

*See sub-skills for full details.*

## Related Skills

- [python-project-template](../python-project-template/SKILL.md) - Python CLI tools
- [yaml-workflow-executor](../yaml-workflow-executor/SKILL.md) - YAML-driven execution

## References

- [Bash Reference Manual](https://www.gnu.org/software/bash/manual/)
- [workspace-hub CLI Standards](../../../docs/modules/cli/WORKSPACE_CLI.md)

---

## Version History

- **1.0.0** (2026-01-14): Initial release - bash script framework with colors, menus, logging, and utilities

## Sub-Skills

- [Example 1: Create New CLI Tool (+1)](example-1-create-new-cli-tool/SKILL.md)
- [Best Practices](best-practices/SKILL.md)

Related Skills

agent-os-framework

5
from vamseeachanta/workspace-hub

Generate standardized .agent-os directory structure with product documentation, mission, tech-stack, roadmap, and decision records. Enables AI-native workflows.

bash-pipefail-grep-error-handling

5
from vamseeachanta/workspace-hub

Handle grep exit codes safely under set -eo pipefail by isolating pipeline failure scope

webhook-subscriptions

5
from vamseeachanta/workspace-hub

Create and manage webhook subscriptions for event-driven agent activation. Use when the user wants external services to trigger agent runs automatically.

shell-script-hardening-patterns

5
from vamseeachanta/workspace-hub

Harden Bash automation scripts with TDD-first static and behavioral checks, safe Python invocation via uv, locking, persistent state, and review-driven correction loops.

bash-script-framework-example-1-create-new-cli-tool

5
from vamseeachanta/workspace-hub

Sub-skill of bash-script-framework: Example 1: Create New CLI Tool (+1).

bash-cli-framework-5-error-handling

5
from vamseeachanta/workspace-hub

Sub-skill of bash-cli-framework: 5. Error Handling (+1).

bash-cli-framework-1-color-definitions

5
from vamseeachanta/workspace-hub

Sub-skill of bash-cli-framework: 1. Color Definitions (+3).

raycast-alfred-3-alfred-workflows-applescript

5
from vamseeachanta/workspace-hub

Sub-skill of raycast-alfred: 3. Alfred Workflows - AppleScript.

raycast-alfred-2-raycast-typescript-extensions

5
from vamseeachanta/workspace-hub

Sub-skill of raycast-alfred: 2. Raycast TypeScript Extensions.

raycast-alfred-1-raycast-script-commands

5
from vamseeachanta/workspace-hub

Sub-skill of raycast-alfred: 1. Raycast Script Commands.

docker-6-development-workflow-scripts

5
from vamseeachanta/workspace-hub

Sub-skill of docker: 6. Development Workflow Scripts.

cli-productivity-3-interactive-script-template

5
from vamseeachanta/workspace-hub

Sub-skill of cli-productivity: 3. Interactive Script Template.