Created pip package

This commit is contained in:
2022-12-01 18:31:36 +01:00
parent 2dd68657f7
commit 09f9129e58
5 changed files with 38 additions and 50 deletions

View File

@@ -4,6 +4,8 @@ import os
import sys
import time
from os.path import expanduser
import click
# get a new github copilot token
def get_token():
@@ -105,14 +107,14 @@ def get_suggestion(prompt, token):
return "Command not found"
# cursor_position_char = int(sys.argv[1])
@click.group()
def main():
pass
# Read the input prompt from stdin.
# buffer = sys.stdin.read()
buffer = 'change python version to 3.10'
# ---
prompt_prefix = "!/bin/bash\n\n" + buffer + ":\n"
token = get_token()
print(get_suggestion(prompt_prefix, token))
@main.command()
@click.argument('prompt', nargs=-1)
def generate_suggestion(prompt):
prompt = " ".join(prompt)
prompt = "!/bin/bash\n\n" + prompt + ":\n"
token = get_token()
print(get_suggestion(prompt, token))