# ADR-0010 - Optional Wrapper Scripts

Status:
Accepted

Context:

Many development environments support globally installed tools.

Some environments do not:

- Shared CI systems
- Hosted CI systems
- Managed corporate machines
- Locked-down developer environments

Decision:

Project-local wrapper scripts are optional.

Recommended names:

- otw
- otw.bat

The primary interface remains the globally installed `ot` command.

Reasoning:

Most users should not need wrapper scripts.

Projects may choose to include wrappers where deployment constraints require them.

Alternatives Considered:

### Project Wrapper Required

Pros:

- Consistent execution

Cons:

- Additional repository clutter
- Additional maintenance

### Global Installation Required

Pros:

- Minimal project files

Cons:

- Poor CI support
- Additional setup requirements

Consequences:

Positive:

- Flexible deployment
- Improved CI compatibility
- Reduced repository requirements

Negative:

- Multiple execution patterns
- Additional wrapper maintenance when used

## Amendments (As-Built)

- **Renamed from `otw` to `oat`**: The project-local wrapper scripts were renamed from `otw` / `otw.bat` to **`oat`** (POSIX shell) and **`oat.bat`** (Windows batch) (`src/ot/installation.py`, task `f5ecb3`).
- **Generated by Default on `init` and Migrated on `upgrade`**:
  - `ot init` generates `oat` and `oat.bat` in the project root by default unless `--no-wrappers` is passed.
  - `ot upgrade` refreshes `oat` and `oat.bat` to the latest wrapper template and automatically removes legacy `otw` and `otw.bat` files if present (`src/ot/upgrade.py`).
- **Self-Bootstrapping Capability**: Rather than requiring a globally pre-installed `ot` binary, `oat` inspects `system.toolVersion` in `.ot/config.json` and, if `.ot/bin/<version>/ot.zipapp` is missing, uses `python3` to fetch, verify (`SHA256SUMS`), cache (`~/.ot/versions/<version>/`), and install the configured `.zipapp` directly before executing it.

