add copy function

This commit is contained in:
Hayden Johnson 2025-04-25 16:22:41 -07:00
parent 96ffcae953
commit 30f2585d33

View file

@ -67,6 +67,11 @@ def parse_commands(text):
context_query = '\n\nThe following is context provided by the user:\n'
context_query += get_string_from_clipboard() + '\n'
return text.split('/clipboard ')[1] + context_query
case '/copy':
blocks = extract_code_block(history[-1]['content'])
if len(blocks):
copy_string_to_clipboard(blocks[0])
return True
case '/exit':
exit()
return False