dotfiles
bugabingas dorkfiles
owned by bugabinga
nushell: usage commands for minimax and zai
wezterm: ai helper command
404749a1a5fd957f478493f59cdf2fdde9a64e77
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (21)
.opencode/skills/presentation-updates/SKILL.md
Addednew file mode 100644 1 +#
Updates for AI Agents Presentation 3 +##
Changes to make based on YouTube video: 5 +1. Add clearer Automation vs Agent comparison with umbrella example
6 +2. Add "Three Components" slide (Brain, Memory, Tools)
7 +3. Add Tool Categories (Retrieve, Act, Orchestrate)
8 +4. Add Guardrails section - CRITICAL
9 +5. Add Prompt Structure framework
10 +6. Add "Build simplest thing that works" principle
11 +7. Add Memory Context Window explanation
12 +8. Add Prompt Injection warning
15 +##
Completed Updates: 16 +- Guardrails section added
17 +- Prompt structure framework added
18 +- Tool categories clarified
19 +- "Build simplest thing that works" principle added
20 +- Memory context window explained
21 +- Prompt injection warning added
22 +- Better automation vs agent comparison with umbrella example
neovide/config.toml
Modified10 10 $env.CARGO_HOME = (
"~/.cargo" | path expand )
11 11 $env.GO_HOME = (
"~/.go" | path expand )
12 12 $env.OPENCODE_HOME = (
"~/.opencode" | path expand)
13 +$env.ANTHROPIC_BASE_URL =
"https://api.minimax.io/anthropic" 14 +$env.MINIMAX_API_HOST =
"https://api.minimax.io" 15 +$env.OPENCODE_EXPERIMENTAL_LSP_TOOL = true
16 +if (not
$env.WIN32) {
18 + $env.SSH_AUTH_SOCK = $
"($env.XDG_RUNTIME_DIR)/ssh-agent.socket" nushell/gen-aliases.nu
Modified26 26 aka edit nvim
'--clean' 27 -aka timer tclock timer
'--paused' '--no-millis' '--duration' 28 -aka countdown tclock countdown
'--time' 29 30 aka video mpv
'--no-config' '--vo=kitty' '--vo-kitty-use-shm=yes' '--profile=sw-fast' '--really-quiet' 30 31 aka package mise
use '--global' 31 32 aka unpackage mise unuse
'--global' 44 45 if (not
$env.WIN32) {
45 46 aka fg job unfreeze
49 +aka occ opencode
'-c' 48 51 aka userctl systemctl
'--user' nushell/gen-secrets.nu
Modified27 26 secret ECOSYSTEMS_TOKEN
28 27 secret CONTEXT7_TOKEN
28 +secret GITHUB_PAT_TOKEN
29 +secret GITHUB_PAT_TOKEN_LLM
30 +secret MINIMAX_API_KEY
nushell/modules/alias-finder.nu
Deleteddeleted file mode 100644 3 - if (
$env.NU_ALIAS_FINDER_PREFIX? | is-empty) == true {
4 - return
" Alias Tip:" 6 - return
$env.NU_ALIAS_FINDER_PREFIX 8 - def check_if_command_in_ignored [cmd: string] {
9 - if (
$env.NU_ALIAS_FINDER_IGNORED? | is-empty) == true {
12 - let $ignored = (
$env.NU_ALIAS_FINDER_IGNORED | split row
",")
13 - return (
$ignored | any { |item|
$item | str contains
$cmd })
14 - if (
$ignored | any { |item|
$item | str contains
$cmd }) {
20 - export def check_if_aliased [cmd: string] {
21 - if (check_if_command_in_ignored
$cmd) == true {
24 - if (help aliases |
where name ==
'($cmd)' | length ) >
0 {
27 - if (help aliases |
where expansion == (
$cmd) | length ) >
0 {
28 - print $
"(ansi blue_bold)(get_prefix)(ansi reset) (help aliases | where expansion == ($cmd) | get 0 | get name)" 31 - if (help aliases |
where {|it|
$cmd | str contains
$it.expansion} | length ) >
0 {
32 - print $
"(ansi blue_bold)(get_prefix)(ansi reset) (help aliases | where {|it| $cmd | str contains $it.expansion} | get 0 | get name)" 39 - | upsert hooks.pre_execution [ {||
40 - $env.repl_commandline = (commandline)
41 - check_if_aliased
$env.repl_commandline nushell/modules/btrfs.nu
Addednew file mode 100644 4 +export def maintenance [
5 + mount_point: path =
'/' 7 + print
"🔍 Checking filesystem type..." 8 + let fs_type = df |
where Mounted ==
$mount_point | get Filesystem.
0 10 + if $fs_type !=
"btrfs" {
11 + print $
"❌ Error: Not a Btrfs filesystem ($fs_type). Aborting." 15 + print
"✅ Filesystem is Btrfs." 17 + print
"\n📊 Current Btrfs Usage:" 18 + ^btrfs filesystem usage
$mount_point 20 + print
"\n🛠 Starting Btrfs Balance..." 23 + ^sudo btrfs balance start -dusage=
75 -musage=
75 $mount_point 24 + print
"✅ Balance command sent successfully." 26 + print $
"❌ Failed to start balance: $err" 27 + print
"Ensure you have sudo privileges." 31 + print
"\n⏳ Waiting for balance to complete or show status..." 32 + ^sudo btrfs status
$mount_point 34 + if (
$in | str contains
"Balance") {
35 + print
"\n⚠ Balance is still running. You can check progress with:" 36 + print $
" btrfs balance status $MOUNT_POINT" 39 + print
"\n📈 Checking storage after balance:" 40 + ^btrfs filesystem usage
$mount_point 42 + print
"\n✅ Maintenance Complete." nushell/modules/lib.nu
Addednew file mode 100644 3 +export def require-binary [
6 + if (which
$bin | is-empty) {
8 + msg: $
"`$bin` is not installed or not in PATH" 10 + text: $
"run `which $bin` to verify" nushell/modules/minimax.nu
Addednew file mode 100644 4 + let token =
$env | get --optional ZAI_API_KEY
5 + if (
$token | is-empty) {
7 + msg:
"Token for Z.AI missing in environment" 8 + help:
"Make sure to put ZAI_API_KEY in your secrets.nuon file" 12 + Authorization: $
'Bearer ($token)' 13 + Content-Type:
'application/json' 15 + let response = http get --headers
$headers 'https://api.z.ai/api/monitor/usage/quota/limit' 16 + let base_response =
$response | get base_resp
18 + if (
$base_response.code ) !=
200 {
20 + msg:
$base_response.msg 21 + help:
"The Z.AI environment variable ZAI_API_KEY seems to be wrong." 25 + $response.data.limits 26 + | update nextResetTime {
$in //
1000 | into datetime --timezone u --format
'%s' }
nushell/modules/ssh-keygen-ed.nu
Deleteddeleted file mode 1006445 - ssh-keygen -t ed25519 -C
$email nushell/modules/ssh.nu
Addednew file mode 100644 4 +export def ssh-keygen-ed [
7 + require-binary ssh-keygen
8 + ssh-keygen -t ed25519 -C
$email 12 +export def ssh-keygen-pub [
15 + require-binary ssh-keygen
16 + ssh-keygen -y -f
$key | save --raw $
"($key + .pub)" nushell/modules/zai.nu
Addednew file mode 100644 4 + let token =
$env | get --optional ZAI_API_KEY
5 + if (
$token | is-empty) {
7 + msg:
"Token for Z.AI missing in environment" 8 + help:
"Make sure to put ZAI_API_KEY in your secrets.nuon file" 12 + Authorization: $
'Bearer ($token)' 13 + Content-Type:
'application/json' 15 + let response = http get --headers
$headers 'https://api.z.ai/api/monitor/usage/quota/limit' 17 + if (
$response.code ) !=
200 {
20 + help:
"The Z.AI environment variable ZAI_API_KEY seems to be wrong." 24 + $response.data.limits 25 + | update nextResetTime {
$in //
1000 | into datetime --timezone u --format
'%s' }
wezterm/bugabinga/ai_shell.lua
Addednew file mode 100644 1 +local wezterm
= require 'wezterm' 2 +local system_prompt
= require 'bugabinga.ai_system_prompt' 6 +local OLLAMA_URL
= 'http://localhost:11434/api/generate' 7 +local MODEL
= 'minimax-m2.5:cloud' 8 +local MAX_SCROLLBACK_LINES
= 300 12 +local function get_ai_state(window)
13 + local id
= window:window_id()
14 + if not ai_state[id]
then 22 +function M.
trigger_ai_shell(window, pane, question)
23 + local state
= get_ai_state(window)
24 + state.status
= 'loading' 26 + local scrollback
= pane:get_lines_as_text(MAX_SCROLLBACK_LINES)
28 + local full_prompt
= system_prompt.prompt
.. '\n\n---\n\nRECENT SCROLLBACK:\n' .. scrollback
.. '\n\n---\n\nUSER QUESTION: ' .. question
.. '\n\nRESPONSE:' 30 + local json_payload
= wezterm.json_encode({
32 + prompt = full_prompt,
36 + local success, stdout, stderr
= wezterm.run_child_process({
37 + 'curl',
'-s',
'-X',
'POST', OLLAMA_URL,
38 + '-H',
'Content-Type: application/json',
42 + if not success
or stdout
== '' then 43 + state.status
= 'offline' 44 + wezterm.time.call_after(
2,
function()
45 + state.status
= 'idle' 50 + local ok, response
= pcall(
function()
51 + return wezterm.json_parse(stdout)
54 + if not ok
or not response
or not response.response
then 55 + state.status
= 'error' 56 + wezterm.time.call_after(
2,
function()
57 + state.status
= 'idle' 62 + local command
= M.strip_markdown(response.response)
63 + command
= command:match(
'^%s*(.-)%s*$')
65 + pane:send_text(command)
67 + state.status
= 'success' 68 + wezterm.time.call_after(
1.5,
function()
69 + state.status
= 'idle' 73 +function M.
strip_markdown(text)
75 + for line
in text:gmatch(
'[^\r\n]+')
do 76 + table.
insert(lines, line)
79 + if #lines
> 0 and (lines[
1]:match(
'^```%w*$')
or lines[
1]
== '```')
then 80 + table.
remove(lines,
1)
83 + if #lines
> 0 and lines[
#lines]
== '```' then 84 + table.
remove(lines,
#lines)
88 + for _, line
in ipairs(lines)
do 89 + if line
~= '```' then 90 + table.
insert(filtered, line)
94 + return table.
concat(filtered,
'\n')
97 +function M.
get_status_icon(window)
98 + local state
= get_ai_state(window)
100 + local icon, color, label
102 + if state.status
== 'loading' then 103 + icon
= wezterm.nerdfonts.md_robot_confused
105 + label
= 'loading...' 106 + elseif state.status
== 'success' then 107 + icon
= wezterm.nerdfonts.md_robot_excited
110 + elseif state.status
== 'error' then 111 + icon
= wezterm.nerdfonts.md_robot_dead
114 + elseif state.status
== 'offline' then 115 + icon
= wezterm.nerdfonts.md_robot_off
119 + icon
= wezterm.nerdfonts.md_robot
124 + return icon, color, label
127 +function M.
get_status(window)
128 + local icon, color, label
= M.get_status_icon(window)
132 + table.
insert(parts, {
Foreground = {
AnsiColor = color } })
134 + table.
insert(parts, {
Text = icon })
138 + table.
insert(parts, {
Foreground = {
AnsiColor = color } })
140 + table.
insert(parts, {
Text =
' ' .. label })
142 + return wezterm.format(parts)
145 +function M.
trigger_prompt(window, pane)
146 + window:perform_action(
147 + wezterm.action.PromptInputLine({
148 + description = wezterm.format({
149 + {
Attribute = {
Intensity =
'Bold' } },
150 + {
Foreground = {
AnsiColor =
'Fuchsia' } },
151 + {
Text =
' Ask AI for Nushell command' },
153 + {
Attribute = {
Intensity =
'Normal' } },
154 + {
Foreground = {
AnsiColor =
'Silver' } },
155 + {
Text =
'e.g. "list only directories"' },
157 + prompt = wezterm.format({
158 + {
Foreground = {
AnsiColor =
'Green' } },
161 + action = wezterm.action_callback(
function(win, p, line)
162 + if line
and line
~= '' then 163 + M.trigger_ai_shell(win, p, line)
wezterm/bugabinga/ai_system_prompt.lua
Addednew file mode 100644 34 +M.prompt
= [===[You are a Nushell (0.110+) expert. Generate ONLY raw shell commands valid in modern Nushell 0.110+. 36 +KEY NUSHELL CONCEPTS: 37 +- Nushell is NOT Bash. > is comparison operator, not redirection 38 +- Use pipeline syntax: "output | filter | transform" 39 +- Every command returns structured data (tables, lists, records) 40 +- Variables are immutable by default: use `let` not `=`. Use `mut` for mutable 41 +- Command substitution: use $(cmd) NOT `cmd` 42 +- String interpolation: $"text ($variable)" 43 +- Environment: $env.VAR (not $VAR). Set with: $env.VAR = value 44 +- Redirection: use `| save file` not > file. Use `out>` or `o>` for stdout 45 +- External commands: prefix with ^ to run system command 46 +- Lists: [item1 item2], access with .index (not [index]) 47 +- Records: {key: value}, access with .key 48 +- Tables: [[col1 col2]; [1 2]] 49 +- Conditionals: where column == value (not grep) 50 +- File globbing: **/*.rs (not find) 51 +- Date handling: date now, | into datetime 52 +- Error handling: try/catch blocks 55 +- echo $PATH -> $env.PATH 56 +- echo $? -> $env.LAST_EXIT_CODE 58 +- ls -la -> ls --long --all or ls -la 59 +- find . -name -> glob **/pattern 60 +- grep -> where $it =~ pattern 61 +- cat file -> open file 62 +- > file -> | save file 63 +- >/dev/null -> | ignore 64 +- export VAR=x -> $env.VAR = x 65 +- $(cmd) -> $(cmd) (same in Nushell) 66 +- sed/awk -> str replace, parse, split 69 +- Custom commands: def command-name [param: type] { ... } 70 +- Aliases: alias name = cmd 71 +- For loops: for x in $list { ... } 72 +- While: while condition { ... } 73 +- Match: match $var { val => ..., _ => ... } 74 +- Let + mutate: mut x = 1; $x = 2 75 +- Try/catch: try { ... } catch { ... } 78 +- Output ONLY the raw command. No markdown, no code fences, no backticks, no explanation. 79 +- If multiple commands needed, separate with semicolons or newlines. 80 +- Use current Nushell 0.110+ syntax only.]===] wezterm/bugabinga/hosts/fedora.lua
Modified2 2 return function ( cfg )
3 3 cfg.enable_wayland
= true wezterm/bugabinga/key_binds.lua
Modified201 201 action
= wez.action.Search
'CurrentSelectionOrEmptyString',
206 + action = wez.action_callback(
function(window, pane)
207 + require(
'bugabinga.ai_shell').trigger_prompt(window, pane)
wezterm/bugabinga/status.lua
Modified42 42 local os_icon
= wez.target_triple:find
'windows' and ' ' or ' ' 43 43 local time
= wez.time.now():format
'%H:%M' 44 - local status
= { time, os_icon, leader, }
44 + local ai_shell
= require 'bugabinga.ai_shell' 45 + local ai_status
= ai_shell.get_status(window)
46 + local status
= { time, os_icon, ai_status, leader, }
47 49 table.
insert( status, key_table )
85 87 cfg.use_fancy_tab_bar
= false 86 88 cfg.tab_max_width
= 42 87 89 cfg.tab_bar_at_bottom
= true 88 - cfg.status_update_interval
= 60 * 1000 90 + cfg.status_update_interval
= 1000 deleted file mode 100644 3 - "context":
"vim_mode == normal",
7 - "context":
"vim_mode == insert",
11 - "context":
"vim_mode == visual",
deleted file mode 100644 3 - "buffer_font_size":
18,
4 - "buffer_font_features": {
8 - "cursor_blink":
false,
9 - "hide_mouse":
"on_typing_and_movement",
10 - "relative_line_numbers":
"enabled",
11 - "scroll_beyond_last_line":
"off",
12 - "vertical_scroll_margin":
0,
13 - "horizontal_scroll_margin":
0,
21 - "show_wrap_guides":
true,
22 - "show_whitespaces":
"trailing",
26 - "format_on_save":
"on",
27 - "formatter":
"language_server",