AdvancedRepository Automation Scripts

Repository Automation Scripts

What the repository’s bootstrap and version-bump scripts automate today, how they are invoked, and where script behavior differs from other project documentation.

Overview

The repository currently includes two implemented shell scripts for local automation: scripts/bootstrap.sh and scripts/version-bump.sh. Root package.json also exposes wrapper scripts for version bumps and local development, but the available entrypoints do not fully match the README or the current repository structure.

Script inventory

The implemented automation in the analyzed files falls into two groups: standalone shell scripts in scripts/ and script wrappers defined in root package.json. The shell scripts perform the actual automation. The root scripts mostly provide shorter entrypoints for repeated commands.

Implemented shell scripts

  • scripts/bootstrap.sh — verifies required tooling, installs workspace dependencies, installs Bun dependencies for apps/api, and runs uv sync in apps/ai-service
  • scripts/version-bump.sh — bumps the VERSION file for one service and prints the next manual git commands

Root package.json wrappers

The root package.json exposes these wrappers:

  • Development

    • dev
    • dev:web
    • dev:api
    • dev:py
  • Version bump

    • version:web:patch
    • version:web:minor
    • version:web:major
    • version:api:patch
    • version:api:minor
    • version:api:major
    • version:ai:patch
    • version:ai:minor
    • version:ai:major

This inventory is limited to the analyzed repository files: scripts/bootstrap.sh, scripts/version-bump.sh, package.json, and README.md. No additional automation is documented here.

Bootstrap

scripts/bootstrap.sh prepares the monorepo for local development by checking for required tools and installing dependencies for each runtime used in the repository. It stops on the first failing command because it enables set -e.

What the script does

Verify required tools

The script checks whether pnpm, bun, and uv are available with command -v. If any tool is missing, it prints an error such as ❌ pnpm is not installed and exits with status 1.

When all three tools are present, the script prints ✅ All required tools found.

Install root workspace dependencies

The script runs pnpm install from the repository root. This installs the workspace dependencies defined for the monorepo.

Install API dependencies with Bun

The script changes into apps/api, runs bun install, and then returns to the repository root. This is the only Bun-specific install step implemented in the script.

Sync AI service dependencies with uv

The script changes into apps/ai-service, runs uv sync, and then returns to the repository root. This is the Python environment setup step currently implemented.

Print completion output

At the end, the script prints ✅ Setup complete! followed by Run everything with: and pnpm dev. That output confirms the install flow completed without an earlier failure.

How to invoke bootstrap

./scripts/bootstrap.sh

There is no root package.json wrapper for scripts/bootstrap.sh. The analyzed package.json does not define a setup script.

The README instructs you to run pnpm setup, but no setup script exists in root package.json. The verified bootstrap entrypoint is ./scripts/bootstrap.sh.

Version bump

scripts/version-bump.sh updates exactly one service VERSION file based on a major, minor, or patch bump. It does not update package versions, create commits, create tags, or push changes.

How the script works

The script enables set -euo pipefail, reads two positional arguments, and validates both before making any file changes. The first argument selects the service, and the second selects the bump type.

Supported service values are:

  • web mapped to apps/web
  • api mapped to apps/api
  • ai-service mapped to apps/ai-service

Supported bump types are:

  • major
  • minor
  • patch

If either argument is missing, the script prints ❌ Usage: $0 <web|api|ai-service> <major|minor|patch> and exits with status 1. If the service value or bump type is invalid, the script prints a targeted error message and exits with status 1.

Exact effects on the VERSION file

After resolving the service directory, the script reads the current version from apps/<service>/VERSION with whitespace removed. It parses the version into major, minor, and patch parts, then applies one of these changes:

  • major increments major and resets minor and patch to 0
  • minor increments minor and resets patch to 0
  • patch increments patch only

The script writes the new version back to the same VERSION file. After writing the file, it prints the old and new versions and shows the next manual git commands to run.

What the script does not automate

  • It does not update package.json versions.
  • It does not create a git commit.
  • It does not create a git tag.
  • It does not push changes.
  • It does not update more than one service at a time.

How to invoke version bump

./scripts/version-bump.sh web patch
./scripts/version-bump.sh api minor
./scripts/version-bump.sh ai-service major

Script entrypoints

The root package.json scripts map short commands to a smaller set of underlying commands. For local development, some wrappers start services directly. For versioning, each wrapper calls scripts/version-bump.sh with fixed arguments.

Development entrypoints

pnpm dev
pnpm dev:web
pnpm dev:api
pnpm dev:py

Version entrypoints

pnpm version:web:patch
pnpm version:web:minor
pnpm version:web:major
pnpm version:api:patch
pnpm version:api:minor
pnpm version:api:major
pnpm version:ai:patch
pnpm version:ai:minor
pnpm version:ai:major

Mismatch notes

Several verified discrepancies exist between the analyzed scripts, root package.json, README instructions, and the current repository structure. These mismatches matter because they change which commands actually work.

dev:py points to apps/py-service, but the repository path present in the analyzed tree is apps/ai-service. The current root script is cd apps/py-service && uv run uvicorn main:app --reload --port 8001, so the configured path does not match the verified service directory.

The README references pnpm setup, but root package.json does not define a setup script. The implemented bootstrap entrypoint is ./scripts/bootstrap.sh.

The README uses py-service in multiple places, including apps/py-service/, @repo/py-service, cd apps/py-service, and service runtime examples. The analyzed repository structure uses apps/ai-service instead.

The README describes a packages/ directory with entries such as packages/types, packages/ui, and packages/config, but no packages directory is present in the analyzed repository tree.

These notes describe verified differences only. They do not imply which source should be treated as canonical beyond the commands and paths directly observed in the analyzed files.

Usage examples

Use these commands when you want the behavior that is implemented today, not the behavior implied by stale README references. The expected outcomes below come from the script logic and printed output in the analyzed files.

Bootstrap the repository

./scripts/bootstrap.sh

If one required tool is missing, the script exits early after printing the corresponding error line. If the script completes, you know it has already run pnpm install, bun install in apps/api, and uv sync in apps/ai-service.

Bump one service version

pnpm version:api:patch

The exact version numbers depend on the current contents of apps/api/VERSION. A successful run changes only that file and then prints the suggested manual git commands.

Validate argument handling

./scripts/version-bump.sh

The script exits with status 1 for each invalid invocation. The error text identifies whether the problem is missing arguments, an unknown service, or an invalid bump type.