scripts: rename s/job -> b/job; b/q and b/sched wrap b/job

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Levi Neely 2026-04-18 12:14:14 +02:00
parent 718fabf500
commit 9da56b0622
6 changed files with 16 additions and 16 deletions

2
9p

@ -1 +1 @@
Subproject commit 0c3f4e8e4acd788bacac42b585ead262ab20a46c
Subproject commit 4a42002a0f594f2d11103922b1995b139b97675b

2
mkfile
View File

@ -41,9 +41,9 @@ scripts:V:
mkdir -p $HOME/.config/ollie/scripts/s $HOME/.config/ollie/scripts/b $HOME/.config/ollie/scripts/u
chmod 755 $HOME/.config/ollie/scripts/u
cp -f scripts/s/sh $HOME/.config/ollie/scripts/s/sh
cp -f scripts/s/job $HOME/.config/ollie/scripts/s/job
cp -f scripts/s/ls $HOME/.config/ollie/scripts/s/ls
cp -f scripts/s/kill $HOME/.config/ollie/scripts/s/kill
cp -f scripts/b/job $HOME/.config/ollie/scripts/b/job
cp -f scripts/b/q $HOME/.config/ollie/scripts/b/q
cp -f scripts/b/sched $HOME/.config/ollie/scripts/b/sched
cp -f scripts/u/optimize $HOME/.config/ollie/scripts/u/optimize

View File

@ -8,7 +8,7 @@ mounted filesystem under `s/`, so they are available without any `$PATH` changes
```sh
exec $OLLIE/s/sh # start interactive shell
$OLLIE/s/job "my prompt" # batch job (foreground)
$OLLIE/b/job "my prompt" # submit and wait for a batch job
$OLLIE/b/q "my prompt" # foreground one-shot query
$OLLIE/b/sched "my prompt" # background job; prints b/ path
$OLLIE/s/ls # list sessions
@ -68,15 +68,15 @@ s/sh -session 1745123456-abc # attach to a specific session
---
## s/job
## b/job
Non-interactive one-shot query. Submits a prompt to `b/new`, waits for
completion, prints the result to stdout, then removes the job. Exit code
is non-zero on failure.
```
s/job [flags] [prompt...]
echo "prompt" | s/job [flags]
b/job [flags] [prompt...]
echo "prompt" | b/job [flags]
```
**Flags**
@ -95,11 +95,11 @@ echo "prompt" | s/job [flags]
**Examples**
```sh
s/job "Summarize this repo in one sentence"
cat error.log | s/job "What is causing this error?"
s/job -output json "List the top 3 risks as JSON"
s/job -parallel 4 -keep "Write a haiku about filesystems"
s/job -backend ollama -model qwen3:8b "Explain this function" < main.go
b/job "Summarize this repo in one sentence"
cat error.log | b/job "What is causing this error?"
b/job -output json "List the top 3 risks as JSON"
b/job -parallel 4 -keep "Write a haiku about filesystems"
b/job -backend ollama -model qwen3:8b "Explain this function" < main.go
```
With `-parallel N` and N > 1, results are separated by `=== {id} ===` headers.
@ -128,14 +128,14 @@ s/kill <id>
## b/q
Foreground one-shot query; thin wrapper around `s/job`. Output goes to stdout.
Foreground one-shot query; thin wrapper around `b/job`. Output goes to stdout.
```
b/q [flags] [prompt...]
echo "prompt" | b/q [flags]
```
Accepts the same flags as `s/job`.
Accepts the same flags as `b/job`.
---

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# oq: non-interactive ollie query via b/ namespace.
# b/job: non-interactive ollie query via b/ namespace.
#
# Usage: oq [flags] [prompt...]
# echo "prompt" | oq [flags]

View File

@ -20,4 +20,4 @@ cmd=${0##*/}
if [ $# -eq 0 ] && [ -t 0 ]; then
printf '%s: prompt required: pass as arguments or pipe via stdin\n' "$cmd" >&2; exit 1
fi
exec "${0%/*}/../s/job" "$@"
exec "${0%/*}/job" "$@"

View File

@ -21,6 +21,6 @@ if [ $# -eq 0 ] && [ -t 0 ]; then
printf '%s: prompt required: pass as arguments or pipe via stdin\n' "$cmd" >&2; exit 1
fi
OLLIE=${OLLIE:-$HOME/mnt/ollie}
"${0%/*}/../s/job" -bg "$@" | while IFS= read -r id; do
"${0%/*}/job" -bg "$@" | while IFS= read -r id; do
[ -n "$id" ] && printf '%s/b/%s\n' "$OLLIE" "$id"
done