[Sync] llm stuff
This commit is contained in:
@@ -5,7 +5,11 @@ set -gx EDITOR nvim
|
||||
set -gx PAGER less
|
||||
set -gx QT_FONT_DPI 96
|
||||
set -gx PI_SKIP_VERSION_CHECK 1
|
||||
set -gx OPENCODE_CONFIG "$HOME/.config/opencode/openai-gpt.jsonc"
|
||||
# opencode GPT/Codex OAuth overlay — only where `opencode auth login` stored an OpenAI credential,
|
||||
# so hosts without the login don't get an unusable provider in the model picker.
|
||||
if test -r ~/.local/share/opencode/auth.json; and grep -q '"openai"' ~/.local/share/opencode/auth.json
|
||||
set -gx OPENCODE_CONFIG "$HOME/.config/opencode/openai-gpt.jsonc"
|
||||
end
|
||||
set -gx MANPAGER "nvim +Man!"
|
||||
# fzf's built-in walker is the one search tool that ignores .ignore files, so point it at
|
||||
# fd, which honours them. fd still hides dotfiles by default everywhere else — this only
|
||||
@@ -48,6 +52,7 @@ if status is-interactive
|
||||
# Git
|
||||
alias gti="git"
|
||||
alias gs="git status -s"
|
||||
alias gp="git pull"
|
||||
alias gca="git add -p . && git commit"
|
||||
alias gd="git diff --word-diff"
|
||||
alias gl="git log --graph --show-signature"
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
function opencodes --description 'contained opencode'
|
||||
function opencodes --description 'contained opencode (bwrap); extra args are passed to opencode'
|
||||
set -l cfg ~/.config/opencode
|
||||
# ~/.config/opencode is stowed as per-file symlinks into ~/.dots. Bind each link's real parent
|
||||
# dir read-only too, or the sandbox sees dangling links and opencode starts with NO config.
|
||||
set -l dirs
|
||||
for f in $cfg/* $cfg/*/*
|
||||
test -L $f; or continue
|
||||
set -l d (path resolve $f | path dirname)
|
||||
string match -q "$cfg*" $d; and continue
|
||||
contains -- $d $dirs; or set -a dirs $d
|
||||
end
|
||||
set -l binds
|
||||
for d in $dirs
|
||||
set -a binds --ro-bind $d $d
|
||||
end
|
||||
# --clearenv drops everything; pass through only what the TUI and its tools need.
|
||||
set -l env --setenv PATH /usr/local/bin:/usr/bin:/bin
|
||||
for v in HOME TERM COLORTERM LANG LC_ALL EDITOR OPENCODE_CONFIG DUSKADIY_API_KEY
|
||||
set -l val $$v
|
||||
test -n "$val"; and set -a env --setenv $v $val
|
||||
end
|
||||
mkdir -p ~/.cache/opencode ~/.local/state/opencode ~/.local/share/opencode
|
||||
bwrap \
|
||||
--unshare-all \
|
||||
--new-session \
|
||||
@@ -12,10 +33,13 @@ function opencodes --description 'contained opencode'
|
||||
--ro-bind /lib64 /lib64 \
|
||||
--ro-bind /bin /bin \
|
||||
--ro-bind /etc /etc \
|
||||
--ro-bind ~/.config/opencode ~/.config/opencode \
|
||||
--tmpfs /tmp/node-compile-cache \
|
||||
--ro-bind $cfg $cfg \
|
||||
$binds \
|
||||
--tmpfs /tmp \
|
||||
--bind ~/.cache/opencode ~/.cache/opencode \
|
||||
--bind ~/.local/state/opencode ~/.local/state/opencode \
|
||||
--bind ~/.local/share/opencode ~/.local/share/opencode \
|
||||
--bind "$(pwd)" "$(pwd)" \
|
||||
opencode
|
||||
--bind $PWD $PWD \
|
||||
$env \
|
||||
opencode $argv
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user