You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
docs: enhance README and documentation across modules
- Updated README.md to include license badges, project description, and detailed interactive workflows for project generation and feature addition.- Improved docstrings in main.py, __init__.py, and various utility modules to provide clearer descriptions of functionality and usage.- Enhanced command execution and file operations documentation for better understanding of safety checks and operations.This update improves the overall clarity and usability of the documentation for new users and contributors.
A powerful command-line tool that leverages artificial intelligence to generate complete project structures, add new features to existing projects, and streamline your development workflow.
>**Python CLI AI Coder** helps developers quickly bootstrap new projects with well-structured codebases, proper configuration files, and best practices already implemented. Save hours of setup time and focus on building your application's unique features.
9
+
5
10
##✨ Features
6
11
7
12
-**Project Generation**: Create complete project structures for various frameworks and languages
@@ -84,23 +89,68 @@ Run the project generator:
84
89
python main.py
85
90
```
86
91
87
-
Follow the interactive prompts to:
92
+
<details>
93
+
<summary><b>Interactive Workflow (click to expand)</b></summary>
94
+
95
+
1.**Select a project type** from the available options:
96
+
97
+
- Python
98
+
- JavaScript
99
+
- TypeScript
100
+
- React + Vite (TypeScript or JavaScript)
101
+
- Express (TypeScript or JavaScript)
102
+
- Custom (specify your own)
103
+
104
+
2.**Enter a project name** that will be used for the project directory and in generated files
105
+
106
+
3.**Choose a directory** to store the project (defaults to`projects/your_project_name`)
107
+
108
+
4.**Provide a project description** that will be used to generate appropriate code and documentation
88
109
89
-
1. Select a project type
90
-
2. Enter a project name
91
-
3. Choose a directory to store the project
92
-
4. Provide a project description
93
-
5. Select optional features (Git, Tests, GitHub Actions, Documentation)
110
+
5.**Select optional features**:
94
111
95
-
The tool will generate a complete project structure based on your specifications.
112
+
- 🔀**Git Initialization**: Initialize a Git repository with appropriate .gitignore
113
+
- 🚨**Testing Framework**: Add testing framework with sample tests
114
+
- 🛠️**GitHub Actions**: Set up CI/CD workflows
115
+
- 📝**Documentation**: Create documentation structure and templates
116
+
117
+
6.**Confirm and generate** your project structure
118
+
119
+
7.**View the summary** of generated files and directories
120
+
</details>
121
+
122
+
The tool will generate a complete project structure based on your specifications, with proper file organization, configuration files, and boilerplate code.
96
123
97
124
###Add Features to an Existing Project
98
125
99
-
After generating a project, you can add new features:
126
+
After generating a project, you can add new features to extend its functionality:
127
+
128
+
```bash
129
+
# After project generation completes, you'll be prompted to add features
130
+
# Or run the tool again and navigate to the existing project directory
131
+
python main.py
132
+
```
133
+
134
+
<details>
135
+
<summary><b>Feature Addition Workflow (click to expand)</b></summary>
136
+
137
+
1.**Select "Yes"** when asked if you want to add features to the project
138
+
139
+
2.**Describe the feature** you want to add in natural language, for example:
140
+
141
+
- "Add a user authentication system with login and registration"
142
+
- "Create a database connection module with SQLAlchemy"
143
+
- "Add a REST API endpoint for user profiles"
144
+
- "Implement a logging system with rotating file handlers"
145
+
146
+
3.**Watch as the tool analyzes** your project structure and implements the feature
147
+
148
+
4.**Review the changes** made to your project files
149
+
150
+
5.**Optionally add more features** by selecting "Yes" when prompted
151
+
</details>
100
152
101
-
1. Select "Yes" when asked if you want to add features
102
-
2. Describe the feature you want to add
103
-
3. The tool will analyze your project and implement the new feature
153
+
The tool will intelligently analyze your existing project structure and implement the requested feature with appropriate code, tests, and documentation updates.
104
154
105
155
##⚙️ Configuration Options
106
156
@@ -111,41 +161,62 @@ After generating a project, you can add new features:
111
161
-**GitHub Actions**: Set up CI/CD workflows
112
162
-**Documentation**: Create documentation structure and templates
113
163
114
-
###Tool Calls
164
+
###Technical Implementation
115
165
116
-
TheProjectGenerator class defines tools that AI Coder can call:
166
+
ThePython CLI AI Coder uses a tool-based approach to generate project structures:
117
167
118
-
-`read_file`: Read the contents of a file
119
-
-`get_file_metadata`: Get metadata for a file
120
-
-`list_directory_contents`: List files and directories
121
-
-`write_to_file`: Write content to a file
122
-
-`create_directory`: Create a new directory
123
-
-`run_command`: Execute a shell command
168
+
<details>
169
+
<summary><b>AI Tool System (click to expand)</b></summary>
170
+
171
+
The`ProjectGenerator` class defines a set of tools that the AI model can call to manipulate files and directories:
|`read_file`| Read the contents of a file| Used to analyze existing files|
176
+
|`get_file_metadata`| Get metadata for a file| Used to check file properties|
177
+
|`list_directory_contents`| List files and directories| Used to understand project structure|
178
+
|`write_to_file`| Write content to a file| Used to create or update files|
179
+
|`create_directory`| Create a new directory| Used to create folder structure|
180
+
|`run_command`| Execute a shell command| Used to run initialization commands|
181
+
182
+
These tools are exposed to the AI model through a function-calling interface, allowing it to manipulate the filesystem in a controlled and secure manner.
183
+
184
+
</details>
185
+
186
+
This architecture enables the AI to generate complex project structures while maintaining security and control over the operations performed.
124
187
125
188
##How It Works
126
189
127
-
1.**Initialization**:
190
+
<imgsrc="https://via.placeholder.com/800x400.png?text=Python+CLI+AI+Coder+Workflow"alt="Python CLI AI Coder Workflow Diagram"width="100%">
191
+
192
+
1.**Initialization** 🚀
128
193
129
194
- The tool loads the OpenAI API key from the`.env` file
130
-
- It initializes the ProjectGenerator class with this key
195
+
- It initializes the`ProjectGenerator` class with this key
196
+
- The system prepares the available tools for AI to use
197
+
198
+
2.**User Input Collection** 💬
131
199
132
-
2.**User Input**:
200
+
- The CLI presents an interactive interface with colorful prompts
201
+
- Users select project type, name, location, and description
202
+
- Users customize project features through a visual selection interface
203
+
- All selections are validated and confirmed before proceeding
133
204
134
-
- The CLI collects project specifications from the user
135
-
- Users select project type, name, description, and features
205
+
3.**Project Generation Process** ⚙️
136
206
137
-
3.**Project Generation**:
207
+
- The system crafts detailed prompts for the AI model with project specifications
208
+
- The AI model (GPT-4o) analyzes the requirements and plans the project structure
209
+
- The AI makes tool calls to create directories, files, and execute commands
210
+
- The system executes these calls and provides real-time visual feedback
211
+
- A comprehensive project structure is built according to best practices
138
212
139
-
- The tool sends prompts to GPT-4o with project specifications
140
-
- GPT-4o responds with tool calls to create files and directories
141
-
- The tool executes these calls to build the project structure
142
-
- Progress is displayed in real-time
213
+
4.**Feature Addition Capability** 🔍
143
214
144
-
4.**Feature Addition**:
145
-
-Users can describe features to addto thegenerated project
146
-
- Thetool analyzes theproject structure
147
-
-AI generates codetoimplement thefeature
148
-
-The tool integrates the new code into theproject
215
+
- Users can request new features in natural language
216
+
-The AI analyzes the existing project structuretounderstandthecodebase
217
+
- Thesystem determines thenecessary changes to implement the feature
218
+
-Files are modified or createdtoadd therequested functionality
219
+
-Tests and documentation are updated to reflect thenew features