This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
llmc() { | |
local system_prompt='Output a command that I can run in a ZSH terminal on macOS to accomplish the following task. Try to make the command self-documenting, using the long version of flags where possible. Output the command first enclosed in a "```zsh" codeblock followed by a concise explanation of how it accomplishes it.' | |
local temp_file=$(mktemp) | |
local capturing=true | |
local command_buffer="" | |
local first_line=true | |
local cleaned_up=false # Flag to indicate whether cleanup has been run | |
cleanup() { | |
# Only run cleanup if it hasn't been done yet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# dependencies = [ | |
# "httpx", | |
# "pyjwt[crypto]", | |
# ] | |
# /// | |
from dataclasses import dataclass | |
from datetime import timedelta | |
from typing import Any |