0% found this document useful (0 votes)
3 views1 page

VSCode CodeGPT EnableAutoFileFolder

This document provides instructions for enabling automatic file and folder creation in Visual Studio Code using the CodeGPT extension. It includes steps to allow file operations, create a tasks.json file for file and folder creation, and explains how to utilize AI for generating code. Additionally, it suggests installing the 'File Templates' extension for enhanced functionality, allowing for seamless project structure building.

Uploaded by

Dawasakshit
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

VSCode CodeGPT EnableAutoFileFolder

This document provides instructions for enabling automatic file and folder creation in Visual Studio Code using the CodeGPT extension. It includes steps to allow file operations, create a tasks.json file for file and folder creation, and explains how to utilize AI for generating code. Additionally, it suggests installing the 'File Templates' extension for enhanced functionality, allowing for seamless project structure building.

Uploaded by

Dawasakshit
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Enable Auto File/Folder Creation in VS Code with

CodeGPT

1■■ Enable File Operations in CodeGPT


- Open VS Code → Settings → Extensions → CodeGPT. - Turn on “Allow File Operations” (if
available). - This lets AI suggest create, edit, or delete files automatically.

2■■ Add VS Code Tasks for File Creation


Create a `.vscode/[Link]` file with the following config:
{
"version": "2.0.0",
"tasks": [
{
"label": "Create File",
"type": "shell",
"command": "echo '${input:content}' > ${input:filename}"
},
{
"label": "Create Folder",
"type": "shell",
"command": "mkdir -p ${input:foldername}"
}
],
"inputs": [
{ "id": "filename", "type": "promptString", "description": "Enter file path" },
{ "id": "content", "type": "promptString", "description": "Enter file content" },
{ "id": "foldername", "type": "promptString", "description": "Enter folder name" }
]
}

3■■ How It Works


• Ask AI: 'Make [Link] with Scaffold and AppBar in lib/screens/'.
• AI generates the code.
• AI suggests: Run task → Create File.
• You confirm → File + code appear automatically.

4■■ Optional Boost


- Install 'File Templates' extension from VS Code Marketplace. - Lets AI use pre-defined templates
for Flutter screens, [Link] routes, etc. - Example: “Use File Template → Flutter Screen” →
auto-generates the file.

■ Result: Your VS Code + CodeGPT + Ollama setup can now: - Create files & folders automatically
- Write AI-generated code inside them - Build project structure seamlessly This makes VS Code
behave much closer to Cursor (with one confirmation step for safety).

You might also like