Giter Club home page Giter Club logo

dotsh's Introduction

dotsh

A CLI tool for generating and running bash scripts using gpt-4.

Designed and implemented using ChatGPT, inspired by this Twitter thread.

➜  ~ dotsh
A CLI tool for generating and running executable scripts based on OpenAI chat completion

Usage:
  dotsh [command]

Available Commands:
  configure   Configure API key for OpenAI
  help        Help about any command
  list        List all scripts in the script directory
  make        Generate an executable script based on OpenAI chat completion
  read        Display the contents of a script
  remove      Remove an existing script
  reset       Remove all scripts and the API key
  run         Execute a script generated by 'dotsh make'

Flags:
  -h, --help   help for dotsh

Use "dotsh [command] --help" for more information about a command.

Usage

Generate a script to check the weather.

➜  ~ dotsh make check-weather "checks the weather for a city given as an argument using wttr.in"
Generated script 'check-weather.sh'

You can now view the script that was generated.

➜  ~ dotsh read check-weather
#!/bin/bash

city=$1

if [[ -z "$city" ]]; then
    echo "Please provide a city name as an argument"
    exit 1
fi

weather=$(curl -s "wttr.in/$city?format=%C\n%t\n")

echo "Current weather in $city: $weather"

exit 0

If you're content, go ahead and run the script.

➜  ~ dotsh run check-weather mississauga
Current weather in mississauga: Rain, mist
+3°C

dotsh's People

Contributors

ededejr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.