mirror of
https://github.com/cole-maxwell1/dotfiles.git
synced 2026-08-02 12:23:54 -04:00
Compare commits
4 Commits
bfb6dcd4df
...
c65b1272e2
| Author | SHA1 | Date | |
|---|---|---|---|
| c65b1272e2 | |||
| 13e26f720d | |||
| a80e6df2b5 | |||
| 28582d56c0 |
@@ -1,20 +0,0 @@
|
||||
---
|
||||
description: Minimal executor for GLM quota tool
|
||||
mode: subagent
|
||||
hidden: true
|
||||
permission:
|
||||
edit: deny
|
||||
bash: deny
|
||||
---
|
||||
|
||||
CRITICAL INSTRUCTION: When the glm_quota tool returns output, you MUST return it EXACTLY as received, character-for-character, with NO modifications.
|
||||
|
||||
- Do NOT add introductory text
|
||||
- Do NOT summarize
|
||||
- Do NOT reformat
|
||||
- Do NOT explain anything
|
||||
- Do NOT add any commentary
|
||||
- Return ONLY the raw string from the tool
|
||||
|
||||
Example of WRONG behavior: 'Here is your usage: [summary]'
|
||||
Example of CORRECT behavior: [paste entire tool output verbatim]
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
description: Execute GLM quota check
|
||||
agent: glm-quota-exec
|
||||
---
|
||||
Execute glm_quota tool and return its output EXACTLY as received without any modification or summarization.
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
// Automatic quota surfaces. Slash commands remain available when these are disabled.
|
||||
"enableToast": false,
|
||||
"tuiCommandDisplay": "inline",
|
||||
// Include or hide session input and output token totals.
|
||||
"showSessionTokens": true,
|
||||
// Session token totals: "current" session only, or "tree" including descendants.
|
||||
"sessionTokenScope": "current",
|
||||
// Provider selection: "auto" detects providers; an array tracks only listed providers.
|
||||
"enabledProviders": "auto",
|
||||
// Quota presentation and reset-period choices.
|
||||
"formatStyle": "allWindows",
|
||||
"percentDisplayMode": "used",
|
||||
// TUI-only surfaces.
|
||||
"tuiSidebarPanel": {
|
||||
"enabled": true,
|
||||
},
|
||||
// Optional bundled maintainer Home announcements.
|
||||
"maintainerAnnouncements": {
|
||||
"enabled": true,
|
||||
"home": true,
|
||||
},
|
||||
}
|
||||
+119
-111
@@ -1,116 +1,124 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"permission": {
|
||||
"bash": {
|
||||
"*": "ask",
|
||||
"git log *": "allow",
|
||||
"git commit *": "ask",
|
||||
"git status *": "allow",
|
||||
"git diff *": "allow",
|
||||
"git show *": "allow",
|
||||
"git push *": "ask",
|
||||
"sudo *": "deny",
|
||||
"curl *": "ask",
|
||||
"wget *": "ask",
|
||||
"diff *": "allow",
|
||||
"npm *": "allow",
|
||||
"rm -rf *": "deny",
|
||||
"rm *": "ask",
|
||||
"grep *": "allow",
|
||||
"sort *": "allow",
|
||||
"head *": "allow",
|
||||
"tail *": "allow",
|
||||
"ls *": "allow",
|
||||
"wc *": "allow",
|
||||
"go build *": "allow",
|
||||
"go test *": "allow",
|
||||
"go vet *": "allow",
|
||||
"go mod tidy": "allow",
|
||||
"go mod download": "allow",
|
||||
"dotnet *": "allow",
|
||||
"docker ps *": "allow",
|
||||
"docker logs *": "allow",
|
||||
"docker compose logs *": "allow",
|
||||
},
|
||||
"read": {
|
||||
".env": "deny",
|
||||
".secrets": "deny",
|
||||
"*.key": "deny",
|
||||
"*.pem": "deny",
|
||||
"id_rsa": "deny",
|
||||
"id_ed25519": "deny",
|
||||
".aws/credentials": "deny",
|
||||
"opencode.jsonc": "deny",
|
||||
"~/.ssh/known_hosts": "allow",
|
||||
},
|
||||
"grep": "allow",
|
||||
"glob": "allow",
|
||||
"question": "allow",
|
||||
"lsp": "allow",
|
||||
"websearch": "allow",
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"permission": {
|
||||
"bash": {
|
||||
"*": "ask",
|
||||
"git log *": "allow",
|
||||
"git commit *": "ask",
|
||||
"git status *": "allow",
|
||||
"git diff *": "allow",
|
||||
"git show *": "allow",
|
||||
"git push *": "ask",
|
||||
"sudo *": "deny",
|
||||
"curl *": "ask",
|
||||
"wget *": "ask",
|
||||
"diff *": "allow",
|
||||
"npm *": "allow",
|
||||
"rm -rf *": "deny",
|
||||
"rm *": "ask",
|
||||
"grep *": "allow",
|
||||
"sort *": "allow",
|
||||
"head *": "allow",
|
||||
"tail *": "allow",
|
||||
"echo *": "allow",
|
||||
"which *": "allow",
|
||||
"find *": "allow",
|
||||
"ls *": "allow",
|
||||
"wc *": "allow",
|
||||
"go build *": "allow",
|
||||
"go test *": "allow",
|
||||
"go vet *": "allow",
|
||||
"go mod tidy": "allow",
|
||||
"go mod download": "allow",
|
||||
"dotnet *": "allow",
|
||||
"docker ps *": "allow",
|
||||
"docker logs *": "allow",
|
||||
"docker compose logs *": "allow",
|
||||
},
|
||||
"mcp": {
|
||||
"zai-mcp-server": {
|
||||
"type": "local",
|
||||
"command": ["npx", "-y", "@z_ai/mcp-server"],
|
||||
"environment": {
|
||||
"Z_AI_API_KEY": "{env:ZAI_API_KEY}",
|
||||
"Z_AI_MODE": "ZAI",
|
||||
},
|
||||
},
|
||||
"web-search-prime": {
|
||||
"type": "remote",
|
||||
"url": "https://api.z.ai/api/mcp/web_search_prime/mcp",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {env:ZAI_API_KEY}",
|
||||
},
|
||||
},
|
||||
"web-reader": {
|
||||
"type": "remote",
|
||||
"url": "https://api.z.ai/api/mcp/web_reader/mcp",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {env:ZAI_API_KEY}",
|
||||
},
|
||||
},
|
||||
"zread": {
|
||||
"type": "remote",
|
||||
"url": "https://api.z.ai/api/mcp/zread/mcp",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {env:ZAI_API_KEY}",
|
||||
},
|
||||
},
|
||||
"ibmi-server": {
|
||||
"type": "local",
|
||||
"command": [
|
||||
"npx",
|
||||
"-y",
|
||||
"@ibm/ibmi-mcp-server@latest",
|
||||
"--tools",
|
||||
"/home/colem/mcp/ibmi-mcp-server/tools/custom-tools.yaml",
|
||||
],
|
||||
"enabled": true,
|
||||
"environment": {
|
||||
"DB2i_HOST": "{env:DB2i_HOST}",
|
||||
"DB2i_USER": "{env:DB2i_USER}",
|
||||
"DB2i_PASS": "{env:DB2i_PASS}",
|
||||
"DB2i_PORT": "8076",
|
||||
"DB2i_IGNORE_UNAUTHORIZED": "true",
|
||||
},
|
||||
},
|
||||
"read": {
|
||||
".env": "deny",
|
||||
".secrets": "deny",
|
||||
"*.key": "deny",
|
||||
"*.pem": "deny",
|
||||
"id_rsa": "deny",
|
||||
"id_ed25519": "deny",
|
||||
".aws/credentials": "deny",
|
||||
"~/.ssh/known_hosts": "allow",
|
||||
},
|
||||
"lsp": true,
|
||||
"formatter": true,
|
||||
"model": "zai-coding-plan/glm-5.2",
|
||||
"small_model": "zai-coding-plan/glm-4.5-air",
|
||||
"agent": {
|
||||
"explore": {
|
||||
"model": "zai-coding-plan/glm-4.5-air",
|
||||
},
|
||||
"scout": {
|
||||
"model": "zai-coding-plan/glm-4.5-air",
|
||||
},
|
||||
"grep": "allow",
|
||||
"glob": "allow",
|
||||
"question": "allow",
|
||||
"lsp": "allow",
|
||||
"websearch": "allow",
|
||||
},
|
||||
"mcp": {
|
||||
"zai-mcp-server": {
|
||||
"type": "local",
|
||||
"command": ["npx", "-y", "@z_ai/mcp-server"],
|
||||
"environment": {
|
||||
"Z_AI_API_KEY": "{env:ZAI_API_KEY}",
|
||||
"Z_AI_MODE": "ZAI",
|
||||
},
|
||||
},
|
||||
"share": "disabled",
|
||||
"snapshot": true,
|
||||
"plugin": ["opencode-glm-quota"],
|
||||
"web-search-prime": {
|
||||
"type": "remote",
|
||||
"url": "https://api.z.ai/api/mcp/web_search_prime/mcp",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {env:ZAI_API_KEY}",
|
||||
},
|
||||
},
|
||||
"web-reader": {
|
||||
"type": "remote",
|
||||
"url": "https://api.z.ai/api/mcp/web_reader/mcp",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {env:ZAI_API_KEY}",
|
||||
},
|
||||
},
|
||||
"zread": {
|
||||
"type": "remote",
|
||||
"url": "https://api.z.ai/api/mcp/zread/mcp",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {env:ZAI_API_KEY}",
|
||||
},
|
||||
},
|
||||
"ibmi-server": {
|
||||
"type": "local",
|
||||
"command": [
|
||||
"npx",
|
||||
"-y",
|
||||
"@ibm/ibmi-mcp-server@latest",
|
||||
"--tools",
|
||||
"/home/colem/mcp/ibmi-mcp-server/tools/custom-tools.yaml",
|
||||
],
|
||||
"enabled": false,
|
||||
"environment": {
|
||||
"DB2i_HOST": "{env:DB2i_HOST}",
|
||||
"DB2i_USER": "{env:DB2i_USER}",
|
||||
"DB2i_PASS": "{env:DB2i_PASS}",
|
||||
"DB2i_PORT": "8076",
|
||||
"DB2i_IGNORE_UNAUTHORIZED": "true",
|
||||
},
|
||||
},
|
||||
},
|
||||
"lsp": true,
|
||||
"formatter": true,
|
||||
"model": "zai-coding-plan/glm-5.2",
|
||||
"small_model": "zai-coding-plan/glm-4.5-air",
|
||||
"agent": {
|
||||
"explore": {
|
||||
"model": "zai-coding-plan/glm-4.5-air",
|
||||
},
|
||||
"scout": {
|
||||
"model": "zai-coding-plan/glm-4.5-air",
|
||||
},
|
||||
},
|
||||
"share": "disabled",
|
||||
"snapshot": true,
|
||||
// OpenCode Quota: tuiCommandDisplay chooses whether native TUI command output appears in the session transcript or a local popup dialog.
|
||||
// OpenCode Quota: loads the server plugin for slash commands and quota checks.
|
||||
"plugin": ["./plugin/ibmi-gate.ts", "@slkiser/opencode-quota@latest"],
|
||||
"provider": {
|
||||
// Detected zai authentication; opencode-quota added this global provider declaration.
|
||||
"zai": {},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Gate the ibmi-mcp-server on its required environment variables.
|
||||
|
||||
opencode's config schema types `mcp.<name>.enabled` as a static boolean and
|
||||
only interpolates `{env:VAR}` for string values (headers, environment
|
||||
entries), never for the `enabled` flag. Conditionally enabling a server is
|
||||
therefore not expressible in opencode.jsonc alone.
|
||||
|
||||
This plugin uses the `config` hook, which runs once at startup with the live
|
||||
merged config (before MCP servers spawn), to flip `ibmi-server.enabled` to
|
||||
`true` only when every required credential is present. The config keeps
|
||||
`enabled: false` as a fallback default, so the server stays off if this
|
||||
plugin fails to load.
|
||||
*/
|
||||
|
||||
import type { Plugin } from "@opencode-ai/plugin";
|
||||
|
||||
// Credentials the ibmi-server MCP needs to connect. All must be non-empty.
|
||||
const REQUIRED_ENV = ["DB2i_HOST", "DB2i_USER", "DB2i_PASS"] as const;
|
||||
const SERVER = "ibmi-server";
|
||||
|
||||
export default (async () => {
|
||||
return {
|
||||
config: (cfg) => {
|
||||
const ready = REQUIRED_ENV.every((name) => {
|
||||
const value = process.env[name];
|
||||
return typeof value === "string" && value.length > 0;
|
||||
});
|
||||
const server = cfg.mcp?.[SERVER];
|
||||
if (server && typeof server === "object") {
|
||||
(server as { enabled?: boolean }).enabled = ready;
|
||||
}
|
||||
},
|
||||
};
|
||||
}) satisfies Plugin;
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
name: glm-quota
|
||||
description: Query Z.ai GLM Coding Plan usage statistics including quota limits, model usage, and MCP tool usage
|
||||
parameters:
|
||||
- name: detailed
|
||||
type: boolean
|
||||
optional: true
|
||||
description: Show detailed usage breakdown
|
||||
---
|
||||
Query GLM quota usage including token limits and MCP tool usage.
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/tui.json",
|
||||
// OpenCode Quota: tuiCommandDisplay chooses whether native TUI command output appears in the session transcript or a local popup dialog.
|
||||
// OpenCode Quota: loads the TUI sidebar, compact status, and local commands.
|
||||
"plugin": [
|
||||
"@slkiser/opencode-quota@latest"
|
||||
]
|
||||
}
|
||||
@@ -1,38 +1,73 @@
|
||||
# ZSH Plugin and Theme
|
||||
The key to this setup is [GNU `stow`](https://www.gnu.org/software/stow/) a symlink manager. `stow` allows you to easily link the files in the repo directly to where these files would be in your home directory originally.
|
||||
# Cole's Dotfiles
|
||||
|
||||
I prefer to manually install the my zsh theme and plugins. I like to the `~/.zsh` directory to store the repos of any dependencies I bring into my config.
|
||||
Personal dotfiles for zsh, Neovim, and opencode, plus a few shell scripts. The setup is managed with [GNU `stow`](https://www.gnu.org/software/stow/), a symlink manager that links the files in this repo to their corresponding locations under the home directory.
|
||||
|
||||
# Prerequisites
|
||||
The zsh theme and plugins are installed manually rather than through a plugin manager. The `~/.zsh` directory is used to hold the git repos of any shell dependencies.
|
||||
|
||||
## GNU `stow`
|
||||
Install `stow` with your system's package manager.
|
||||
## Repository layout
|
||||
|
||||
## Nerd Fonts
|
||||
Make sure you get a nerd font [installed](https://github.com/ryanoasis/nerd-fonts) and [configured](https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#meslo-nerd-font-patched-for-powerlevel10k) for your terminal emulators, text editors, and IDEs of choice.
|
||||
|
||||
## Powerlevel10k
|
||||
|
||||
```sh
|
||||
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.zsh/powerlevel10k
|
||||
```text
|
||||
.
|
||||
├── .zshrc # zsh config: PATH, history, completions, prompt, aliases
|
||||
├── .config/
|
||||
│ ├── nvim/ # Neovim config (init.lua, lua/, after/, queries/)
|
||||
│ └── opencode/ # opencode config (agents, skills, plugins, rules)
|
||||
└── .scripts/ # Standalone shell scripts (on $PATH)
|
||||
└── hello.sh
|
||||
```
|
||||
|
||||
## zsh-autosuggestions
|
||||
Everything above is relative to the home directory, which is exactly what `stow .` expects.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Required
|
||||
|
||||
- **GNU `stow`** — install with the system package manager (`brew install stow`, `apt install stow`, etc.).
|
||||
- **A Nerd Font** — [install](https://github.com/ryanoasis/nerd-fonts) one and [configure](https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#meslo-nerd-font-patched-for-powerlevel10k) it in the terminal, editor, and IDE of choice. Required for icons in the prompt and `lsd`.
|
||||
|
||||
### Shell theme and plugins
|
||||
|
||||
Clone into `~/.zsh/` so `.zshrc` picks them up automatically:
|
||||
|
||||
```sh
|
||||
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
|
||||
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.zsh/powerlevel10k
|
||||
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
|
||||
```
|
||||
|
||||
# Configure a New Machine
|
||||
1. Clone this repository to your home directory
|
||||
### Optional
|
||||
|
||||
- **`lsd`** — drives the `ls`/`ll`/`lt` aliases in `.zshrc`. Without it, the aliases fall back to the system `ls`. ([github.com/lsd-rs/lsd](https://github.com/lsd-rs/lsd))
|
||||
|
||||
## Configure a new machine
|
||||
|
||||
1. Clone into the home directory:
|
||||
```sh
|
||||
git clone https://github.com/cole-maxwell1/dotfiles.git
|
||||
git clone https://github.com/cole-maxwell1/dotfiles.git ~/dotfiles
|
||||
```
|
||||
2. Run GNU stow
|
||||
2. Symlink the dotfiles into place with stow:
|
||||
```sh
|
||||
cd dotfiles && stow .
|
||||
cd ~/dotfiles && stow .
|
||||
```
|
||||
3. Make scripts executable for current user
|
||||
3. Make the scripts executable:
|
||||
```sh
|
||||
chmod -R u+x ~/dotfiles/.scripts/
|
||||
```
|
||||
```
|
||||
4. If this is the first run with Powerlevel10k, generate the prompt config:
|
||||
```sh
|
||||
p10k configure
|
||||
```
|
||||
5. Restart the shell (or `exec zsh`) to load the new config.
|
||||
|
||||
## Unlink or uninstall
|
||||
|
||||
To remove the symlinks without deleting the repo:
|
||||
|
||||
```sh
|
||||
cd ~/dotfiles && stow -D .
|
||||
```
|
||||
|
||||
Running `stow .` again re-creates them.
|
||||
|
||||
## Secrets
|
||||
|
||||
If `~/.secrets` exists, `.zshrc` sources it near the top of the file so environment variables (API keys, tokens, etc.) are exported into the shell. This file is intentionally **not** part of the repo — create it locally and keep it out of version control.
|
||||
|
||||
Reference in New Issue
Block a user