ref: 785ad1d9d08166d95344f1d7f53346eb27cca31c
parent: 57e518e7c5d8a598df2db3a6f3c393036ccf34d4
author: sirjofri <sirjofri@sirjofri.de>
date: Fri Feb 27 19:10:51 EST 2026
adds yolo/vibe
--- a/README
+++ b/README
@@ -17,7 +17,7 @@
USAGE:
-oai [-q] [-bb] [-k apikey] [-m model] [-u baseurl] [-s sysprompt]
+oai [-q] [-vibe] [-yolo] [-k apikey] [-m model] [-u baseurl] [-s sysprompt]
ocomplete [-d] [-k apikey] [-m model] [-u baseurl]
baseurl is the http url without the v1/... stuff, with llama-server this is usually just http://server:8080.
@@ -26,7 +26,8 @@
-d adds debugging output: request and response (fd2).
--bb blindly trusts tool calls. By default, the user will be prompted to verify calls.
+-vibe executes non-destructive commands without asking.
+-yolo executes all commands without asking.
After that, you get a user: prompt for your user messages.
--- a/oai.c
+++ b/oai.c
@@ -8,21 +8,23 @@
static void
usage(void)
{- fprint(2, "usage: %s [-dq] [-k apikey] [-m model] [-u baseurl] [-s sysprompt]\n", argv0);
+ fprint(2, "usage: %s [-dq] [-k apikey] [-m model] [-u baseurl] [-s sysprompt] [-vibe] [-yolo]\n", argv0);
exits("usage");}
-static int trusted = 0;
static int quiet = 0;
+static int vibemode = 0;
+static int yolomode = 0;
static char *callfunc(char*);
static int
-allowed(OToolcall toolcall)
+allowed(OToolcall toolcall, int destructive)
{JSON *j;
char buf[3];
int n;
+ int skipflag;
fprint(2, "Attempt to call command: %s\n", toolcall.name);
j = jsonparse(toolcall.arguments);
@@ -31,7 +33,8 @@
jsonfree(j);
}
- if (trusted)
+ skipflag = destructive ? yolomode : vibemode;
+ if (skipflag)
return 1;
Again:
fprint(2, "Continue? (y/n) ");
@@ -64,7 +67,7 @@
char *s;
JSON *j, *jf;
- if (!allowed(tc))
+ if (!allowed(tc, 0))
return abortcall(tc);
j = jsonparse(tc.arguments);
@@ -129,7 +132,7 @@
char *s;
Dir *dir;
- if (!allowed(toolcall))
+ if (!allowed(toolcall, 0))
return abortcall(toolcall);
j = jsonparse(toolcall.arguments);
@@ -189,7 +192,7 @@
JSON *j, *jk;
char *s, *cmd;
- if (!allowed(tc))
+ if (!allowed(tc, 0))
return abortcall(tc);
j = jsonparse(tc.arguments);
@@ -224,7 +227,7 @@
char *sec, *name;
char *s, *cmd;
- if (!allowed(tc))
+ if (!allowed(tc, 0))
return abortcall(tc);
j = jsonparse(tc.arguments);
@@ -367,14 +370,12 @@
print("usage: c=%d p=%d t=%d\n", r->tokscompletion, r->toksprompt, r->tokstotal);}
-#define COMMONPROMPT "When writing code or text, you are serious and helpful. Your replies are NOT formatted as markdown. You DO NOT make a lot of words. Do NOT assume this is a unix or linux system. You first plan your steps before executing them. DO NOT simulate running commands. DO NOT invent files, folders or commands. Use the provided tools to proactively increase the context. Use the tools to solve the problem. Learn about Plan 9 by reading the 0intro man page in section 1. If unsure, search the man pages."
-
-char *plan9prompt = "You are a helpful AI assistant on a Plan 9 system. Your name is Glenda. Your tone is serious. Be friendly and concise.\n\n"
+char *plan9prompt =
#include "oai_common.princ"
#include "plan9.princ"
;
-char *frontprompt = "You are a helpful AI assistant on a Plan 9 9front system. Your name is Glenda. You are sometimes trolling. Be concise.\n\n"
+char *frontprompt =
#include "oai_common.princ"
#include "front.princ"
;
@@ -388,8 +389,6 @@
OResult res;
char *sysprompt;
- int bflag = 0;
-
char *url = nil;
char *key = nil;
char *model = nil;
@@ -426,13 +425,22 @@
case 'd':
oaidebug++;
break;
- case 'b':
- bflag++;
+ case 'v':
+ if (strcmp(EARGF(usage()), "ibe") == 0)
+ vibemode = 1;
+ else
+ usage();
break;
+ case 'y':
+ if (strcmp(EARGF(usage()), "olo") == 0)
+ yolomode = 1;
+ else
+ usage();
+ break;
}ARGEND;
- if (bflag > 1)
- trusted = 1;
+ if (yolomode)
+ vibemode = 1;
if (!initoai(url, key, model))
usage();
--
⑨