A Node.js application that demonstrates an AI assistant capable of executing shell commands and using custom tools through a structured workflow system.
- AI-Powered Assistant: Uses OpenAI's GPT-4o-mini model for intelligent responses
- Tool Execution: Can execute shell commands using Node.js child_process
- Structured Workflow: Follows START → THINK → ACTION → OBSERVE → OUTPUT pattern
- Custom Tools: Includes weather information and command execution capabilities
- JSON Response Format: Structured communication with the AI model
- Node.js (v16 or higher)
- OpenAI API key
- Clone the repository:
git clone <your-repo-url>
cd mini-cursor-project- Install dependencies:
npm install- Create a
.envfile in the root directory:
OPEN_AI_KEY=your_openai_api_key_hereRun the application:
node index.jsThe application will process the predefined user query and execute the AI workflow.
- START: User provides a query
- THINK: AI analyzes the query and determines the best approach
- ACTION: AI calls appropriate tools (execCommand, getWeatherInfo)
- OBSERVE: Tool execution results are captured
- OUTPUT: Final response is generated and displayed
- execCommand(command): Executes shell commands and returns output
- getWeatherInfo(city): Provides weather information for a city
- Reading file contents
- Creating applications
- Executing shell commands
- Getting weather information
mini-cursor-project/
├── index.js # Main application file
├── package.json # Project dependencies
├── .env # Environment variables (create this)
└── README.md # This file
The application uses environment variables for configuration:
OPEN_AI_KEY: Your OpenAI API key
openai: OpenAI API clientdotenv: Environment variable management
Feel free to submit issues and enhancement requests!
This repository includes an AI-powered code review feature that automatically analyzes pull requests. When you raise a PR, our AI system will:
- Review your code for potential issues and improvements
- Suggest optimizations and best practices
- Check for security vulnerabilities
- Ensure code quality and consistency
- Provide automated feedback to help maintain high code standards
Simply create a pull request and the AI review will be triggered automatically!