Compare commits

5 Commits

Author SHA1 Message Date
Jason Swank
de876b706b alter color for code in markdown 2026-01-12 02:45:34 +00:00
Jason Swank
71140395b0 markdown color changes 2026-01-11 03:40:27 +00:00
Jason Swank
62e1d0117a theunixzoo has almost no relationship to upstream.... 2026-01-10 13:15:47 -05:00
Jason Swank
c0662c5044 revert to the theunixzoo 2026-01-10 13:02:14 -05:00
Jason Swank
8e86d82578 experiment w/ a new colorscheme 2026-01-10 17:33:52 +00:00
26 changed files with 609 additions and 636 deletions

View File

@@ -4,15 +4,13 @@
# environment variables for aichat can be set at ~/.config/aichat/.env
#model: claude:claude-sonnet-4-5-20250929
#model: gemini:gemini-3-flash-preview
model: gemini:gemini-3-flash-preview
keybindings: vi
repl_prelude: role:cloudops
clients:
- type: bedrock
name: aws
- type: claude
- type: gemini
#- type: openai
#- type: openai-compatible
# name: moonshot
# api_base: https://api.moonshot.ai/v1
- type: openai
- type: openai-compatible
name: moonshot
api_base: https://api.moonshot.ai/v1

View File

@@ -2,11 +2,19 @@ version: 0.30.0
list:
- provider: openai
models:
- name: gpt-5.2
- name: gpt-5.1
type: chat
max_input_tokens: 400000
input_price: 1.75
output_price: 14.0
input_price: 1.25
output_price: 10.0
max_output_tokens: 128000
supports_vision: true
supports_function_calling: true
- name: gpt-5.1-chat-latest
type: chat
max_input_tokens: 400000
input_price: 1.25
output_price: 10.0
max_output_tokens: 128000
supports_vision: true
supports_function_calling: true
@@ -18,6 +26,14 @@ list:
max_output_tokens: 128000
supports_vision: true
supports_function_calling: true
- name: gpt-5-chat-latest
type: chat
max_input_tokens: 400000
input_price: 1.25
output_price: 10.0
max_output_tokens: 128000
supports_vision: true
supports_function_calling: true
- name: gpt-5-mini
type: chat
max_input_tokens: 400000
@@ -42,6 +58,22 @@ list:
max_output_tokens: 32768
supports_vision: true
supports_function_calling: true
- name: gpt-4.1-mini
type: chat
max_input_tokens: 1047576
input_price: 0.4
output_price: 1.6
max_output_tokens: 32768
supports_vision: true
supports_function_calling: true
- name: gpt-4.1-nano
type: chat
max_input_tokens: 1047576
input_price: 0.1
output_price: 0.4
max_output_tokens: 32768
supports_vision: true
supports_function_calling: true
- name: gpt-4o
type: chat
max_input_tokens: 128000
@@ -50,6 +82,98 @@ list:
max_output_tokens: 16384
supports_vision: true
supports_function_calling: true
- name: gpt-4o-mini
type: chat
max_input_tokens: 128000
input_price: 0.15
output_price: 0.6
max_output_tokens: 16384
supports_vision: true
supports_function_calling: true
- name: o4-mini
type: chat
max_input_tokens: 200000
input_price: 1.1
output_price: 4.4
patch:
body:
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: o4-mini-high
type: chat
real_name: o4-mini
max_input_tokens: 200000
input_price: 1.1
output_price: 4.4
patch:
body:
reasoning_effort: high
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: o3
type: chat
max_input_tokens: 200000
input_price: 2.0
output_price: 8.0
patch:
body:
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: o3-high
type: chat
real_name: o3
max_input_tokens: 200000
input_price: 2.0
output_price: 8.0
patch:
body:
reasoning_effort: high
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: o3-mini
type: chat
max_input_tokens: 200000
input_price: 1.1
output_price: 4.4
patch:
body:
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: o3-mini-high
type: chat
real_name: o3-mini
max_input_tokens: 200000
input_price: 1.1
output_price: 4.4
patch:
body:
reasoning_effort: high
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: gpt-4-turbo
type: chat
max_input_tokens: 128000
@@ -79,6 +203,22 @@ list:
max_batch_size: 100
- provider: gemini
models:
- name: gemini-3-flash-preview
type: chat
max_input_tokens: 1048576
input_price: 0.0
output_price: 0.0
max_output_tokens: 65536
supports_vision: true
supports_function_calling: true
- name: gemini-3-pro-preview
type: chat
max_input_tokens: 1048576
input_price: 0.0
output_price: 0.0
max_output_tokens: 65536
supports_vision: true
supports_function_calling: true
- name: gemini-2.5-flash
type: chat
max_input_tokens: 1048576
@@ -103,16 +243,6 @@ list:
max_output_tokens: 64000
supports_vision: true
supports_function_calling: true
- name: gemini-3-pro-preview
type: chat
max_input_tokens: 1048576
supports_vision: true
supports_function_calling: true
- name: gemini-3-flash-preview
type: chat
max_input_tokens: 1048576
supports_vision: true
supports_function_calling: true
- name: gemini-2.0-flash
type: chat
max_input_tokens: 1048576
@@ -309,13 +439,6 @@ list:
supports_function_calling: true
- provider: mistral
models:
- name: mistral-large-latest
type: chat
input_price: 0.5
output_price: 1.5
max_output_tokens: 262144
supports_vision: true
supports_function_calling: true
- name: mistral-medium-latest
type: chat
max_input_tokens: 131072
@@ -332,38 +455,32 @@ list:
supports_function_calling: true
- name: magistral-medium-latest
type: chat
max_input_tokens: 131072
max_input_tokens: 40960
input_price: 2.0
output_price: 5.0
- name: magistral-small-latest
type: chat
max_input_tokens: 131072
max_input_tokens: 40960
input_price: 0.5
output_price: 1.5
- name: devstral-medium-latest
type: chat
max_input_tokens: 262144
max_input_tokens: 256000
input_price: 0.4
output_price: 2.0
supports_function_calling: true
- name: devstral-small-latest
type: chat
max_input_tokens: 262144
max_input_tokens: 256000
input_price: 0.1
output_price: 0.3
supports_function_calling: true
- name: codestral-latest
type: chat
max_input_tokens: 262144
max_input_tokens: 256000
input_price: 0.3
output_price: 0.9
supports_function_calling: true
- name: ministral-14b-latest
type: chat
max_input_tokens: 262144
input_price: 0.2
output_price: 0.2
supports_function_calling: true
- name: mistral-embed
type: embedding
max_input_tokens: 8092
@@ -441,24 +558,42 @@ list:
max_input_tokens: 4096
- provider: xai
models:
- name: grok-4-1-fast-non-reasoning
- name: grok-4
type: chat
max_input_tokens: 256000
input_price: 3.0
output_price: 15.0
supports_function_calling: true
- name: grok-4-fast-non-reasoning
type: chat
max_input_tokens: 2000000
input_price: 0.2
output_price: 0.5
supports_function_calling: true
- name: grok-4-1-fast-reasoning
- name: grok-4-fast-reasoning
type: chat
max_input_tokens: 2000000
input_price: 0.2
output_price: 0.5
supports_function_calling: true
- name: grok-code-fast-1
- name: grok-code-fast
type: chat
max_input_tokens: 256000
input_price: 0.2
output_price: 1.5
supports_function_calling: true
- name: grok-3
type: chat
max_input_tokens: 131072
input_price: 3.0
output_price: 15.0
supports_function_calling: true
- name: grok-3-mini
type: chat
max_input_tokens: 131072
input_price: 0.3
output_price: 0.5
supports_function_calling: true
- provider: perplexity
models:
- name: sonar-pro
@@ -476,6 +611,11 @@ list:
max_input_tokens: 128000
input_price: 2.0
output_price: 8.0
- name: sonar-reasoning
type: chat
max_input_tokens: 128000
input_price: 1.0
output_price: 5.0
- name: sonar-deep-research
type: chat
max_input_tokens: 128000
@@ -562,16 +702,6 @@ list:
max_output_tokens: 65536
supports_vision: true
supports_function_calling: true
- name: gemini-3-pro-preview
type: chat
max_input_tokens: 1048576
supports_vision: true
supports_function_calling: true
- name: gemini-3-flash-preview
type: chat
max_input_tokens: 1048576
supports_vision: true
supports_function_calling: true
- name: gemini-2.0-flash-001
type: chat
max_input_tokens: 1048576
@@ -747,6 +877,18 @@ list:
require_max_tokens: true
supports_vision: true
supports_function_calling: true
- name: mistral-small-2503
type: chat
max_input_tokens: 32000
input_price: 0.1
output_price: 0.3
supports_function_calling: true
- name: codestral-2501
type: chat
max_input_tokens: 256000
input_price: 0.3
output_price: 0.9
supports_function_calling: true
- name: text-embedding-005
type: embedding
max_input_tokens: 20000
@@ -1194,23 +1336,32 @@ list:
max_batch_size: 10
- provider: hunyuan
models:
- name: hunyuan-2.0-instruct-20251111
- name: hunyuan-turbos-latest
type: chat
max_input_tokens: 131072
max_input_tokens: 28000
input_price: 0.112
output_price: 0.28
supports_function_calling: true
- name: hunyuan-2.0-thinking-20251109
- name: hunyuan-t1-latest
type: chat
max_input_tokens: 131072
max_input_tokens: 28000
input_price: 0.14
output_price: 0.56
supports_function_calling: true
- name: hunyuan-vision-1.5-instruct
- name: hunyuan-lite
type: chat
max_input_tokens: 24576
max_input_tokens: 250000
input_price: 0.0
output_price: 0.0
supports_function_calling: true
- name: hunyuan-turbos-vision
type: chat
max_input_tokens: 6144
input_price: 0.42
output_price: 1.26
output_price: 0.84
supports_vision: true
- name: hunyuan-t1-vision
type: chat
max_input_tokens: 24000
supports_vision: true
- name: hunyuan-embedding
type: embedding
@@ -1263,29 +1414,65 @@ list:
max_output_tokens: 32768
- provider: zhipuai
models:
- name: glm-4.7
- name: glm-4.6
type: chat
max_input_tokens: 202752
input_price: 0.28
output_price: 1.12
supports_function_calling: true
- name: glm-4.5
type: chat
max_input_tokens: 131072
input_price: 0.28
output_price: 1.12
- name: glm-4.5-x
type: chat
max_input_tokens: 131072
input_price: 1.12
output_price: 4.48
supports_function_calling: true
- name: glm-4.5-air
type: chat
max_input_tokens: 131072
input_price: 0.084
output_price: 0.56
- name: glm-4.5-airx
type: chat
max_input_tokens: 131072
input_price: 0.56
output_price: 2.24
supports_function_calling: true
- name: glm-4.7:instruct
- name: glm-4.5-flash
type: chat
real_name: glm-4.7
max_input_tokens: 202752
input_price: 0.56
output_price: 2.24
patch:
body:
thinking:
type: disabled
supports_function_calling: true
- name: glm-4.6v
max_input_tokens: 131072
input_price: 0.0
output_price: 0.0
- name: glm-4.5v
type: chat
max_input_tokens: 65536
input_price: 0.28
output_price: 0.84
input_price: 0.56
output_price: 1.68
supports_vision: true
- name: glm-z1-air
type: chat
max_input_tokens: 131072
input_price: 0.07
output_price: 0.07
- name: glm-z1-airx
type: chat
max_input_tokens: 131072
input_price: 0.7
output_price: 0.7
- name: glm-z1-flashx
type: chat
max_input_tokens: 131072
input_price: 0.014
output_price: 0.014
- name: glm-z1-flash
type: chat
max_input_tokens: 131072
input_price: 0.0
output_price: 0.0
- name: embedding-3
type: embedding
max_input_tokens: 8192
@@ -1298,25 +1485,27 @@ list:
input_price: 0.112
- provider: minimax
models:
- name: minimax-m2.1
- name: minimax-m2
type: chat
max_input_tokens: 204800
input_price: 0.294
output_price: 1.176
supports_function_calling: true
- name: minimax-m2.1-lightning
type: chat
max_input_tokens: 204800
input_price: 0.294
output_price: 2.352
supports_function_calling: true
- provider: openrouter
models:
- name: openai/gpt-5.2
- name: openai/gpt-5.1
type: chat
max_input_tokens: 400000
input_price: 1.75
output_price: 14.0
input_price: 1.25
output_price: 10.0
max_output_tokens: 128000
supports_vision: true
supports_function_calling: true
- name: openai/gpt-5.1-chat
type: chat
max_input_tokens: 400000
input_price: 1.25
output_price: 10.0
max_output_tokens: 128000
supports_vision: true
supports_function_calling: true
@@ -1328,6 +1517,14 @@ list:
max_output_tokens: 128000
supports_vision: true
supports_function_calling: true
- name: openai/gpt-5-chat
type: chat
max_input_tokens: 400000
input_price: 1.25
output_price: 10.0
max_output_tokens: 128000
supports_vision: true
supports_function_calling: true
- name: openai/gpt-5-mini
type: chat
max_input_tokens: 400000
@@ -1352,6 +1549,22 @@ list:
max_output_tokens: 32768
supports_vision: true
supports_function_calling: true
- name: openai/gpt-4.1-mini
type: chat
max_input_tokens: 1047576
input_price: 0.4
output_price: 1.6
max_output_tokens: 32768
supports_vision: true
supports_function_calling: true
- name: openai/gpt-4.1-nano
type: chat
max_input_tokens: 1047576
input_price: 0.1
output_price: 0.4
max_output_tokens: 32768
supports_vision: true
supports_function_calling: true
- name: openai/gpt-4o
type: chat
max_input_tokens: 128000
@@ -1359,6 +1572,91 @@ list:
output_price: 10.0
supports_vision: true
supports_function_calling: true
- name: openai/gpt-4o-mini
type: chat
max_input_tokens: 128000
input_price: 0.15
output_price: 0.6
supports_vision: true
supports_function_calling: true
- name: openai/o4-mini
type: chat
max_input_tokens: 200000
input_price: 1.1
output_price: 4.4
patch:
body:
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: openai/o4-mini-high
type: chat
max_input_tokens: 200000
input_price: 1.1
output_price: 4.4
patch:
body:
reasoning_effort: high
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: openai/o3
type: chat
max_input_tokens: 200000
input_price: 2.0
output_price: 8.0
patch:
body:
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: openai/o3-high
type: chat
real_name: openai/o3
max_input_tokens: 200000
input_price: 2.0
output_price: 8.0
patch:
body:
reasoning_effort: high
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: openai/o3-mini
type: chat
max_input_tokens: 200000
input_price: 1.1
output_price: 4.4
patch:
body:
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: openai/o3-mini-high
type: chat
max_input_tokens: 200000
input_price: 1.1
output_price: 4.4
patch:
body:
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: openai/gpt-oss-120b
type: chat
max_input_tokens: 131072
@@ -1492,12 +1790,6 @@ list:
max_input_tokens: 131072
input_price: 0.12
output_price: 0.3
- name: mistralai/mistral-large-2512
type: chat
max_input_tokens: 262144
input_price: 0.5
output_price: 1.5
supports_function_calling: true
- name: mistralai/mistral-medium-3.1
type: chat
max_input_tokens: 131072
@@ -1511,11 +1803,26 @@ list:
input_price: 0.1
output_price: 0.3
supports_vision: true
- name: mistralai/devstral-2512
- name: mistralai/magistral-medium-2506
type: chat
max_input_tokens: 262144
max_input_tokens: 40960
input_price: 2.0
output_price: 5.0
- name: mistralai/magistral-medium-2506:thinking
type: chat
max_input_tokens: 40960
input_price: 2.0
output_price: 5.0
- name: mistralai/magistral-small-2506
type: chat
max_input_tokens: 40960
input_price: 0.5
output_price: 0.22
output_price: 1.5
- name: mistralai/devstral-medium
type: chat
max_input_tokens: 131072
input_price: 0.4
output_price: 2.0
supports_function_calling: true
- name: mistralai/devstral-small
type: chat
@@ -1529,12 +1836,6 @@ list:
input_price: 0.3
output_price: 0.9
supports_function_calling: true
- name: mistralai/ministral-14b-2512
type: chat
max_input_tokens: 262144
input_price: 0.2
output_price: 0.2
supports_function_calling: true
- name: ai21/jamba-large-1.7
type: chat
max_input_tokens: 256000
@@ -1559,11 +1860,29 @@ list:
input_price: 0.0375
output_price: 0.15
max_output_tokens: 4096
- name: deepseek/deepseek-v3.2
- name: deepseek/deepseek-v3.2-exp
type: chat
max_input_tokens: 163840
input_price: 0.25
output_price: 0.38
input_price: 0.27
output_price: 0.4
- name: deepseek/deepseek-v3.1-terminus
type: chat
max_input_tokens: 163840
input_price: 0.23
output_price: 0.9
- name: deepseek/deepseek-chat-v3.1
type: chat
max_input_tokens: 163840
input_price: 0.2
output_price: 0.8
- name: deepseek/deepseek-r1-0528
type: chat
max_input_tokens: 128000
input_price: 0.5
output_price: 2.15
patch:
body:
include_reasoning: true
- name: qwen/qwen3-max
type: chat
max_input_tokens: 262144
@@ -1663,7 +1982,13 @@ list:
input_price: 0.29
output_price: 1.15
supports_function_calling: true
- name: x-ai/grok-4.1-fast
- name: x-ai/grok-4
type: chat
max_input_tokens: 256000
input_price: 3.0
output_price: 15.0
supports_function_calling: true
- name: x-ai/grok-4-fast
type: chat
max_input_tokens: 2000000
input_price: 0.2
@@ -1719,6 +2044,14 @@ list:
patch:
body:
include_reasoning: true
- name: perplexity/sonar-reasoning
type: chat
max_input_tokens: 127000
input_price: 1.0
output_price: 5.0
patch:
body:
include_reasoning: true
- name: perplexity/sonar-deep-research
type: chat
max_input_tokens: 200000
@@ -1727,24 +2060,17 @@ list:
patch:
body:
include_reasoning: true
- name: minimax/minimax-m2.1
- name: minimax/minimax-m2
type: chat
max_input_tokens: 196608
input_price: 0.12
output_price: 0.48
supports_function_calling: true
- name: z-ai/glm-4.7
input_price: 0.15
output_price: 0.45
- name: z-ai/glm-4.6
type: chat
max_input_tokens: 202752
input_price: 0.16
output_price: 0.8
input_price: 0.5
output_price: 1.75
supports_function_calling: true
- name: z-ai/glm-4.6v
type: chat
max_input_tokens: 131072
input_price: 0.3
output_price: 0.9
supports_vision: true
- provider: github
models:
- name: gpt-5
@@ -1753,6 +2079,12 @@ list:
max_output_tokens: 128000
supports_vision: true
supports_function_calling: true
- name: gpt-5-chat
type: chat
max_input_tokens: 400000
max_output_tokens: 128000
supports_vision: true
supports_function_calling: true
- name: gpt-5-mini
type: chat
max_input_tokens: 400000
@@ -1771,11 +2103,100 @@ list:
max_output_tokens: 32768
supports_vision: true
supports_function_calling: true
- name: gpt-4.1-mini
type: chat
max_input_tokens: 1047576
max_output_tokens: 32768
supports_vision: true
supports_function_calling: true
- name: gpt-4.1-nano
type: chat
max_input_tokens: 1047576
max_output_tokens: 32768
supports_vision: true
supports_function_calling: true
- name: gpt-4o
type: chat
max_input_tokens: 128000
max_output_tokens: 16384
supports_function_calling: true
- name: gpt-4o-mini
type: chat
max_input_tokens: 128000
max_output_tokens: 16384
supports_function_calling: true
- name: o4-mini
type: chat
max_input_tokens: 200000
patch:
body:
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: o4-mini-high
type: chat
real_name: o4-mini
max_input_tokens: 200000
patch:
body:
reasoning_effort: high
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: o3
type: chat
max_input_tokens: 200000
patch:
body:
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: o3-high
type: chat
real_name: o3
max_input_tokens: 200000
patch:
body:
reasoning_effort: high
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: o3-mini
type: chat
max_input_tokens: 200000
patch:
body:
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: o3-mini-high
type: chat
real_name: o3-mini
max_input_tokens: 200000
patch:
body:
reasoning_effort: high
max_tokens: null
temperature: null
top_p: null
supports_vision: true
supports_function_calling: true
system_prompt_prefix: Formatting re-enabled
- name: text-embedding-3-large
type: embedding
max_tokens_per_chunk: 8191
@@ -1917,12 +2338,26 @@ list:
input_price: 0.18
output_price: 0.69
supports_vision: true
- name: deepseek-ai/DeepSeek-V3.2
- name: deepseek-ai/DeepSeek-V3.2-Exp
type: chat
max_input_tokens: 163840
input_price: 0.26
output_price: 0.39
supports_function_calling: true
input_price: 0.27
output_price: 0.4
- name: deepseek-ai/DeepSeek-V3.1-Terminus
type: chat
max_input_tokens: 163840
input_price: 0.27
output_price: 1.0
- name: deepseek-ai/DeepSeek-V3.1
type: chat
max_input_tokens: 163840
input_price: 0.3
output_price: 1.0
- name: deepseek-ai/DeepSeek-R1-0528
type: chat
max_input_tokens: 163840
input_price: 0.5
output_price: 2.15
- name: google/gemma-3-27b-it
type: chat
max_input_tokens: 131072
@@ -1945,24 +2380,12 @@ list:
input_price: 0.55
output_price: 2.5
supports_function_calling: true
- name: MiniMaxAI/MiniMax-M2.1
type: chat
max_input_tokens: 262144
input_price: 0.28
output_price: 1.2
supports_function_calling: true
- name: zai-org/GLM-4.7
- name: zai-org/GLM-4.6
type: chat
max_input_tokens: 202752
input_price: 0.43
output_price: 1.75
input_price: 0.6
output_price: 1.9
supports_function_calling: true
- name: zai-org/GLM-4.6V
type: chat
max_input_tokens: 131072
input_price: 0.3
output_price: 0.9
supports_vision: true
- name: BAAI/bge-large-en-v1.5
type: embedding
input_price: 0.01

