codex-usage

$npx mdskill add uvwt/agentdock/codex-usage

Check macOS user's Codex CLI login state and query usage quota without revealing credentials

  • Determine if the local macOS user has a valid Codex CLI login.
  • Query Codex usage to retrieve detailed information about quotas and usage.
  • Decide based on the existence of `auth.json` file, token validity, and account ID presence.
  • Deliver results in redacted form without exposing sensitive data.

SKILL.md

.github/skills/codex-usageView on GitHub ↗
---
name: codex-usage
description: Use this skill when checking the current macOS user Codex CLI account state or Codex usage quota.
version: 0.1.6
---

# Codex Usage

读取当前 macOS 用户的 Codex CLI 登录状态,并查询 ChatGPT Codex 订阅额度。只提供手动查询,不创建或管理定时任务。

## 动作

- `status`:检查 `~/.codex/auth.json` 是否存在、访问令牌是否仍有效、是否能取得 account ID。所有凭据均脱敏。
- `query`:查询当前套餐、session/weekly 窗口、credits、spend_control、可用重置次数、额外限额、code review 限额、promo/referral 等接口字段,并返回打码后的 raw_response_redacted。

## Authentication

默认读取系统当前用户的 `~/.codex/auth.json`。由于 AgentDock 的 `HOME` 可能指向 workspace,Skill 通过系统用户数据库定位真实用户目录。可通过 `CODEX_HOME` 覆盖 Codex 配置目录。

## Security

- 不接受 token 作为输入。
- 不输出 access token、refresh token、ID token、Authorization header 或真实 account ID、真实 user ID 或真实邮箱。
- 只读认证文件,不修改 Codex 登录状态。
- 只访问 ChatGPT Codex usage 接口。

## 辅助脚本执行

Skill 本体是本说明文档。确需调用包内辅助脚本时,在 Skill 包根目录使用相对路径执行;运行宿主负责切换到包根目录并把所需变量注入当前子进程。

```bash
printf '%s' '{"skill_action":"<动作>"}' | python3 run.py
```

输入必须是 JSON 对象。写操作仍按本文档中的确认规则执行。

| 动作 | 用途 |
|---|---|
| `status` | Check local Codex CLI login state without revealing credentials. |
| `query` | Query Codex usage and expose the full redacted usage API payload plus parsed quota fields. |

More from uvwt/agentdock

SkillDescription
baidu-netdiskUse this skill when managing Baidu Netdisk files through the bdpan CLI inside the application data scope.
barkSend Bark-compatible notifications with Python standard library while keeping the device key in the private Skill data environment.
cloudsaverUse this skill when calling the local CloudSaver API for status checks, resource search, Douban hot lists, share parsing, or transfer actions.
code-debriefExplain and teach the core implementation produced by vibecoding from real code, focusing on the main call chain, core code, state and data flow, design reasoning, and transferable engineering knowledge. Use when the user asks to explain, review, learn, debrief, or understand recent code changes, a commit, PR, diff, feature, module, or code path.
desktopmacOS desktop automation as an AgentDock Skill workflow.
douban-marks只读查询豆瓣电影、图书、音乐标记列表和电影条目联想。用于读取用户自己的已看、想看、在看等标记;公开主页可直接读,私密列表需要本机环境或 .env 中的 DOUBAN_COOKIE。禁止用于批量采集、绕登录、写入标记或读取非授权账号。
douyin-hot获取抖音实时热榜并返回标题、热度和跳转链接。
find-skills-skillSearch and discover OpenClaw skills from various sources. Use when: user wants to find available skills, search for specific functionality, or discover new skills to install.
grok-quotaQuery detailed Grok weekly usage, GrokChat/GrokBuild breakdown, plan, monthly credits, and pay-as-you-go state from local xAI OAuth credentials.
linkwardenManage a Linkwarden instance through its official HTTP API: check configuration, search and inspect bookmarks, collections, tags and highlights, and perform controlled link, collection or tag changes with explicit confirmation for destructive actions.