Custom Oh My Pi tools that let the agent format and test the current project without needing project-specific instructions baked into a skill or system prompt.
Runs the project's code formatter.
- Rust (
Cargo.tomlpresent):cargo fmt. - TypeScript/JS (
package.jsonpresent, noCargo.toml): runs the first matchingpackage.jsonscript, in this order:format,fmt,lint:fix,lint,prettier,biome:fix,biome:check. The package manager is detected from the lockfile (pnpm-lock.yaml→ pnpm,bun.lockb→ bun,yarn.lock→ yarn, else npm). - Otherwise: reports that no formatter is configured.
Returns the exact command run, its exit code, and the captured output (tail, capped at 4000 chars).
Runs the project's build/typecheck step followed by its test suite.
- Rust:
cargo nextest run, optionally scoped with afilterargument (cargo nextest run <filter>). - TypeScript/JS: runs the first matching build/typecheck script —
build,typecheck,type-check,check— then thetestscript if present (<pm> run test, or<pm> run test -- <filter>when afilterargument is given). Package manager detection matchesproject_format. - Otherwise: reports that no test runner is configured.
Returns each command run, its exit code, and captured output (tail, capped at 3000 chars per step).
Project kind detection (lib/project-kind.ts) is shared between both tools: Rust wins if Cargo.toml exists, else TypeScript if package.json exists, else "other" (no runner configured).
Each tool is a single file that default-exports an Oh My Pi CustomToolFactory: a function (pi) => ({ name, label, description, parameters, approval, execute }). Oh My Pi discovers tool files by loading every file in ~/.omp/agent/tools/ (user) or <project>/.omp/tools/ (project) individually — there is no bundler step, so imports must use explicit .ts extensions and resolve on disk exactly as written.
Both tools use pi.cwd for the working directory, pi.zod for parameter schemas, and pi.exec to run subprocesses — all provided by the host pi object at load time. No third-party dependency is required beyond what the host provides.
omp plugin install github:gyoz-ai/omp-project-toolsThis runs bun install against ~/.omp/plugins, symlinks the package into node_modules, and registers project-format.ts and project-test.ts as tools from the same manifest.
Oh My Pi loads each tool file independently, so symlink each file into ~/.omp/agent/tools/ individually:
ln -s "$(pwd)/project-format.ts" ~/.omp/agent/tools/project-format.ts
ln -s "$(pwd)/project-test.ts" ~/.omp/agent/tools/project-test.tsThe lib/project-kind.ts helper is imported by relative path from both files and does not need a separate symlink — it resolves alongside the repo checkout through the symlink target.
To install for a single project instead, symlink into <project>/.omp/tools/ the same way.
To remove a symlink-based install, delete the symlinks (the repo checkout itself is untouched):
rm ~/.omp/agent/tools/project-format.ts ~/.omp/agent/tools/project-test.tsVerify the tools compile standalone:
bun build project-format.ts project-test.ts --external @oh-my-pi/pi-ai --target bun --outdir /tmp/omp-build-check-project-tools