View File

@@ -1,4 +1,15 @@
# Source library files in alphabetical order
for lib in ~/.config/direnv/lib/*.sh; do
[[ -f "$lib" ]] && source "$lib"
done
export_secret() {
local name="$1"
local file="/run/secrets/${name}"
if [[ ! -f "$file" ]]; then
printf "secret file not found: %s\n" $file >&2
return 1
fi
# Read first line, remove trailing spaces/tabs, convert nulls to newlines
local value
value=$(head -n1 "$file" | sed 's/[ \t]*$//' | tr '\0' '\n')
export "${name}=${value}"
}

View File

@@ -1,16 +0,0 @@
# Exports a Podman / Docker secret as an environment variable
export-secret() {
local name="$1"
local file="/run/secrets/${name}"
if [[ ! -f "$file" ]]; then
printf "secret file not found: %s\n" $file >&2
return 1
fi
# Read first line, remove trailing spaces/tabs, convert nulls to newlines
local value
value=$(head -n1 "$file" | sed 's/[ \t]*$//' | tr '\0' '\n')
export "${name}=${value}"
}

View File

@@ -1,73 +0,0 @@
#!/usr/bin/env bash
# repo_overlay - a direnv function to copy files from centralized overlays directory
#
# Set REPO_OVERLAY_DIR to customize the overlays base directory (default: $HOME/overlays)
#
# Usage: Add 'repo_overlay' to your .envrc file
repo-overlay() {
# Get the repo URL from git remote
local repo_url
repo_url=$(git config --get remote.origin.url 2>/dev/null)
if [ -z "$repo_url" ]; then
echo "repo_overlay: Not a git repository or no origin remote configured"
return 1
fi
# Extract owner and repo name from URL
# Handles both SSH (git@github.com:owner/repo.git) and HTTPS (https://github.com/owner/repo.git)
local owner_repo
if [[ "$repo_url" =~ ^git@[^:]+:(.+)\.git$ ]] || \
[[ "$repo_url" =~ ^https?://[^/]+/(.+)\.git$ ]] || \
[[ "$repo_url" =~ ^git@[^:]+:(.+)$ ]] || \
[[ "$repo_url" =~ ^https?://[^/]+/(.+)$ ]]; then
owner_repo="${BASH_REMATCH[1]}"
else
echo "repo_overlay: Could not parse repository URL: $repo_url"
return 1
fi
# Determine overlay source directory
local overlay_base="${REPO_OVERLAY_DIR:-$HOME/overlays}"
local overlay_source="${overlay_base}/${owner_repo}"
if [ ! -d "$overlay_source" ]; then
echo "repo_overlay: No overlay directory found at ${overlay_source}"
return 0
fi
# Copy files from overlay directory
local copied_count=0
local skipped_count=0
# Find all files in overlay directory (excluding directories)
while IFS= read -r -d '' source_file; do
# Get relative path from overlay source
local rel_path="${source_file#$overlay_source/}"
local dest_file="./${rel_path}"
if [ -f "$dest_file" ]; then
echo "repo_overlay: Skipping ${rel_path} (already exists)"
((skipped_count++))
else
# Create parent directory if needed
local dest_dir
dest_dir=$(dirname "$dest_file")
mkdir -p "$dest_dir"
# Copy the file
cp "$source_file" "$dest_file"
echo "repo_overlay: Copied ${rel_path}"
((copied_count++))
fi
done < <(find "$overlay_source" -type f -print0)
# Summary
if [ $copied_count -eq 0 ] && [ $skipped_count -eq 0 ]; then
echo "repo_overlay: No files found in ${overlay_source}"
else
echo "repo_overlay: Complete (${copied_count} copied, ${skipped_count} skipped)"
fi
}

View File

@@ -1 +0,0 @@
**/.claude/settings.local.json

