diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..f9601b4 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,14 @@ +name: Validate framework + +on: + push: + branches: [master] + pull_request: + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run validation gate + run: bash tests/validate.bash diff --git a/.gitignore b/.gitignore index d27b3fa..909800c 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,6 @@ modules/docker/apache/images/*.png # Ignore everything in aliases/ core/shells/bash/aliases/* ## But not this file -!core/shells/bash/aliases/.aliases \ No newline at end of file +!core/shells/bash/aliases/.aliases +# myshell machine-local state (menu enable/disable bookkeeping) +.module_state/ diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000..dfae473 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,10 @@ +# shellcheck configuration - directive syntax only (https://www.shellcheck.net/wiki/Directive) +# Note: shellcheck cannot exclude files from an rc file; to skip a file, +# add "# shellcheck disable=all" below its shebang or omit it from the CLI invocation. + +# Extension-less profile/dot-files (.appearance, .aliases, ...) have no shebang; +# treat everything as bash. +shell=bash + +# Allow following source statements to files outside the checked file's directory +external-sources=true diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..6ec5f41 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,137 @@ +# myshell — agent guide (repo root) + +myshell is a personal bash framework: a `.bashrc` loader that sources functions, aliases +and profiles from this repo, plus self-contained "modules" (mostly docker compose stacks) +launched through aliases. Everything is bash; there is no build step. + +**Before editing under `core/shells/bash/`, read `core/shells/bash/AGENTS.md`. +Before editing under `modules/`, read `modules/AGENTS.md`.** + +## How the framework loads (the one chain that explains everything) + +``` +~/.bash_profile (machine file, NOT in repo) + └─ exports project_path=$HOME/Documents/myshell + └─ sources core/shells/bash/.bashrc, which: + 1. runs core/shells/bash/jobs/public_ip.bash in background + 2. sources core/shells/bash/functions/*.bash (explicit if-blocks, one per file) + 3. sources EVERY file in core/shells/bash/aliases/ (glob loop) + 4. sources core/shells/bash/profiles/.* (explicit if-blocks, one per file) +``` + +Module scripts are executed as `bash