Skip to main content

Webwright: The Ghost in Your Shell 👻💻

Project description

Webwright: The Ghost in Your Shell 👻💻

Webwright is more than just a terminal shell—it's a transformative tool that gets things done, plain and simple.

In the early days of computing, the command line was king. Webwright is for the tinkerers and hackers who remember that raw power. It taps into that primal, user-first ethos, acting as a ghost in your shell: an AI that speaks your language and understands your needs.

With Webwright, you're in control. Generate code, manage projects, deploy apps, and automate tasks—all from your terminal. It's the tool that puts power back in your hands.

This is computing at its rawest, most powerful, and most liberating.

Are you ready to unleash the ghost in your shell?

🔑 API Requirements

Webwright requires an API token from either OpenAI or Anthropic to function. You can obtain these tokens from:

Please ensure you have at least one of these API keys before proceeding with the installation.

We are strongly hoping to have support for Ollama soon.

🚀 Key Features

  • 🌐 AI-Powered Web Development: Craft and launch websites with intelligent, AI-driven tools.
  • 💻 Smart Code Generation: Let AI write code for you, boosting productivity and innovation.
  • 📊 Effortless Project Management: Seamlessly create and oversee projects with AI assistance.
  • 🔄 Integrated Version Control: Push your code to GitHub without leaving the terminal.
  • 🐳 Docker at Your Fingertips: Effortlessly spin up and manage Docker containers.
  • 🌐 Browser Magic: Automate web tasks and open URLs (or other apps) with simple commands.
  • 🔧 Infinitely Extensible: Customize your shell with bespoke commands and scripts.

🛠️ Installation

Webwright requires Anaconda and Docker to be configured on your system.

  1. Install Webwright

    pip install webwright
    
  2. Set up dependencies

Webwright requires Anaconda and Docker to be configured on your system.

  1. Create and activate a Conda environment

    conda create -n webwright python=3.8
    conda activate webwright
    
  2. Install Git Ensure Git is installed in your Conda environment:

    conda install git
    
  3. Start Webwright

    webwright
    

Getting Started

Once installed, you can start using Webwright by simply typing webwright in your terminal. Here's a quick overview of some commands:

Open URLs in Your Browser

open hackernews

Create a New Project

create project my-project

Generate Code

generate code --type python --output my_script.py

Commit to GitHub

git commit -m "Initial commit"

Start Docker Containers

docker start my-container

AI-Powered Code Generation

Webwright can generate complex code snippets using AI. For example, to generate a fractal:

generate fractal --size 20

Example: Fractal Generation

Here's an example of a Python code snippet generated by Webwright to create a mandlebrot fractal:

import matplotlib.pyplot as plt
import numpy as np

# Function to compute the Mandelbrot set
def mandelbrot(c, max_iter):
    z = c
    for n in range(max_iter):
        if abs(z) > 2:
            return n
        z = z*z + c
    return max_iter

# Generate the fractal
def generate_fractal(size):
    # Determine the plot boundaries
    x_min, x_max = -2.5, 1.5
    y_min, y_max = -2.0, 2.0

    width, height = (size*100, size*100)  # Increase resolution by multiplying size by 100
    x, y = np.linspace(x_min, x_max, width), np.linspace(y_min, y_max, height)
    fractal = np.zeros((width, height))

    for i in range(width):
        for j in range(height):
            fractal[i, j] = mandelbrot(complex(x[i], y[j]), 256)

    plt.imshow(fractal.T, extent=[x_min, x_max, y_min, y_max], cmap='hot')
    plt.colorbar()
    plt.title("Mandelbrot Fractal")
    plt.show()

# Generate a fractal of the given size
generate_fractal(20)

Output

Fractal

Developer Installation

For developers who want to install Webwright for testing, building, and running from source:

  1. Clone the Repository

    git clone https://github.com/MittaAI/webwright.git
    cd webwright
    
  2. Set up Conda Environment

    conda create -n webwright python=3.10
    conda activate webwright
    
  3. Install Dependencies

    pip install -r requirements.txt --no-deps -U chroma-hnswlib==0.7.3
    
  4. Install Git (if not already installed)

    conda install git
    
  5. Add GITHUB_TOKEN to Environment

    $env:GITHUB_TOKEN = "your_github_token"
    
  6. Run Webwright from Source

    python webwright/main.py
    

Conda Initialization in VSCode

If you are using VSCode and need to get conda working in the editor, you might need to run the following command from the condabin directory:

./conda init powershell

This will set up the necessary configuration for conda to work properly within VSCode terminal sessions.

Building and Testing

To build and test Webwright:

  1. Install Development Dependencies Install all dependencies except chroma-hnswlib (current version has issues)
pip install -r <(grep -v chroma-hnswlib requirements.txt)

Install the specific version of chroma-hnswlib

pip install --no-deps chroma-hnswlib==0.7.3

Install remaining dependencies

pip install -r requirements.txt
  1. Run Tests
    pytest
    

NOT WORKING.

  1. Build Package
    python setup.py sdist bdist_wheel
    

Git Setup for Developers

If you're planning to contribute to Webwright, make sure to set up your Git environment:

  1. Configure Git

    git config --global user.name "Your Name"
    git config --global user.email "your.email@example.com"
    
  2. Create a New Branch for Your Changes

    git checkout -b feature/your-feature-name
    
  3. Make Your Changes and Commit

    git add .
    git commit -m "Description of your changes"
    
  4. Push Your Changes and Create a Pull Request

    git push origin feature/your-feature-name
    

    Then, go to the GitHub repository and create a pull request for your branch.

Remember to always pull the latest changes from the main branch before starting your work:

git checkout main
git pull origin main

For more detailed contribution guidelines, please refer to our CONTRIBUTING.md file.

Documentation

For detailed usage instructions and examples, visit the Webwright Documentation.

Contributing

Webwright is an open-source project. We welcome contributions!

Community and Support

Join our community on Slack for support, discussions, and to share your ideas and feedback.

License

Webwright is open-source software licensed under the MIT License.

© Mitta Corp. All rights reserved 2024.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

webwright-0.0.7.tar.gz (58.5 kB view details)

Uploaded Source

Built Distribution

webwright-0.0.7-py3-none-any.whl (70.5 kB view details)

Uploaded Python 3

File details

Details for the file webwright-0.0.7.tar.gz.

File metadata

  • Download URL: webwright-0.0.7.tar.gz
  • Upload date:
  • Size: 58.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for webwright-0.0.7.tar.gz
Algorithm Hash digest
SHA256 1f64707326b1a938b24d7125001eb868a528a66855569df11a2e24acf5746ea3
MD5 0fb84c621a99f71db11d974b799dc3db
BLAKE2b-256 dbd8003ad050489b34c0a3ed9731b9f305f82c29bb3cabb33555a94978c9ead9

See more details on using hashes here.

File details

Details for the file webwright-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: webwright-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 70.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for webwright-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 cb9221e89401010d8aefd30e4a084530a918b99dce625fbd0394a785a147dadb
MD5 bbe92151232a4e248698e6fc4325c22d
BLAKE2b-256 21299234857032d948c9d0f9ac8cc980137c1b02e637cda83cc6b1074c90b250

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page