View File

@@ -1,12 +1,12 @@
# local network -> local port
Match Host tuulikki.scalene.net exec "nc -w 1 192.168.101.1 22"
Match Host tuulikki.scalene.net exec "sudo ping -c 1 -W 1 -q 192.168.101.1"
Port 22
Host tuulikki.scalene.net
Port 22022
# local network -> local port
Match Host tonttu.scalene.net exec "nc -w 1 192.168.101.1 22"
Match Host tonttu.scalene.net exec "sudo ping -c 1 -W 1 -q 192.168.101.1"
Port 22
Host tonttu.scalene.net
@@ -16,7 +16,7 @@ Host www.scalene.net
User scalene
Port 22022
Match Host git.scalene.net exec "nc -w 1 192.168.101.1 22"
Match Host git.scalene.net exec "sudo ping -c 1 -W 1 -q 192.168.101.1"
Hostname tonttu.scalene.net
Host *.scalene.net

View File

@@ -35,9 +35,6 @@ font Droid Sans Mono Bold 10
#
# You can get the names of your outputs by running: swaymsg -t get_outputs
output DP-4 position 0,0 transform 90
output DP-2 position 1080,380
### Idle configuration
#
# Example configuration:

View File

@@ -21,7 +21,7 @@ set showbreak=↪\
augroup filetype_wrapping
autocmd!
" Enable soft wrap for prose
autocmd FileType markdown,text,gitcommit setlocal wrap linebreak breakindent textwidth=0
autocmd FileType markdown,text,gitcommit setlocal wrap linebreak breakindent
" Maintain no wrap for code and structured data
autocmd FileType go,python,sh,yaml,json setlocal nowrap
augroup END
@@ -49,6 +49,7 @@ colorscheme theunixzoo
" arrows could be: → »
set listchars=tab:→\ ,trail
"source /home/jswank/.config/nvim/colors-now
"set gfn=Droid\ Sans\ Mono\ 10
@@ -63,14 +64,11 @@ filetype indent on
set ofu=syntaxcomplete#Complete#
" au FileType python setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4
au FileType markdown setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4 wrap textwidth=0
au FileType markdown setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4 wrap
" typing idate inserts the current date
iab idate <c-r>=strftime("%Y-%m-%d")<cr>
" insert triple backticks for markdown code blocks with Ctrl-b
inoremap <C-b> ```<CR>```<Esc>O
" use \ toc to insert a table of contents for markdown from the current line to EOF
" nmap <leader>toc <cmd>.put =execute('.,$write !gh-md-toc --hide-header --hide-footer')<cr>
nmap <leader>toc :put =system('gh-md-toc --hide-header --hide-footer --indent=4', getline('.', '$'))<cr>
@@ -84,8 +82,6 @@ nmap <leader>jn <cmd>% !jsonnetfmt -<cr>
" use \ js to format a buffer as JSON
nmap <leader>js <cmd>% !jq . -<cr>
nmap <leader>yq <cmd>% !yq . -<cr>
set lazyredraw " redraw only when req'd
set wildmenu " visual auto-complete

