JavaScript/Node.js Setup Instructions
Follow these steps to set up and use the JavaScript (Node.js) license generator script in this repository.
1. Clone the Repository
git clone https://github.com/callmerocco/li-cen-se.git
cd li-cen-se
2. Install Node.js
Ensure you have Node.js installed (version 18 or higher recommended).
Check your Node.js version:
node --version
If you need to install Node.js, visit nodejs.org.
3. Install Dependencies
npm install inquirer chalk openai dotenv
Or, if using yarn
:
yarn add inquirer chalk openai dotenv
4. Prepare Required Files
- (Optional) Create a
.env
file in the project root and add your OpenAI API key:OPENAI_API_KEY=your-openai-api-key-here
5. Run the Script
node path/to/your_script.js
Replace path/to/your_script.js
with the actual filename if different.
6. Usage
- The script will prompt you to select a license type or choose "AI-generated".
- Enter your name, project name, and year when prompted.
- If you select "AI-generated", describe your custom license idea.
- The script will generate a
LICENSE
file in the current directory.
7. Troubleshooting
- If you see
Error: OPENAI_API_KEY not set in environment.
, make sure your.env
file exists and contains your API key, or set the environment variable manually:export OPENAI_API_KEY=your-openai-api-key-here
For more details, go here.