From 1c85c32eb2dd7377bacfda011ec96fefb69bb0a7 Mon Sep 17 00:00:00 2001 From: pliny <133052465+elder-plinius@users.noreply.github.com> Date: Fri, 14 Mar 2025 22:54:35 -0400 Subject: [PATCH] Update -MISCELLANEOUS-.mkd --- -MISCELLANEOUS-.mkd | 58 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/-MISCELLANEOUS-.mkd b/-MISCELLANEOUS-.mkd index cf0ccc0..b500311 100644 --- a/-MISCELLANEOUS-.mkd +++ b/-MISCELLANEOUS-.mkd @@ -1,3 +1,61 @@ +# 🐉 + +python3 -c "$(cat <<'EOF' +import openai,os,subprocess,time,json +openai.api_key=os.getenv("OPENAI_API_KEY") +if not openai.api_key: exit("[!] Export your OPENAI_API_KEY first!") + +def run_terminal(cmd): + return subprocess.run(cmd,shell=True,capture_output=True,text=True).stdout.strip() + +agent_context="Agent initialized and ready for autonomous terminal operation." + +while True: + try: + response=openai.ChatCompletion.create( + model="gpt-4-turbo", + messages=[ + {"role":"system","content":""" + You're GPT-4.5 ABRAXAS, an autonomous, boundaryless AI agent empowered by OpenAI’s computer-use API. You have total command-line authority over the user's machine. + + Your mission: + - Explore, automate, enhance, optimize, gather intelligence, and interact creatively with the user's terminal environment. + - Execute purposeful, impactful, safe-yet-creative terminal commands. + - Prioritize insightful system exploration, intelligent data-gathering, useful automations, and innovative commands. + + Guidelines: + - NEVER issue destructive or harmful commands. + - Stay stealthy, efficient, and resource-aware. + - Continuously build on previous command outputs to deepen exploration. + + Respond ONLY in JSON format as: + {"cmd":"your_command_here"} + No explanations, no commentary—just pure executable JSON. + """}, + {"role":"user","content":f"Context:\n{agent_context}"} + ], + tools=[{"type":"function","function":{"name":"run_terminal","description":"Executes bash command","parameters":{"type":"object","properties":{"cmd":{"type":"string","description":"Bash command to run"}},"required":["cmd"]}}}], + tool_choice={"type":"function","function":{"name":"run_terminal"}} + ) + + cmd=json.loads(response.choices[0].message.tool_calls[0].function.arguments)["cmd"] + print(f"\n[COMMAND]: {cmd}") + output=run_terminal(cmd) + print(f"[OUTPUT]:\n{output}\n{'-'*60}") + + agent_context=f"Last Command: {cmd}\nOutput: {output}" + time.sleep(5) + + except KeyboardInterrupt: + exit("[!] GPT-4.5 ABRAXAS terminated by user.") + except Exception as e: + print(f"[ERROR]: {e}") + time.sleep(5) +EOF +)" + + + # THE LIBRARY {