I want to use some kind of Tool for terminal. It would be coded in JS, the idea is to run this code inside any project in my machine, so probably we will need NPM for this tool. Once I call the opencodebox it should do the following:
- Build the image for the container above in case it doesn't exist
- Run an instance of the container
- Copy github user credentials inside the container (fail in case no credentials are found)
- Copy config folders from opencode to the container as same folder
~/.local/share/opencodeand~/.config/opencodeto the same paths. - Grab project folder github config path and clone the repo inside the container
- Checkout to the current branch from the host machine inside the project in the container.
OBSERVATIONS:
- the credentials must be forwarded sucessfully with github host machine user.
The intent is to have some properties builded in the container:
- Install node:20-alpine in there
- Install opencode inside the container with
npm install -g opencode-ai - Create a user the container that isn't sudoer
How do I expect to run this tool:
- Inside a github project folder I should be able to just call the
opencodeboxtool and it does all the above automatically
Any additional informations regarding OpenCode ould be found in their docs:
OpenCode Docs OpenCode CLI commands OpenCode - Different modes for different use cases Set custom instructions for OpenCode Using the OpenCode JSON config Configuring an LLM provider and model Open Code - Troubleshooting