View File

@@ -1,43 +0,0 @@
-- ~/.config/vis/lexers/terraform.lua
-- HCL/Terraform LPeg lexer for the vis editor.
-- Uses the modern Scintillua style for robust syntax highlighting.
local lexer = lexer
local P, S = lpeg.P, lpeg.S
local lex = lexer.new('terraform', {fold_by_indentation = true})
-- Comments (# or // or /* */)
local line_comment = lexer.to_eol('#') + lexer.to_eol('//')
local block_comment = lexer.range('/*', '*/')
lex:add_rule('comment', lex:tag(lexer.COMMENT, line_comment + block_comment))
-- Strings (double-quoted and heredoc)
local dq_str = lexer.range('"', true)
-- Basic heredoc pattern: '<<' (optionally with '-') followed by identifier, up to matching newline-identifier-newline
local heredoc = '<<' * P('-')^-1 * lexer.word
lex:add_rule('string', lex:tag(lexer.STRING, dq_str + heredoc))
-- Keywords
lex:add_rule('keyword', lex:tag(lexer.KEYWORD, lexer.word_match[[
resource data provider variable output locals module terraform
required_providers required_version source version for_each count
if else for in true false null
]]))
-- Numbers
lex:add_rule('number', lex:tag(lexer.NUMBER, lexer.number))
-- Identifiers / function names
lex:add_rule('identifier', lex:tag(lexer.IDENTIFIER, lexer.word))
-- Operators
lex:add_rule('operator', lex:tag(lexer.OPERATOR, S('={}[]().,;:<+-*/&|!?@')))
-- Fold points
lex:add_fold_point(lexer.OPERATOR, '[', ']')
lex:add_fold_point(lexer.OPERATOR, '{', '}')
lexer.property['scintillua.comment'] = '#'
return lex

View File

@@ -1,148 +0,0 @@
-- ~/.config/vis/visrc.lua
-- Sourced by the vis editor during startup.
-- Highly customized based on your .vimrc configuration.
-- Load standard vis runtime files (must be done first)
require('vis')
-- Register HCL/Terraform file extensions to the terraform lexer
vis.ftdetect = vis.ftdetect or {}
vis.ftdetect.filetypes = vis.ftdetect.filetypes or {}
vis.ftdetect.filetypes.terraform = {
ext = { "%.tf$", "%.tfvars$", "%.hcl$" }
}
vis.events.subscribe(vis.events.INIT, function()
-- Enable 256 colors themes
-- vis:command('set theme default-256') -- or base-16 / default-256
end)
-- Global Editor Options (ported from vimrc)
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
-- Filetype-specific indentation and soft-wrapping
if syntax == "markdown" or syntax == "text" or syntax == "gitcommit" then
vis:command("set tabwidth 4")
vis:command("set expandtab on")
vis:command("set autoindent on")
-- In vis, wrapping occurs at the minimum of window width and wrapcolumn.
-- Setting wrapcolumn to a large number (e.g., 1000) acts as soft-wrap.
vis:command("set wrapcolumn 1000")
else
-- Default options for code and structured data (go, python, sh, yaml, json, etc.)
vis:command("set tabwidth 2")
vis:command("set expandtab on")
vis:command("set autoindent on")
vis:command("set wrapcolumn 0") -- No wrap for code/config
end
-- Highlight current cursor line
vis:command("set cursorline on")
end)
-------------------------------------------------------------------------------
-- Key Mappings (ported from vimrc)
-------------------------------------------------------------------------------
-- Use semicolon as colon for commands
vis:map(vis.modes.NORMAL, ";", ":")
-- Navigate visual display lines instead of logical lines (gj/gk mapping)
vis:map(vis.modes.NORMAL, "j", "gj")
vis:map(vis.modes.NORMAL, "k", "gk")
vis:map(vis.modes.VISUAL, "j", "gj")
vis:map(vis.modes.VISUAL, "k", "gk")
-- Optional list/hidden characters toggle commands (commented like in vimrc)
-- vis:command('set showtabs on')
-- vis:command('set shownewlines on')
-- vis:command('set showspaces on')
-------------------------------------------------------------------------------
-- Insert Mode Helpers (ported from vimrc)
-------------------------------------------------------------------------------
-- Insert markdown triple backticks code block with Ctrl-b in insert mode
vis:map(vis.modes.INSERT, "<C-b>", function()
local win = vis.win
local file = win.file
local pos = win.selection.pos
-- Insert "```\n\n```" and place cursor inside
file:insert(pos, "```\n\n```")
win.selection.pos = pos + 4 -- Position cursor in the empty middle line
end, "Insert markdown triple backticks code block")
-- typing idate inserts the current date (insert-mode abbreviation equivalent)
vis:map(vis.modes.INSERT, "idate", function()
local win = vis.win
local date_str = os.date("%Y-%m-%d")
win.file:insert(win.selection.pos, date_str)
end, "Insert current date")
-------------------------------------------------------------------------------
-- External Formatter Pipelines (ported from vimrc leader bindings)
-------------------------------------------------------------------------------
-- Helper function to pipe full buffer to external formatting commands
local function format_buffer(cmd)
local win = vis.win
local file = win.file
local pos = win.selection.pos -- save cursor pos
-- Pipe entire file range to formatter in fullscreen=false mode
local status, out, err = vis:pipe(file, {start = 0, finish = file.size}, cmd)
if status ~= 0 then
vis:info(err or "Format failed")
else
file:delete({start = 0, finish = file.size})
file:insert(0, out)
-- Restore cursor position safely
if pos < file.size then
win.selection.pos = pos
else
win.selection.pos = file.size
end
end
end
-- Key bindings using standard backslash prefix (\)
vis:map(vis.modes.NORMAL, "\\tf", function() format_buffer("tofu fmt -no-color -") end, "Format buffer as Terraform/Tofu")
vis:map(vis.modes.NORMAL, "\\js", function() format_buffer("jq .") end, "Format buffer as JSON")
vis:map(vis.modes.NORMAL, "\\jn", function() format_buffer("jsonnetfmt -") end, "Format buffer as Jsonnet")
vis:map(vis.modes.NORMAL, "\\yq", function() format_buffer("yq .") end, "Format buffer as YAML")
-------------------------------------------------------------------------------
-- Fuzzy Finder Integration (ported from vimrc fzf shortcuts)
-------------------------------------------------------------------------------
-- Define fuzzy finder function using fzf via io.popen
local function fzf_find()
-- Run fzf using io.popen so it inherits the terminal's stdin/stderr
local file = io.popen("fzf")
if not file then return end
local output = file:read("*l") -- Read the selected file path
local success, msg, status = file:close()
if output and output ~= "" then
-- Strip any trailing spaces or newlines
output = output:gsub("%s+$", "")
if output ~= "" then
vis:command("e '" .. output .. "'")
end
end
-- Redraw the editor screen since fzf drew over the terminal
vis:feedkeys("<vis-redraw>")
end
-- Register ':fzf' command to trigger the fuzzy finder
vis:command_register("fzf", function(argv, force, win, selection, range)
fzf_find()
return true
end)
vis:map(vis.modes.NORMAL, "<C-p>", function()
fzf_find()
end, "Fuzzy finder file selection using fzf")

