aygea fd8e8cbbd7 docs: AGENTS.md + evidence-backed scaffold (state, trials, decisions, handoff)
- AGENTS.md operating rules incl. Gitea SSH port-2222 note + known_hosts incident
- CURRENT_STATE / TODO / CHANGELOG / TRIALS
- trials: endpoint-key pairing; config-merge safety matrix 14/14 (verify.sh + output)
- docs: DECISIONS (mcode 0.6.12 bundle facts, digest-pinned), FEATURE-MATRIX, PROJECT-HANDOFF
- handoffs: TEMPLATE + 2026-10-19 initial-install record
2026-10-19 23:25:21 -07:00
2026-10-19 22:00:17 -07:00
2026-10-19 22:00:17 -07:00

mcode-status

Aygea-branded z.ai GLM usage segment for the MiniMax Code statusline — shows your current 5-hour token-window burn right in the TUI:

🔥 23% · 4:12p(2h14m)

Styled with the Aygea palette (blue → lavender → pink as the window fills), rendered via mcode's colorMode: ansi statusline option, with plain-text fallback.

Install (one line)

curl -fsSL https://git.itsaygea.com/admin/mcode-sl/raw/branch/main/install.sh | bash

The installer is self-contained (the statusline script is embedded in it) and:

  1. installs ~/.local/bin/mcode-zai-usage
  2. checks SecretVault for your zai_api_key secret (never prints it)
  3. merges the tui: section into ~/.minimax/config.yaml — atomic write, timestamped backup, refuses ambiguous structures, everything outside the tui: block stays byte-identical
  4. primes the quota cache so the segment appears immediately

Then restart the MiniMax Code TUI.

Secret setup (once per machine)

This looks like an example entry, but it's the actual setup: create a SecretVault secret named zai_api_key holding your z.ai API key (for https://api.z.ai):

  • via the SecretVault MCP create_secret tool in any agent session, or your usual SecretVault flow

No key in the repo, no key in argv, no key in the config file — the statusline reads it at runtime with secretvault run. A legacy ~/.secretvault/credential.json (url + clientKey, the Claude-statusline layout) also works as a fallback.

No cron, no systemd

MiniMax Code re-runs the command every intervalSeconds — mcode is the scheduler. The script never blocks the TUI on the network: display comes from a local cache, and a detached, flock-guarded background job refreshes it when the cache is >150s old (sharing ~/.cache/aygea-sl/quota.json with the Aygea Claude statusline if both are installed).

Config (managed in ~/.minimax/config.yaml)

tui:
  statusLine:
    - current-dir
    - git-branch
    - approval-mode
    - model-with-reasoning
    - context-remaining
    - custom-command
  customStatusLine:
    command: /home/you/.local/bin/mcode-zai-usage
    intervalSeconds: 60
    timeoutMs: 10000
    colorMode: ansi

Installer env overrides: MCODE_SL_ITEMS (item list), MCODE_SL_INTERVAL, MCODE_SL_TIMEOUT, MCODE_SL_SECRET.

Script env tunables

Variable Default Meaning
AYGEA_SL_SECRET_NAME zai_api_key SecretVault secret name
AYGEA_SL_URL https://api.z.ai quota API base URL
AYGEA_SL_NO_VAULT=1 off skip SecretVault, use credential.json
AYGEA_SL_QUOTA_CACHE ~/.cache/aygea-sl/quota.json cache path
AYGEA_SL_REFRESH_AFTER 150 refresh when cache older (sec)
AYGEA_SL_MAX_AGE 360 hide when cache older (sec)
AYGEA_SL_CURL_TIMEOUT 6 per-fetch curl --max-time
AYGEA_SL_ONLY_GLM=1 off show only for glm models
AYGEA_SL_MEM=1 off prepend an 🧠 memory segment (Linux/macOS)
NO_COLOR — plain text output

Uninstall

curl -fsSL https://git.itsaygea.com/admin/mcode-sl/raw/branch/main/install.sh | bash -s -- --uninstall

Documentation

  • AGENTS.md — operating instructions for humans + agents (incl. Gitea SSH notes)
  • CURRENT_STATE.md — where the project stands and the exact next action
  • TODO.md — prioritized work with acceptance criteria
  • CHANGELOG.md / TRIALS.md — change log and experiment index
  • docs/ — decisions (ADR-style), feature matrix, handoff protocol
  • handoffs/ — stage continuation records; tooling/ — verified toolchain

Development

Requires jq + curl; secretvault optional (fallback: credential.json); python3 for the config merge. Test locally:

printf '{}' | ./zai-usage.sh          # statusline preview
./zai-usage.sh --refresh              # one foreground refresh

install.sh embeds a copy of zai-usage.sh for curl | bash installs; checkout installs prefer the sibling file. After editing zai-usage.sh, regenerate the embedded copy:

python3 - <<'EOF'
import re
src = open('zai-usage.sh').read(); assert src.endswith("\n")
ins = open('install.sh').read()
new = re.sub(r"(cat <<'ZAI_EMBED_EOF'\n).*?ZAI_EMBED_EOF\n",
             lambda m: m.group(1) + src + "ZAI_EMBED_EOF\n", ins, flags=re.S)
open('install.sh', 'w').write(new)
EOF
S
Description
my mcode statusline
Readme
68 KiB
0 Stars 1 Watchers 0 Forks
Languages
Shell 100%