Warning
This product is currently under development and is publicly accessible for open-source purposes only. Please exercise caution and run it locally only if you are familiar with OpenAI APIs and JS.
LangChain CLI is a command-line tool that helps software developers analyze, enhance, and fix their code using artificial intelligence. This tool leverages the OpenAI API to provide intelligent suggestions and solutions for various programming tasks.
- Installation
- Initialization
- Analyzing Project Files
- Adding a New Feature
- Fixing Errors
- Usage Examples
- Contributing
- License
To install and use the LangChain CLI locally, follow these steps:
-
Clone this repository to your local machine:
git clone https://github.com/basith-ahmed/langchain-cli.git
-
Navigate to the project directory:
cd langchain-cli
-
Install the required dependencies:
npm install
-
Set up your OpenAI API key as an environment variable:
OPENAI_API_KEY='YOUR-OPENAI-API-KEY'
Before using the LangChain CLI, you need to initialize the project:
npm run langchain-cli init
This command analyzes all files in the repository and creates descriptions for each file. The file descriptions are stored in fileDescriptions.json
for later use.
To analyze the project files and update the file descriptions, run:
npm run langchain-cli analyze
This command scans all files in the repository, extracts relevant information, and updates the fileDescriptions.json
file.
To add a new feature to your project, use the following command:
npm run langchain-cli add 'description of the feature'
This command analyzes the feature description, identifies the most relevant file in the project, generates the code for the new feature, and inserts it into the identified file.
To scan and fix errors in project files, run:
npm run langchain-cli fix
This command iterates through all files in the repository, identifies errors, and attempts to fix them using AI-powered suggestions.
Action | Command | Description |
---|---|---|
Initialization | npm run langchain-cli init |
Analyzes and describes project files. |
Analyzing Project Files | npm run langchain-cli analyze |
Updates file descriptions. |
Adding a New Feature | npm run langchain-cli add 'description of the feature' |
Adds a new feature to the project. |
Fixing Errors | npm run langchain-cli fix |
Fixes errors in project files. |
-
Initializing the Project:
npm run langchain-cli init
-
Analyzing Project Files:
npm run langchain-cli analyze
-
Adding a New Feature:
npm run langchain-cli add 'add a green button to the nav bar'
-
Fixing Errors:
npm run langchain-cli fix
Contributions to the LangChain CLI are welcome! To contribute, follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature-name
. - Commit your changes:
git commit -m "Your message here"
. - Push to the branch:
git push origin feature-name
. - Submit a pull request.
This project is licensed under the MIT License.