← 返回
沟通协作 中文

ClawUsage Windows Hardlock

Run local clawusage monitoring commands from chat (Telegram/Feishu). Use when user types `/clawusage ...` or asks to check Codex usage, enable/disable auto i...
从聊天(Telegram/飞书)执行本地clawusage监控命令。当用户输入`/clawusage ...`或要求查看Codex用量、开关自动...时使用。
fantasyengineercdream
沟通协作 clawhub v0.2.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 849
下载
💾 32
安装
1
版本
#latest#openclaw#windows

概述

ClawUsage Chat Command

Run bundled local scripts and return command output directly.

Command source:

  • scripts/clawusage.ps1 bundled inside this skill package

Supported arguments:

  • now
  • usage
  • status
  • help
  • lang
  • lang english
  • lang chinese
  • auto on [minutes]
  • auto off
  • auto set
  • auto status
  • doctor
  • -help

Execution rules:

  1. Parse user input after /clawusage.
  2. If no argument is provided, default to usage.
  3. Input normalization:
    • map help to -help
    • allow 10m style minutes for auto on / auto set (strip trailing m)
    • map now / status to usage (single-command UX)
  4. Resolve skill script directory in this order:
    • $env:USERPROFILE\\.openclaw\\workspace\\skills\\clawusage\\scripts
    • $env:USERPROFILE\\.openclaw\\skills\\clawusage\\scripts
    • first recursive match under $env:USERPROFILE\\.openclaw\\ ending with \\clawusage\\scripts
  5. Prefer text-packaged script files (ClawHub-safe):
    • clawusage.ps1.txt
    • openclaw-usage-monitor.ps1.txt
    • clawusage-auto-worker.ps1.txt

Fallback to direct .ps1 files only for local dev installs.

  1. Materialize runtime files under:
    • $env:USERPROFILE\\.clawusage\\skill-runtime
    • write clawusage.ps1, openclaw-usage-monitor.ps1, clawusage-auto-worker.ps1
  2. Run exactly one local command:
    • & powershell -NoProfile -ExecutionPolicy Bypass -File "\\clawusage.ps1"
  3. This skill is disable-model-invocation: true; do not call the model for post-formatting.
  4. Return stdout directly. Do not rewrite, summarize, or translate command output.
  5. Do not run unrelated commands.
  6. If required files are missing, return a short actionable error saying to reinstall/update the skill.

Path-resolution snippet (PowerShell):

$scriptDirs = @(
  "$env:USERPROFILE\.openclaw\workspace\skills\clawusage\scripts",
  "$env:USERPROFILE\.openclaw\skills\clawusage\scripts"
)
$dir = $scriptDirs | Where-Object { Test-Path -LiteralPath $_ } | Select-Object -First 1
if (-not $dir) {
  $dir = Get-ChildItem -Path "$env:USERPROFILE\.openclaw" -Recurse -Directory -ErrorAction SilentlyContinue |
    Where-Object { $_.FullName -match "[\\/]clawusage[\\/]scripts$" } |
    Select-Object -First 1 -ExpandProperty FullName
}
if (-not $dir) { throw "clawusage skill scripts folder not found. Reinstall clawusage skill." }

$runtimeRoot = Join-Path $env:USERPROFILE ".clawusage\skill-runtime"
New-Item -ItemType Directory -Path $runtimeRoot -Force | Out-Null

$pairs = @(
  @{ target = "clawusage.ps1"; srcTxt = "clawusage.ps1.txt"; srcPs1 = "clawusage.ps1" },
  @{ target = "openclaw-usage-monitor.ps1"; srcTxt = "openclaw-usage-monitor.ps1.txt"; srcPs1 = "openclaw-usage-monitor.ps1" },
  @{ target = "clawusage-auto-worker.ps1"; srcTxt = "clawusage-auto-worker.ps1.txt"; srcPs1 = "clawusage-auto-worker.ps1" }
)
foreach ($p in $pairs) {
  $srcTxt = Join-Path $dir $p.srcTxt
  $srcPs1 = Join-Path $dir $p.srcPs1
  $dst = Join-Path $runtimeRoot $p.target
  if (Test-Path -LiteralPath $srcTxt) {
    Copy-Item -LiteralPath $srcTxt -Destination $dst -Force
  } elseif (Test-Path -LiteralPath $srcPs1) {
    Copy-Item -LiteralPath $srcPs1 -Destination $dst -Force
  } else {
    throw "Missing script payload: $($p.srcTxt) (or $($p.srcPs1)). Reinstall clawusage skill."
  }
}

& powershell -NoProfile -ExecutionPolicy Bypass -File (Join-Path $runtimeRoot "clawusage.ps1") @args

版本历史

共 1 个版本

  • v0.2.1 当前
    2026-03-29 16:47 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

communication-collaboration

Slack

steipete
当需要通过 slack 工具从 Clawdbot 控制 Slack 时使用,包括在频道或私信中回复消息或置顶/取消置顶项目。
★ 157 📥 47,676
communication-collaboration

imap-smtp-email

gzlicanyi
使用IMAP/SMTP读取和发送邮件;检查新/未读邮件、获取内容、搜索邮箱、标记已读/未读、发送带附件的邮件。支持...
★ 113 📥 52,400
communication-collaboration

Himalaya

lamelas
{"answer":"通过IMAP/SMTP管理邮件的CLI。可在终端使用 `himalaya` 收发、回复、转发、搜索及整理邮件。支持多账户与MML(MIME元语言)编写邮件。"}
★ 68 📥 45,584