Skip to content

Instantly share code, notes, and snippets.

View nunodonato's full-sized avatar

Nuno Donato nunodonato

View GitHub Profile
@nunodonato
nunodonato / terminal-ai.py
Created November 25, 2021 10:32
Use openai codex to translate natural language into shell commands
import os
import openai
import sys
openai.api_key = "YOUR-OPENAI-KEY"
# get all command line arguments into one string
prompt = " ".join(sys.argv[1:])
response = openai.Completion.create(
<?xml version="1.0" encoding="UTF-8"?>
-<Package xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build" IgnorableNamespaces="uap mp build" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10">
<Identity ProcessorArchitecture="x64" Version="1.2.2.0" Publisher="Nuno Donato" Name="Godot.Engine"/>
<mp:PhoneIdentity PhonePublisherId="00000000-0000-0000-0000-000000000000" PhoneProductId="00001000-0000-0000-0000-000000000000"/>
-<Properties>