Codebat provides simple Windows batch launchers for AI agent software. Add it to a repository as a Git submodule, open a launcher, and Codebat handles the local agent installation before starting it in the parent project.
Codebat currently supports OpenCode and Pi Coding Agent.
- Installs supported agents locally with npm when they are not available.
- Keeps agent dependencies, configuration, data, and cache inside Codebat.
- Starts the agent in the parent repository so it can work on that project.
- Reports clear errors when Node.js, npm, or installation is unavailable.
- Windows
- Git for Windows; Pi uses its bundled Git Bash by default
- Node.js 22.19.0 or newer with npm available on
PATH - Internet access during the first agent installation
Open Windows Command Prompt in the root of the repository where you want to use an AI agent, then add Codebat as a direct child of that repository:
git submodule add https://github.com/Geonhui-Lee/codebat.git codebat
git config --local submodule.recurse true
git commit -m "chore: add Codebat submodule"The git config command enables recursive submodule handling for future
git pull commands in this local project without changing your global Git
configuration.
Launch OpenCode:
codebat\_opencode.batOr launch Pi Coding Agent:
codebat\_pi.batYou can also open either launcher from File Explorer. On its first run, each
launcher installs its agent in codebat\node_modules. It then starts the agent
with the parent repository as its working directory.
Important
Keep Codebat directly inside the repository root. The launcher uses its
immediate parent directory as the workspace. For example, placing it at
tools\codebat would make tools the workspace instead of the repository
root.
This section is for people who collaborate on your project after you add Codebat as a submodule, not for contributors to Codebat itself. Each collaborator must initialize Codebat in their own clone.
git config --local writes to each clone's .git/config, which is not
committed with your project. Every collaborator should therefore enable
recursive submodule handling once after cloning.
Your collaborator can clone your project and initialize Codebat at the same time:
git clone --recurse-submodules <repository-url>
cd <repository-directory>
git config --local submodule.recurse trueIf your collaborator already cloned your project without its submodules, they should run these commands from the project root:
git submodule update --init --recursive
git config --local submodule.recurse trueThey can then launch either supported agent:
codebat\_opencode.batcodebat\_pi.batThe first launch installs the selected agent locally for that collaborator.
Their codebat\node_modules, codebat\.opencode, and codebat\.pi
directories remain local and are ignored by Git.
After this one-time setup, a collaborator can pull your project's changes and launch an agent normally:
git pullThe recursive Git configuration makes git pull update Codebat to the exact
commit recorded by your project. The collaborator can then open the launcher
for the agent they want to use.
Each launcher performs the following steps:
- Locates the Codebat directory and its parent workspace.
- Checks that Node.js and npm are available.
- Installs and validates its agent if it is missing locally.
- Stores that agent's user state inside Codebat.
- Starts the local agent executable from the parent workspace.
| Agent | Local install command | User state |
|---|---|---|
| OpenCode | npm install --save-dev --ignore-scripts opencode-ai |
codebat\.opencode |
| Pi | npm install --save-dev --ignore-scripts @earendil-works/pi-coding-agent |
codebat\.pi\agent |
Pi officially recommends disabling dependency lifecycle scripts during npm
installation. Both launchers therefore disable scripts while installing the
shared dependencies. _opencode.bat then runs only OpenCode's required
postinstall through npm rebuild opencode-ai. _pi.bat performs the same
targeted rebuild if installing Pi leaves OpenCode unprepared.
The generated node_modules, .opencode, and .pi directories are ignored by
Git.
Your collaborators should use normal git pull commands to receive the
Codebat version selected by your project. They should not run the following
commands unless they are responsible for maintaining your project's Codebat
version.
To intentionally move your project to a newer Codebat commit, run:
git submodule update --remote codebat
git add codebat
git commit -m "chore: update Codebat submodule"Install Node.js, open a new Command Prompt, and confirm that both commands work:
node --version
npm --versionPi requires Node.js 22.19.0 or newer.
Check your internet connection and npm configuration, then retry the launcher. You can also run the installation directly from the submodule:
cd codebat
npm install --save-dev --ignore-scripts opencode-ai
npm rebuild opencode-aiConfirm that Node.js 22.19.0 or newer, npm, and Git for Windows are installed.
Then retry _pi.bat. Pi's npm installation intentionally uses
--ignore-scripts as recommended by its maintainers.
Initialize the submodule from the parent repository:
git submodule update --init --recursive| Agent | Launcher | Status |
|---|---|---|
| OpenCode | _opencode.bat |
Supported |
| Pi Coding Agent | _pi.bat |
Supported |
Additional agent launchers may be added in future versions.