GitHub - Yuyz0112/minimal-bolts: less than 60 lines of shell to implement a minimal bolts.new for education purposes

2 min read Original article ↗

minimal-bolts

Implementing a minimal bolts.new for education purposes using less than 60 lines of shell along with a system prompt in Markdown.

How to Use

Update the API KEY and other information in the .env file.

You can also configure LLM providers other than OpenAI's gpt-4o.

Demo Video

Gains and Losses

bolts.new is an incredibly fascinating and elegantly designed project, so it’s clear that I can’t replicate all its features with just a few dozen lines of shell.

The purpose of this project is to adhere to the philosophy proposed by Anthropic: learning about LLMs should start with the most fundamental API requests.

To achieve this, I examined the open-source code of bolts.new, found its system prompt, and understood how it drives an LLM to return the necessary materials (files and shell commands) for starting a code workspace. Then, I used a shell script to execute these materials.

However, we inevitably lost certain features:

  • The browser-based development experience powered by WebContainer: While this is a loss, it also opens the door to using any tools available on the OS.
  • The ability to further customize and modify
  • A fully-featured chat UI

Roadmap

This project has no further steps planned. However, you can reference its code and tweak the system prompt to suit your needs. Beyond this project, I am working on a more ambitious and exciting AI coder project. If you’re interested, feel free to follow my X account for updates.