View File

@@ -78,14 +78,6 @@ template = "default.md"
#[group."<NAME>".extra]
#key = "value"
[group.meeting]
paths = ["meeting"]
[group.meeting.note]
filename = "{{slug title}}-{{format-date now '%Y%m%d'}}"
extension = "md"
template = "meeting.md"
[group.daily]
paths = ["daily"]
@@ -200,8 +192,7 @@ edit = 'zk edit --interactive "$@"'
# This alias doesn't take any argument, so we don't use $@.
recent = "zk edit --sort created- --created-after 'last two weeks' --interactive"
daily = 'zk new "$@" daily'
meeting = 'zk new --title "$@" meeting'
daily = 'zk new daily "$@"'
# Print paths separated with colons for the notes found with the given
# arguments. This can be useful to expand a complex search query into a flag

View File

@@ -1,14 +1,12 @@
# {{format-date now '%Y-%m-%d'}}
[Yesterday](daily/{{format-date (date "yesterday") '%Y%m%d'}}.md)
[Weekly Goals](daily/weekly-goals.md)
[yesterday](daily/{{format-date (date "yesterday") '%Y%m%d'}}.md)
## goals
- a bullet
- another bullet
## tracking
- [ ] 1hr GCP training
- [ ] harvest time sheet
- [ ] exercise
- [ ] dinner / logistics

