ββββββ ββββββ ββββββββ βββββββ
ββ ββ ββ ββ ββ ββ
ββ ββ ββ ββ ββ βββββββ
ββ ββ ββ ββ ββ ββ
ββββββ ββββββ ββ βββββββ
β Config files and utility scripts
This repository contains configuration files and bash scripts to automate various development tasks. The files are organized into directories based on categories like Python, Git, Zsh, and more.
The repository is structured as follows:
.
βββ make
βΒ Β βββ Makefile-poetry
βΒ Β βββ Makefile-uv
βββ python
βΒ Β βββ noxfile.py
βΒ Β βββ conf
βΒ Β βΒ Β βββ pyproject-poetry.toml
βΒ Β βΒ Β βββ pyproject-uv.toml
βΒ Β βββ lint
βΒ Β βββ tests
βΒ Β βΒ Β βββ behave.ini
βΒ Β βΒ Β βββ pytest.ini
βΒ Β βββ type-checker
βΒ Β βββ mypy.ini
βββ scripts
βΒ Β βββ builds
βΒ Β βΒ Β βββ docker_hub.sh
βΒ Β βΒ Β βββ pypi.sh
βΒ Β βββ common
βΒ Β βΒ Β βββ clean.sh
βΒ Β βΒ Β βββ run.sh
βΒ Β βΒ Β βββ test.sh
βΒ Β βββ cookie-cutter
βΒ Β βΒ Β βββ create_structure.sh
βΒ Β βββ converters
βΒ Β βΒ Β βββ svg_to_png.sh
βΒ Β βββ file-system
βΒ Β βΒ Β βββ aggregate_docs.sh
βΒ Β βΒ Β βββ chunk_docs.sh
βΒ Β βΒ Β βββ modify_filenames.sh
βΒ Β βββ install
βΒ Β βββ local_dependencies.sh
βΒ Β βββ local_dependencies_uninstall.sh
βΒ Β βββ micromamba.sh
βΒ Β βββ migrate_to_uv.sh
βΒ Β βββ precommit.sh
βΒ Β βββ pyflink.sh
βββ vscode
βΒ Β βββ settings.json
βββ zsh
Β Β βββ .zprofile
βββ .zshrc
To get started with the utility scripts, build the project from source:
- Clone the repository:
β― git clone https://github.com/eli64s/dots
- Navigate to the project directory:
β― cd dots
One of my favorite scripts to use right now is aggregate_docs.sh, which concatenates all files from a GitHub repository into a single file. I've found this script useful when working with language model APIs for providing the model with robust context and up-to-date information.
First, let's view the help message for the script:
β― bash scripts/file/aggregate_docs.sh -h
Usage: scripts/file/aggregate_docs.sh [-r REPO_URL] [-p POSSIBLE_PATHS] [-o OUTPUT_FILE] [-n REPO_NAME] [-s TO_SEARCH]
-r REPO_URL URL of the GitHub repository to clone (required)
-p POSSIBLE_PATHS Comma-separated list of possible paths to search for markdown files (required)
-o OUTPUT_FILE Name of the output markdown file (required)
-n REPO_NAME Name of the repository (required)
-s TO_SEARCH Pattern to search for markdown files (e.g., "*.md") (required)
To run the script, provide the following arguments:
β― bash scripts/file/aggregate_docs.sh \
-r https://github.com/pydantic/pydantic \
-n pydantic \
-o pydantic-docs.md \
-p docs \
-s "*.md"
Alternatively, make the script executable:
β― chmod +x scripts/file/aggregate_docs.sh
And run it directly:
β― ./aggregate_docs.sh \
-r https://github.com/pydantic/pydantic \
-p docs \
-o pydantic-docs.md \
-n pydantic \
-s "*.md"
Say you want to clone this repository and use the .zshrc
file as your shell configuration, and have quick access to the function under the bash
directory. We can set this up by creating symlinks from the repository to your home directory.
- Create symlinks from your repository to your home directory:
# Current repository location
β― DOTS_DIR="/Users/<username>/GitHub/dots"
# Create symlinks
β― ln -sf "$DOTS_DIR/zsh/.zshrc" "$HOME/.zshrc"
β― ln -sf "$DOTS_DIR/bash" "$HOME/.zsh/functions"
- Add the following line to your
.zshrc
file to source the utility scripts:
# -- GitHub/dots Repository Integration ---------------------------------------------
DOTS_DIR="$HOME/Projects/GitHub/dots"
DOTS_SCRIPTS="$DOTS_DIR/bash"
# Function to load scripts from directory
function load_scripts() {
local dir="$1"
if [ -d "$dir" ]; then
# Create functions for all scripts instead of aliases
for script in "$dir"/*.sh; do
if [ -f "$script" ]; then
local func_name=$(basename "$script" .sh)
eval "function $func_name() { $script \"\$@\" }"
fi
done
fi
}
# Load all script directories from dots/bash
for category in $DOTS_SCRIPTS/*; do
if [ -d "$category" ]; then
load_scripts "$category"
fi
done
# Add custom functions directory to fpath
fpath+=("$DOTS_DIR/zsh/functions")
- Now you can run the scripts directly from your terminal:
β― aggregate_docs -r https://github.com/pydantic/pydantic-ai \
-p docs \
-o pydantic-ai-docs.md \
-n pydantic-ai \
-s "*.md"
This setup maintains the repository structure while making all bash scripts accessible as commands in your shell.
Tip
The scripts directory contains a variety of utilities for automating tasks like environment setup, file operations, and codebase management.