diff --git a/AGENTS.md b/AGENTS.md index b618fc3..78a3988 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,15 +1,18 @@ -# LinuxWizards +# AGENTS.md -- Run the `*Wizard.sh` entrypoints from the repo root. They `source ./src/...` with relative paths, so launching them from a subdirectory breaks. -- The top-level scripts are thin wrappers; put shared logic in `src/common.sh` and area-specific logic in `src//*.sh`. -- These entrypoints are not standalone downloads. They depend on the checked-out `src/` tree. -- `src/templates/` is the source for files `repoWizard.sh` copies into new repos. Edit templates, not generated repos, when changing scaffold content. -- `src/repo/agents.sh` and `src/repo/mdtomdc.sh` generate agent-support folders/symlinks. Keep them in sync with any `.agents/rules` changes. -- `aliasWizard.sh` only supports bash/zsh. It copies `src/scripts/.aliases` to `~/.aliases`, appends source blocks to `~/.bashrc` or `~/.zshrc`, and installs helper scripts from `src/scripts/` into `~/bin`. -- If you add or rename helpers under `src/scripts/`, update `aliasWizard.sh` so the installed set stays in sync. -- `gitWizard.sh` creates an `ed25519` SSH key, starts `ssh-agent`, and writes global Git config, including SSH signing when `~/.ssh/id_ed25519.pub` exists. -- `softwareWizard.sh`, `debianWizard.sh`, and `z.sh` are privileged, networked installers. They modify apt state and user config such as `~/.ssh`, `~/.dircolors`, `~/.config/ghostty/config`, `~/.bashrc`, and `~/.zshrc`. -- `debianWizard.sh` re-execs itself with `sudo` when needed and is intended for Debian 13. -- `z.sh` expects MesloLGS Nerd Font for Powerlevel10k. -- `repoWizard.sh` initializes a new repo from the templates, makes an initial `🎉 Project created!` commit, and switches the new repo to `dev`. -- There is no package manager, formatter, or test runner configured here; for shell edits use `bash -n ` and a disposable run of the affected wizard. +## Repo Shape +- Root `*.sh` files are the entrypoints: `softwareWizard.sh`, `gitWizard.sh`, `aliasWizard.sh`, `repoWizard.sh`, `debianWizard.sh`, and `z.sh`. +- Shared code lives in `src/common.sh` and the `src//` folders; scripts source files with repo-relative paths like `./src/common.sh`, so run them from the repository root. +- `repoWizard.sh` is the repo scaffolder. It copies templates from `src/templates/` and can create `.agents/`, `.cursor/`, `.opencode/`, `.claude/`, `.agent/`, and `.github/` support trees depending on the chosen agent target. + +## Commands +- Run a wizard directly from the repo root, for example `./softwareWizard.sh` or `./repoWizard.sh`. +- `repoWizard.sh` makes an initial `git commit -m "🎉 Project created!"` and switches to a new `dev` branch. +- `aliasWizard.sh` writes `~/.aliases`, appends shell source blocks to `~/.bashrc` or `~/.zshrc`, and installs helper scripts into `~/bin`. +- `gitWizard.sh`, `softwareWizard.sh`, `debianWizard.sh`, and `z.sh` make system changes and may require `sudo`. + +## Repo Conventions +- `src/common.sh` is shared utility code and should not be executed directly. +- `NO_COLOR` disables colored output in shared helpers. +- The repo is Bash-only; there is no package manager or test runner to discover here. +- `src/templates/README.md` is a scaffold template, not the project README. diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 120000 index 47dc3e3..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1 +0,0 @@ -AGENTS.md \ No newline at end of file diff --git a/aliasWizard.sh b/aliasWizard.sh index ff7f81f..50d7d14 100755 --- a/aliasWizard.sh +++ b/aliasWizard.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash source ./src/common.sh -source ./src/alias/welcome.sh +source ./src/welcome/welcome_alias.sh ALIAS_SOURCE_BLOCK='if [[ -f ~/.aliases ]]; then . ~/.aliases diff --git a/debianWizard.sh b/debianWizard.sh index 4b11216..a4a7e36 100755 --- a/debianWizard.sh +++ b/debianWizard.sh @@ -12,7 +12,7 @@ root_test(){ fi } -source ./src/deb/welcome.sh +source ./src/welcome/welcome_deb.sh set_timezone(){ dots "Setting timezone to America/Mexico_City" diff --git a/gitWizard.sh b/gitWizard.sh index b7175e6..7e8d587 100755 --- a/gitWizard.sh +++ b/gitWizard.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash source ./src/common.sh -source ./src/git/welcome.sh +source ./src/welcome/welcome_git.sh # Global variables git_username="" diff --git a/repoWizard.sh b/repoWizard.sh index eda4e87..422ccdb 100755 --- a/repoWizard.sh +++ b/repoWizard.sh @@ -3,7 +3,7 @@ WIZARD_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source ./src/common.sh -source ./src/repo/welcome.sh +source ./src/welcome/welcome_repo.sh source ./src/repo/devcontainer.sh source ./src/repo/agents.sh diff --git a/softwareWizard.sh b/softwareWizard.sh index c8f6a49..f2ee05e 100755 --- a/softwareWizard.sh +++ b/softwareWizard.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash source ./src/common.sh -source ./src/software/welcome.sh +source ./src/welcome/welcome_software.sh install_packages() { dots "Installing essential APT packages" diff --git a/src/scripts/.aliases b/src/scripts/.aliases index d5c010e..1d31d54 100644 --- a/src/scripts/.aliases +++ b/src/scripts/.aliases @@ -51,10 +51,10 @@ alias untar='tar -xf' # Docker shortcuts alias dc='docker' alias dcu='docker compose up -d' +alias dcd='docker compose down' alias dci='docker images' -alias dcps='docker ps' -alias dcpsa='docker ps -a' -alias dcrm='docker rm' +alias dcps='docker ps -a' +alias dcrm='docker rm -f' alias dcrmi='docker rmi' alias dockerclean='docker system prune -a --volumes' @@ -92,14 +92,15 @@ alias gitunstage='git reset HEAD --' alias gitrepair='sudo chown -R "$(whoami)":"$(id -gn)" .git' alias gitlocal='git config --local commit.gpgsign false' alias cleanremote='git fetch origin --prune' -alias deleteremote ='git push origin --delete' +alias deleteremote='git push origin --delete' # AI Agents alias cld='claude' alias ocd='opencode' # Miscellaneous -alias h='history' alias rootrc='code .bashrc --no-sandbox --user-data-dir' alias rootzrc='code .zshrc --no-sandbox --user-data-dir' -alias rootaliases='code .aliases --no-sandbox --user-data-dir' \ No newline at end of file +alias rootaliases='code .aliases --no-sandbox --user-data-dir' +alias h='history' +search() { history | grep "$1" | tail -n 10; } \ No newline at end of file diff --git a/src/scripts/search b/src/scripts/search deleted file mode 100644 index b1f063a..0000000 --- a/src/scripts/search +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -e - -read -erp "Command to search?: " msg - -if [[ -z "$msg" ]]; then - printf '%s\n' "Search cancelled, empty message" - exit 1 -fi - -case "$SHELL" in - */zsh) grep -aF -- "$msg" "${HISTFILE:-$HOME/.zsh_history}" | sed 's/^: [0-9]*:[0-9]*;//' ;; - *) grep -F -- "$msg" "${HISTFILE:-$HOME/.bash_history}" ;; -esac diff --git a/src/templates/README.md b/src/templates/README.md index 8c9f1a1..420f4d2 100644 --- a/src/templates/README.md +++ b/src/templates/README.md @@ -1 +1 @@ -# New Project \ No newline at end of file +# New Project diff --git a/src/alias/welcome.sh b/src/welcome/welcome_alias.sh similarity index 100% rename from src/alias/welcome.sh rename to src/welcome/welcome_alias.sh diff --git a/src/deb/welcome.sh b/src/welcome/welcome_deb.sh similarity index 100% rename from src/deb/welcome.sh rename to src/welcome/welcome_deb.sh diff --git a/src/git/welcome.sh b/src/welcome/welcome_git.sh similarity index 100% rename from src/git/welcome.sh rename to src/welcome/welcome_git.sh diff --git a/src/repo/welcome.sh b/src/welcome/welcome_repo.sh similarity index 100% rename from src/repo/welcome.sh rename to src/welcome/welcome_repo.sh diff --git a/src/software/welcome.sh b/src/welcome/welcome_software.sh similarity index 100% rename from src/software/welcome.sh rename to src/welcome/welcome_software.sh diff --git a/src/zsh/welcome.sh b/src/welcome/welcome_zsh.sh similarity index 100% rename from src/zsh/welcome.sh rename to src/welcome/welcome_zsh.sh diff --git a/z.sh b/z.sh index 135a799..c03c853 100755 --- a/z.sh +++ b/z.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash source ./src/common.sh -source ./src/zsh/welcome.sh +source ./src/welcome/welcome_zsh.sh ghostty_configs() { if command_exists ghostty; then dots "Adding ghostty configs" - printf '%s\n' "theme = Homebrew" >> ~/.config/ghostty/config + printf '%s\n' "theme = Vercel" >> ~/.config/ghostty/config printf '%s\n' "bell-features = no-title,no-attention" >> ~/.config/ghostty/config printf '%s\n' "shell-integration-features = ssh-env" >> ~/.config/ghostty/config return 0 @@ -17,20 +17,6 @@ ghostty_configs() { fi } -set_colors() { - dots "Setting custom dircolors" - - cat > ~/.dircolors <<'EOF' - # Directories (More contrast than blue) - DIR 01;36 - # Symlinks and executables (optional) - LINK 01;35 - EXEC 01;32 -EOF - -return 0 -} - install_zsh() { dots "Installing zsh shell" sudo apt-get install -y zsh @@ -78,8 +64,6 @@ finish_setup() { main() { welcome ghostty_configs - set_colors - update_system install_zsh setup_zsh_theme activate_zsh