agentleFS
Bash-itBash-it/bash-it/CLAUDE.md

bash-it

CLAUDE.md15k starsChanged 13 months agoMITView on GitHub

Bash-it is a collection of community Bash commands and scripts for Bash 3.2+, providing a framework for aliases, themes, plugins, and completions. It's structured as a modular system where components can be individually enabled or disabled. The project uses a gradual pre-commit system implementation via clean_files.txt allow-list: Gradual Linting System: - cleanfiles.txt: Allow-list of files/directories that pass all linting rules - lintcleanfiles.sh: Runs pre-commit hooks only on allow-listed files - When modifying files NOT in cleanfiles.txt, ensure they pass linting…

  • Commits and pushes

We split this CLAUDE.md into the rules it gives an agent

14 rules. About 0 are common, 7 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When modifying files NOT in clean_files.txt, ensure they pass linting before adding them to the allow-list

    line 69
  2. Very specific:

    Before creating a PR, add newly cleaned files to clean_files.txt to expand coverage

    line 70
  3. Very specific:

    Always create a feature branch for new work: git checkout -b feature/feature-name

    line 114
  4. Distinctive:

    Keep feature branches focused on a single issue/feature

    line 115
  5. Distinctive:

    Create separate branches for separate features

    line 116
  6. Very specific:

    Use --force-with-lease for rebased branches

    line 119
  7. Very specific:

    Use composure metadata: about, group, author, example

    line 122
  8. Very specific:

    Follow naming convention: {name}.{type}.bash

    line 123
  9. Distinctive:

    Test components before submitting

    line 124
  10. Distinctive:

    Use BATS framework for shell script testing

    line 129
  11. Very specific:

    Test files follow pattern: {component}.bats

    line 130
  12. Distinctive:

    Use shellcheck for linting

    line 133
  13. Distinctive:

    Follow existing code style in the repository

    line 134
  14. Distinctive:

    Add appropriate metadata using composure functions

    line 135

≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Bash-it is a collection of community Bash commands and scripts for Bash 3.2+, providing a framework for aliases, themes, plugins, and completions. It's structured as a modular system where components can be individually enabled or disabled.

Architecture

Core Components

  • bash_it.sh: Main entry point that initializes the framework
  • lib/: Core libraries providing utilities, logging, helpers, and appearance functions
  • scripts/reloader.bash: Component loader that sources enabled components
  • install.sh: Installation script with interactive and silent modes
  • enabled/: Symlinks to active components from available/ directories

Component Types

  1. Aliases (aliases/available/): Command shortcuts and convenience functions
  2. Plugins (plugins/available/): Extended functionality and integrations
  3. Completions (completion/available/): Tab completion definitions
  4. Themes (themes/): Prompt customizations and visual styles

Loading Order

  1. Libraries (except appearance)
  2. Global enabled directory
  3. Enabled aliases, plugins, completions
  4. Theme files (if BASH_IT_THEME is set)
  5. Custom files from BASH_IT_CUSTOM directory

Development Commands

Testing

# Run all tests using BATS (Bash Automated Testing System)
test/run

# Run specific test suites
test/run test/bash_it test/completion test/plugins

# Tests require git submodules to be initialized
git submodule init && git submodule update

Linting and Code Quality

The project uses a gradual pre-commit system implementation via clean_files.txt allow-list:

# Run pre-commit hooks only on allow-listed clean files
./lint_clean_files.sh

# Run pre-commit hooks on all files (for testing new coverage)
pre-commit run --all-files

# Manual shellcheck on bash files
shellcheck **/*.bash

# Format shell scripts
shfmt -w **/*.bash

Gradual Linting System:

  • clean_files.txt: Allow-list of files/directories that pass all linting rules
  • lint_clean_files.sh: Runs pre-commit hooks only on allow-listed files
  • When modifying files NOT in clean_files.txt, ensure they pass linting before adding them to the allow-list
  • Before creating a PR, add newly cleaned files to clean_files.txt to expand coverage
  • This system allows gradual improvement of code quality across the large codebase

Vendor Directory Policy:

  • Files in vendor/ are treated as immutable external dependencies
  • Pre-commit hooks exclude vendor files via .pre-commit-config.yaml global exclude pattern
  • clean_files.txt does not include vendor shell scripts, only .gitattributes
  • CI and local linting will skip vendor files entirely

Component Management

# Enable/disable components
bash-it enable alias git
bash-it enable plugin history
bash-it enable completion docker

# Show available components
bash-it show aliases
bash-it show plugins  
bash-it show completions

# Search components
bash-it search docker

Key Configuration

Environment Variables

  • BASH_IT: Base directory path
  • BASH_IT_THEME: Active theme name
  • BASH_IT_CUSTOM: Custom components directory
  • BASH_IT_LOG_PREFIX: Logging prefix for debug output

File Structure Conventions

  • Available components: {type}/available/{name}.{type}.bash
  • Enabled components: {type}/enabled/{name}.{type}.bash (symlinks)
  • Custom components: custom/{name}.bash
  • Themes: themes/{name}/

Development Guidelines

Git Workflow

  • NEVER commit directly to master branch
  • Master should always stay in sync with origin/master
  • Always create a feature branch for new work: git checkout -b feature/feature-name
  • Keep feature branches focused on a single issue/feature
  • Create separate branches for separate features
  • Push feature branches with upstream tracking: git push -u fork feature-branch-name
    • This allows manual pushes later with just git push
    • Use --force-with-lease for rebased branches

Component Development

  • Use composure metadata: about, group, author, example
  • Follow naming convention: {name}.{type}.bash
  • Test components before submitting
  • Components should be modular and not conflict with others

Testing Components

  • Each component type has dedicated test files in test/
  • Use BATS framework for shell script testing
  • Test files follow pattern: {component}.bats

Code Standards

  • Use shellcheck for linting
  • Follow existing code style in the repository
  • Add appropriate metadata using composure functions
  • Components should handle missing dependencies gracefully
  • Prefix sensitive commands with command to bypass user aliases:
    • command mv instead of mv (users may have alias mv='mv -i')
    • command grep instead of grep (users may have custom grep flags)
    • command rm instead of rm (users may have alias rm='rm -i')
    • Apply to any command that could be aliased and break core functionality
    • This prevents surprises from user's alias configurations in bash-it core functions
  • Use parameter expansion with default for potentially unset variables:
    • ${VARIABLE-} instead of $VARIABLE when variable may be unset
    • Prevents errors when set -u is active in user's shell
    • Examples: ${BASH_VERSION-}, ${HOME-}, ${PATH-}
    • Critical for variables checked in conditionals: if [ -n "${BASH_VERSION-}" ]
    • This defensive practice ensures scripts work regardless of user's shell options

Project Planning & Roadmaps

Strategic planning documents are maintained in docs/plans/:

  • Quick Reference - TL;DR summary of current issues and action items
  • Comprehensive Issue Analysis - Detailed breakdown of all open issues with categorization and recommendations
  • 2025 Roadmap - 6-month technical debt reduction plan with phases and success metrics

These documents guide ongoing maintenance, issue triage, and code quality improvements.

Download now (ZIP)

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the Bash-it/bash-it repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about Bash-it/bash-it

The biggest 5 of 62 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 62

Talked about on GitHub, YouTube, Stack Overflow, Hacker News and the web (62 times).

On GitHub · 50

45 more on GitHub

On Hacker News · 2

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.