check-usage
Check all AI CLI (Claude, Codex, Gemini, Antigravity, z.ai) usage limits and get recommendations
Add check-ai shell alias for quick CLI usage check
> /plugin marketplace add uppinote20/claude-dashboard > /plugin install claude-dashboard@claude-dashboard
How it fires
How this command gets triggered: by you, by Claude, or both.
/setup-aliasContext preview
What this command does when you run it.
Add check-ai shell alias for quick CLI usage check
description: Add check-ai shell alias for quick CLI usage check argument-hint: "" allowed-tools: Bash(echo:*), Bash(cat:*), Bash(grep:*), Bash(uname:*), Bash(powershell*), Read
Add a `check-ai` command to quickly check all AI CLI usage from your terminal.
After setup, you can run:
check-ai # Pretty output check-ai --json # JSON output for scripting
uname -s
**Check current shell and config file:**
echo $SHELL
**Check if already exists:**
grep -q "^check-ai()" ~/.zshrc 2>/dev/null && echo "exists" || echo "not found"
**Function to add** (resolves the newest installed version in `node` rather than shelling out to `sort -V`, which is a GNU/BSD extension, not POSIX; re-reads `CLAUDE_CONFIG_DIR` on every call, so it follows account switches instead of freezing the path at definition time):
# Claude Dashboard - check-ai alias
check-ai() {
local cfgdir="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
local script
script="$(CFGDIR="$cfgdir" node -e '
const fs = require("fs");
const path = require("path");
const cfgDir = process.env.CFGDIR;
const cacheRoot = path.join(cfgDir, "plugins/cache/claude-dashboard/claude-dashboard");
let entries = [];
try {
entries = fs.readdirSync(cacheRoot, { withFileTypes: true });
} catch {}
const versions = entries
.filter((e) => e.isDirectory() && /^\d+\.\d+\.\d+$/.test(e.name))
.map((e) => e.name)
.filter((v) => fs.existsSync(path.join(cacheRoot, v, "dist/check-usage.js")))
.sort((a, b) => {
const pa = a.split(".").map(Number);
const pb = b.split(".").map(Number);
return pa[0] - pb[0] || pa[1] - pb[1] || pa[2] - pb[2];
});
if (versions.length === 0) {
console.error("claude-dashboard is not installed in " + cfgDir);
process.exit(1);
}
console.log(path.join(cacheRoot, versions[versions.length - 1], "dist/check-usage.js"));
')" || return 1
node "$script" "$@"
}**Add to config file (example for zsh):**
cat >> ~/.zshrc << 'EOF'
# Claude Dashboard - check-ai alias
check-ai() {
local cfgdir="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
local script
script="$(CFGDIR="$cfgdir" node -e '
const fs = require("fs");
const path = require("path");
const cfgDir = process.env.CFGDIR;
const cacheRoot = path.join(cfgDir, "plugins/cache/claude-dashboard/claude-dashboard");
let entries = [];
try {
entries = fs.readdirSync(cacheRoot, { withFileTypes: true });
} catch {}
const versions = entries
.filter((e) => e.isDirectory() && /^\d+\.\d+\.\d+$/.test(e.name))
.map((e) => e.name)
.filter((v) => fs.existsSync(path.join(cacheRoot, v, "dist/check-usage.js")))
.sort((a, b) => {
const pa = a.split(".").map(Number);
const pb = b.split(".").map(Number);
return pa[0] - pb[0] || pa[1] - pb[1] || pa[2] - pb[2];
});
if (versions.length === 0) {
console.error("claude-dashboard is not installed in " + cfgDir);
process.exit(1);
}
console.log(path.join(cacheRoot, versions[versions.length - 1], "dist/check-usage.js"));
')" || return 1
node "$script" "$@"
}
EOF**Check if PowerShell profile exists:**
powershell -Command "Test-Path $PROFILE"
**Check if already exists:**
powershell -Command "if (Test-Path $PROFILE) { Select-String -Path $PROFILE -Pattern 'function check-ai' -Quiet } else { $false }"**Function to add:**
# Claude Dashboard - check-ai alias
function check-ai {
$base = if ($env:CLAUDE_CONFIG_DIR) { $env:CLAUDE_CONFIG_DIR } else { "$env:USERPROFILE\.claude" }
$script = (Get-ChildItem "$base\plugins\cache\claude-dashboard\claude-dashboard\*\dist\check-usage.js" | Sort-Object { [version]$_.Directory.Parent.Name } | Select-Object -Last 1).FullName
node $script $args
}**Add to PowerShell profile:**
powershell -Command "Add-Content -Path $PROFILE -Value @'
# Claude Dashboard - check-ai alias
function check-ai {
`$base = if (`$env:CLAUDE_CONFIG_DIR) { `$env:CLAUDE_CONFIG_DIR } else { \"`$env:USERPROFILE\.claude\" }
`$script = (Get-ChildItem \"`$base\plugins\cache\claude-dashboard\claude-dashboard\*\dist\check-usage.js\" | Sort-Object { [version]`$_.Directory.Parent.Name } | Select-Object -Last 1).FullName
node `$script `$args
}
'@"**If already exists:**
✓ check-ai is already configured in [config file]. Usage: check-ai # Pretty output check-ai --json # JSON output for scripting
**If newly added:**
✓ Added check-ai to [config file]. To activate now, run: source ~/.zshrc (or restart your terminal) Usage: check-ai # Pretty output check-ai --json # JSON output for scripting
**For Windows:**
✓ Added check-ai to PowerShell profile. To activate now: Restart PowerShell or run: . $PROFILE Usage: check-ai # Pretty output check-ai --json # JSON output for scripting
Comprehensive status line plugin for Claude Code — unified usage monitoring across Claude, Codex, Gemini, Antigravity, and z.ai CLIs, with context, rate limits, cost tracking, and a modular widget system.
Repo: uppinote20/claude-dashboard
Check all AI CLI (Claude, Codex, Gemini, Antigravity, z.ai) usage limits and get recommendations