/bolt.new-ai-integrations

Bolt.new AI and Sublime Text integration: Step-by-Step Guide 2025

Learn how to integrate Bolt.new AI with Sublime Text using our step-by-step guide. Enhance your coding workflow and boost productivity efficiently.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to integrate Bolt.new AI with Sublime Text?

 

Setting Up Your Sublime Text Integration File

 

Create a new file in your Bolt.new AI project root directory named sublimeIntegration.ts. This file will contain the TypeScript code responsible for sending commands from your Bolt.new project to Sublime Text.


// This function uses the native fetch API to send an HTTP POST request
// to a Sublime Text plugin that you must have installed and running locally.
// The Sublime Text plugin should listen on the specified port for such commands.
export async function openFileInSublime(filePath: string): Promise {
  try {
    // Replace PORT with the actual port number your Sublime Text plugin is running on.
    const port = 12345; 
    const response = await fetch(http://localhost:${port}/open, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ path: filePath })
    });
    
    const result = await response.json();
    console.log('Sublime Text has opened the file:', result);
  } catch (error) {
    console.error('Error sending file open command to Sublime Text:', error);
  }
}

 

Integrating the Sublime Text Function in Your Main Code

 

In your main TypeScript file (for example, index.ts or any other file that serves as your project’s entry point), import the function you just created. Then, add a call to open a desired file in Sublime Text. This call can be triggered by an event or directly when your Bolt.new project starts.


import { openFileInSublime } from './sublimeIntegration';

// Example function to demonstrate the integration.
// You can replace this with any event or logic that fits your project.
function integrateWithSublime() {
  // Replace the file path with the actual file you wish to open in Sublime Text.
  const filePath = '/absolute/path/to/your/file.txt';
  openFileInSublime(filePath);
}

// Call the integration function as needed.
// For demonstration, we call it on startup.
integrateWithSublime();

 

Setting Up the Sublime Text Plugin

 

For the above integration to work, you must have a Sublime Text plugin that listens for HTTP requests. Perform the following steps in Sublime Text:

• Install a Sublime Text package that can run a simple HTTP server. You can use a community plugin or write your own plugin using Python.

• Ensure that the plugin listens on the same port specified in your sublimeIntegration.ts file.

• The plugin should parse the incoming JSON from the POST request and open the file specified by the path property.

 

Managing Dependencies Without a Terminal

 

Since Bolt.new AI does not provide a terminal, you must include any external dependency declarations directly in your project’s configuration files. If your project uses a package.json for dependency management (even though you cannot run terminal commands), add your dependency entries manually.


{
  "name": "bolt-sublime-integration",
  "version": "1.0.0",
  "description": "Bolt.new AI project integrating with Sublime Text",
  "scripts": {
    "start": "ts-node index.ts"
  },
  "dependencies": {
    // No extra dependencies are needed for the fetch API.
    // If you require any other packages, list them here.
  },
  "devDependencies": {
    "@types/node": "^14.0.0",
    "ts-node": "^9.0.0",
    "typescript": "^4.0.0"
  }
}

 

Final Integration Check

 

Ensure that your project now contains the new sublimeIntegration.ts file with the integration code and that your main file imports and calls the function to send an HTTP request to Sublime Text. Double-check that your Sublime Text plugin is configured to listen on the specified port and can handle the request to open the given file path.

Once everything is saved, running your Bolt.new AI project (through its built-in execution mechanism) should trigger the code that sends a command to Sublime Text to open the designated file.

 

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022