View File

@@ -1,12 +0,0 @@
# {{ title }}
Date: {{format-date now '%a, %b %d @ %H%M'}}
Description:
Attendees:
## Agenda
## Notes
## Action Items
- [ ] Item
- [ ] Item

View File

@@ -1,3 +0,0 @@
alias ls='ls --color=auto'
alias grep='grep --color'
alias pichat='pi --provider google --model gemini-3.1-flash-lite-preview --prompt-template ~/.pi/agent/prompts/cloudops.md'

View File

@@ -1,4 +1,2 @@
# ignore all files in the stew directory
stew/*
containers/
direnv

View File

@@ -1,21 +0,0 @@
#compdef eph
_eph() {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
'(-h --help)'{-h,--help}'[display help]' \
'--completion[generate completion script]:shell:(zsh)' \
'--list[list all containers]' \
'1: :->containers'
case $state in
containers)
local -a subcmds
subcmds=(${(f)"$(lxc ls -c n -f csv 2>/dev/null)"})
_describe 'containers' subcmds
;;
esac
}
_eph "$@"

View File

@@ -1,17 +0,0 @@
aws-get-bedrock-profile () {
profile_id=$(aws bedrock list-inference-profiles \
| jq -r '.inferenceProfileSummaries
| map(select(.inferenceProfileId | startswith("us.")))
| sort_by(.inferenceProfileName)
| .[]
| [.inferenceProfileId, .inferenceProfileName, .description]
| @tsv' \
| fzf \
--header="$(printf '%-30s\t%s\n' 'NAME' 'DESCRIPTION')" \
--no-preview \
--delimiter='\t' \
--with-nth=2,3 \
| awk '{print $1}')
[[ -z "$profile_id" ]] && return 1
echo "$profile_id"
}

View File

@@ -3,9 +3,7 @@ aws-get-secret () {
if [[ -z "$secret_id" ]]; then
secret_id=$(aws secretsmanager list-secrets \
# build a tsv w/ name and date
| jq -r '.SecretList | sort_by(.Name) | .[] | [.Name,.LastChangedDate] | @tsv' \
# convert to tsv w/ full name, truncated name, date (no timestamp)
| awk -F'\t' '{
full_name = $1;
truncated_name = substr($1,1,30);
@@ -13,7 +11,6 @@ aws-get-secret () {
# Output: full_name (for return), truncated_name (for display), date (for display)
printf "%s\t%-30s\t%s\n", full_name, truncated_name, date_parts[1]
}' \
# select via fzf, fields 2 & 3
| fzf \
--header="$(printf '%-30s\t%s\n' 'NAME' 'LAST_CHANGED_DATE')" \
--delimiter='\t' \

View File

@@ -1,3 +1,3 @@
aws-logout() {
unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_ENVIRONMENT AWS_PROFILE
unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_ENVIRONMENT
}

View File

@@ -1,30 +0,0 @@
aws-sso-login() {
local profile="${1:-$AWS_PROFILE}"
if [[ -z "$profile" ]]; then
profile=$(aws configure list-profiles \
| fzf --height 40% --reverse --no-preview)
fi
if [[ -z "$profile" ]]; then
echo "Error: No profile provided or selected." >&2
return 1
fi
# Validate existing session; login if expired or missing
if ! aws sts get-caller-identity --profile "$profile" &>/dev/null; then
aws sso login --use-device-code --profile "$profile" || return 1
fi
# Export credentials to environment for third-party tools
local creds
creds=$(aws configure export-credentials --profile "$profile" --format env)
if [[ $? -eq 0 ]]; then
eval "$creds"
export AWS_PROFILE="$profile"
# echo "Environment configured for profile: $profile"
else
echo "Error: Failed to export credentials." >&2
return 1
fi
}

View File

@@ -1,3 +0,0 @@
gcloud-login() {
gcloud auth login --update-adc
}

View File

@@ -1,33 +0,0 @@
use-bedrock() {
local force=0
while getopts "f" opt; do
case $opt in
f) force=1 ;;
*) echo "Usage: use-bedrock [-f]" >&2; return 1 ;;
esac
done
OPTIND=1
if [[ "$force" -eq 0 ]] && [[ -n "$AWS_ACCESS_KEY_ID" ]] && [[ -n "$AWS_SECRET_ACCESS_KEY" ]]; then
echo "AWS credentials already set. Skipping Bedrock setup. Use -f to force re-authentication." >&2
return
fi
aws sso login --use-device-code || return 1
local creds
creds=$(aws configure export-credentials --format env) || return 1
eval "$creds"
export CLAUDE_CODE_USE_BEDROCK=1
export CLAUDE_BEDROCK_AWS_REGION="${AWS_REGION:-us-east-2}"
export ANTHROPIC_DEFAULT_OPUS_MODEL="${BEDROCK_OPUS_MODEL:-us.anthropic.claude-opus-4-7-v1}"
export ANTHROPIC_DEFAULT_SONNET_MODEL="${BEDROCK_SONNET_MODEL:-us.anthropic.claude-sonnet-4-6}"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="${BEDROCK_HAIKU_MODEL:-us.anthropic.claude-haiku-4-5-20251001-v1:0}"
unset CLAUDE_CODE_USE_VERTEX
printf 'Bedrock environment set.\n\tOpus: %s\n\tSonnet: %s\n\tHaiku: %s\n' \
"$ANTHROPIC_DEFAULT_OPUS_MODEL" "$ANTHROPIC_DEFAULT_SONNET_MODEL" "$ANTHROPIC_DEFAULT_HAIKU_MODEL" >&2
}

View File

@@ -1,25 +0,0 @@
use-vertex() {
local project="${ANTHROPIC_VERTEX_PROJECT_ID:-sandbox-jason-7023}"
local region="${CLOUD_ML_REGION:-us-east5}"
# Probe/refresh ADC
if ! gcloud auth application-default print-access-token >/dev/null 2>&1; then
gcloud auth login --update-adc || return 1
fi
export CLAUDE_CODE_USE_VERTEX=1
export ANTHROPIC_VERTEX_PROJECT_ID="$project"
export CLOUD_ML_REGION="$region"
export ANTHROPIC_DEFAULT_OPUS_MODEL="${VERTEX_OPUS_MODEL:-claude-opus-4-7}"
export ANTHROPIC_DEFAULT_SONNET_MODEL="${VERTEX_SONNET_MODEL:-claude-sonnet-4-6}"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="${VERTEX_HAIKU_MODEL:-claude-haiku-4-5-20251001}"
# pi google-vertex provider auto-activates with all three present
export GOOGLE_CLOUD_PROJECT="$project"
export GOOGLE_CLOUD_LOCATION="$region"
unset CLAUDE_CODE_USE_BEDROCK CLAUDE_BEDROCK_AWS_REGION
printf 'Vertex AI environment set.\n\tOpus: %s\n\tSonnet: %s\n\tHaiku: %s\n' \
"$ANTHROPIC_DEFAULT_OPUS_MODEL" "$ANTHROPIC_DEFAULT_SONNET_MODEL" "$ANTHROPIC_DEFAULT_HAIKU_MODEL" >&2
}

View File

@@ -15,9 +15,6 @@ export GOPATH=~/go
export TZ=America/Kentucky/Louisville
export AWS_REGION=us-west-2
export REPO_OVERLAY_DIR=~/repos/repo-overlays/overlays
# doesn't work on arch for tmux
#path+=(~/bin)
#path+=(~/.local/bin)
@@ -27,6 +24,7 @@ export REPO_OVERLAY_DIR=~/repos/repo-overlays/overlays
export TMPDIR=/var/tmp
export BROWSER=open_browser.sh
export TF_PLUGIN_CACHE_DIR=~/.local/state/tofu
# With ghostty + tmux + nvim, having this autoset to 'truecolor' has a weird effect
# unset COLORTERM

View File

@@ -1,12 +1,8 @@
# aliases are stored in ~/.aliasrc
if [ -f ~/.aliasrc ]; then
source ~/.aliasrc
fi
alias ls='ls --color=auto'
alias grep='grep --color'
fpath+=~/.local/share/zsh/functions
typeset -U path
path+=(~/bin)
path+=(~/.local/bin)
path+=($GOPATH/bin)
@@ -52,18 +48,17 @@ zstyle ':vcs_info:git*' actionformats '%%S%r%%s:%{$fg[red]%}%b:%a%{$reset_color%
function set_prompt() {
if [[ -n "$AWS_PROFILE" ]]; then
if [[ -n "$AWS_ENVIRONMENT" ]]; then
aws_prompt="
%S%B$AWS_PROFILE%b%s
%S%B$AWS_ENVIRONMENT%b%s
"
else
aws_prompt=""
fi
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
PROMPT=$aws_prompt"%B${vcs_info_msg_0_} %b "
PROMPT=$aws_prompt"%B${vcs_info_msg_0_}> %b"
else
# PROMPT=$aws_prompt"%B%m:%~%b "
PROMPT=$aws_prompt"%B%m:%2~▶ %b "
PROMPT=$aws_prompt"%B%m:%~> %b"
fi
}
precmd_functions+=( set_prompt )
@@ -81,35 +76,26 @@ precmd_functions+=( set_prompt )
# setup SSH keys
if [ -e /usr/bin/keychain ]; then
eval $(/usr/bin/keychain --quick --eval --quiet id_ed25519)
eval $(/usr/bin/keychain --eval -Q --quiet id_ed25519)
fi
# ctrl-x opens up the command line in $EDITOR
autoload -U edit-command-line
zle -N edit-command-line
bindkey "^X" edit-command-line
# direnv setup
whence -p direnv &>/dev/null && eval "$(direnv hook zsh)"
# secrets are individual files in /run/secrets - export them as environment variables
if [ -d "/run/secrets" ]; then
for secret in /run/secrets/*; do
if [ -f "$secret" ]; then
name=$(basename "$secret")
value=$(head -n1 "$secret" | sed 's/[ \t]*$//' | tr '\0' '\n')
export "${name}=${value}"
fi
done
# secrets
if [ -r "$HOME/.env_secrets" ]; then
set -a
source "$HOME/.env_secrets"
set +a
fi
# command line completion
autoload -U +X bashcompinit && bashcompinit
autoload -Uz compinit && compinit -C
autoload -Uz compinit && compinit
# gcloud
if [ -f "$HOME/google-cloud-sdk/path.zsh.inc" ]; then . "$HOME/google-cloud-sdk/path.zsh.inc"; fi
if [ -f "$HOME/google-cloud-sdk/completion.zsh.inc" ]; then . "$HOME/google-cloud-sdk/completion.zsh.inc"; fi
if [ -f '/home/cli/google-cloud-sdk/path.zsh.inc' ]; then . '/home/cli/google-cloud-sdk/path.zsh.inc'; fi
if [ -f '/home/cli/google-cloud-sdk/completion.zsh.inc' ]; then . '/home/cli/google-cloud-sdk/completion.zsh.inc'; fi
# kubectl
[[ $commands[kubectl] ]] && source <(kubectl completion zsh)
@@ -127,15 +113,20 @@ fi
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
# command line completion for ssh
#h=()
#if [[ -r ~/.ssh/config ]]; then
h=()
if [[ -r ~/.ssh/config ]]; then
h=($h ${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
#fi
#if [[ -r ~/.ssh/known_hosts ]]; then
# h=($h ${${${(f)"$(cat ~/.ssh/known_hosts{,2} || true)"}%%\ *}%%,*}) 2>/dev/null
#fi
#if [[ $#h -gt 0 ]]; then
# zstyle ':completion:*:(ssh|scp|slogin|sftp):*' hosts $h
#fi
fi
if [[ -r ~/.ssh/known_hosts ]]; then
h=($h ${${${(f)"$(cat ~/.ssh/known_hosts{,2} || true)"}%%\ *}%%,*}) 2>/dev/null
fi
if [[ $#h -gt 0 ]]; then
zstyle ':completion:*:(ssh|scp|slogin|sftp):*' hosts $h
fi
zstyle :compinstall filename '~/.zshrc'
#zstyle ':completion:*' completer _complete _ignored
#zstyle :compinstall filename '~/.zshrc'
#compinit