Skip to content

Latest commit

 

History

History
141 lines (99 loc) · 4.19 KB

README.md

File metadata and controls

141 lines (99 loc) · 4.19 KB

Open in Codeanywhere

DevContainer Generator

Welcome to the devcontainer-generator project! This tool helps you automatically generate devcontainer.json files for your development environments based on the structure and contents of a given GitHub repository.

Table of Contents

  1. Project Structure
  2. Installation
  3. Configuration
  4. Usage
  5. Setting Up Daytona Workspace
  6. Contributing
  7. License

Project Structure

devcontainer-generator
├── tests.ipynb
├── requirements.txt
├── schemas
│   └── devContainer.base.schema.json
├── README.md
├── main.py
└── data
    └── devcontainers.db
  • tests.ipynb: Jupyter Notebook containing tests and exploratory data analysis.
  • requirements.txt: List of dependencies needed to run the project.
  • schemas/: Directory containing the JSON schema for the devcontainer.json file.
  • README.md: This documentation file.
  • main.py: Main script to generate devcontainer.json files.
  • data/: Directory containing the SQLite database files.

Installation

To run this project in Daytona, you'll need to have Daytona installed. Follow these steps to set up the project:

  1. Install Daytona:

    (curl -L https://download.daytona.io/daytona/install.sh | sudo bash) && daytona server stop && daytona server -y && daytona
  2. Create new project and run IDE:

    daytona create https://github.com/daytonaio/devcontainer-generator.git
  3. Set up environment variables: Create a .env file in the project's root directory and add the following environment variables:

    AZURE_OPENAI_ENDPOINT=your_azure_openai_endpoint
    AZURE_OPENAI_API_KEY=your_azure_openai_api_key
    AZURE_OPENAI_API_VERSION=your_azure_openai_api_version
    MODEL=your_model_name
    GITHUB_TOKEN=your_github_token
    SUPABASE_URL=your_supabase_url
    SUPABASE_KEY=your_supabase_api_key
    SUPABASE_DB_URL=your_supabase_db_url

Configuration

Azure OpenAI and Instructor Clients

Ensure the following environment variables are set in your .env file:

AZURE_OPENAI_ENDPOINT=your_azure_openai_endpoint
AZURE_OPENAI_API_KEY=your_azure_openai_api_key
AZURE_OPENAI_API_VERSION=your_azure_openai_api_version
MODEL=your_model_name
GITHUB_TOKEN=your_github_token

Supabase Database Setup

Run the migrate.py script to create the devcontainers table in Supabase. Here's how you can do it:

python migrate.py

After creating the table, you can use the Supabase client in your Python code to interact with the database.

JSON Schema

The JSON schema for the devcontainer.json file is located in schemas/devContainer.base.schema.json.

Usage

Run the main.py script to start the FastHTML app and generate devcontainer.json files. Here's how you can do it:

python main.py

Instructions:

  1. After starting the app, open your web browser and go to http://localhost:8000.
  2. Enter the URL of the GitHub repository for which you want to generate a devcontainer.json file.
  3. Click the "Generate devcontainer.json" button.
  4. The generated devcontainer.json will be displayed and can be copied to your clipboard.

Setting Up Daytona Workspace

Steps to Set Up Daytona Workspace

  1. Create Daytona Workspace:

    daytona create https://github.com/nkkko/devcontainer-generator
  2. Select Preferred IDE:

    daytona ide
  3. Open the Workspace:

    daytona code

Contributing

We welcome contributions! Please read our CONTRIBUTING.md file for guidelines on how to contribute to this project.

License

This project is licensed under the MIT License. See the LICENSE file for more details.


Thank you for using devcontainer-generator! If you have any questions or issues, feel free to open an issue on GitHub.