Python Setup Instructions
Follow these steps to set up and use the Python 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. Set Up a Python Virtual Environment (Recommended)
python3 -m venv venv
source venv/bin/activate
3. Install Dependencies
pip install openai
4. Prepare Required Files
- Ensure you have a
licenses.json
file in the project root. This should contain license templates in JSON format. - (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
python3 path/to/your_script.py
Replace path/to/your_script.py
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.