Token导航 LogoToken导航TokenDH.com
开发执行命令github未标认证来源可访问许可证需确认审计通过

statusline-config状态行配置

Agent Skill

statusline-config 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,211

周安装

52

GitHub Stars

147

下载量

424
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:statusline-config(状态行配置)
来源仓库:https://github.com/sd0xdev/sd0x-dev-flow
仓库路径:skills/statusline-config
安装命令:
npx skills add https://github.com/sd0xdev/sd0x-dev-flow --skill statusline-config
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/sd0xdev/sd0x-dev-flow --skill statusline-config

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。
  • 通过 npx skills add 命令从指定仓库安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 当前无详细功能描述,建议查看来源仓库获取完整说明。

SKILL.md

StatusLine Config

Customize ~/.claude/statusline-command.sh — segments, themes, and colors.

When NOT to Use

ScenarioUse Instead
Setting statusline for the first time (no customization needed)Built-in statusline-setup agent (Claude Code agent type) — applies defaults automatically
Editing settings.json directlyManual edit — this skill manages statusline-command.sh, not settings.json
Debugging Claude Code startup issues/claude-health — config health check

Segments

SegmentJSON FieldDefaultNotes
Directoryworkspace.current_dirONTruncate deep paths: ~/.../last-dir
Git branchshell gitON--no-optional-locks, cache 5s
Agentagent.nameON (conditional)Show when present; color: C_MODEL
Modelmodel.display_name + context_window.context_window_sizeONSmart tier suffix: Opus 4.6 (1M) — auto-skip if display_name already contains context info
Context %context_window.remaining_percentage + context_window_sizeONctx 60% left (600k/1M) — Green >40%, Yellow 20-40%, Red <=20%
Token Usagecontext_window.total_input_tokens + total_output_tokensON (conditional){in}k/{out}k session cumulative; color: C_COST
Costcost.total_cost_usdONShow when >= $0.005, est $X.XX
Rate Limitsrate_limits.five_hour.used_percentage + seven_day.used_percentageON (conditional)5h: 85% left · 7d: 82% left — displays remaining (100 - used); color thresholds match context %: Green >40%, Yellow 20-40%, Red <=20%; OAuth users only
Worktreeworktree.name + worktree.branchON (conditional)[WT:{name}] {branch} or [WT:{name}] if branch absent; replaces Directory + Git branch when present; color: C_BRANCH

For full JSON schema, see json-schema.md.

Themes

ThemeTypeDefaultNotes
ansi-defaultANSI 16Safe fallback, works everywhere
catppuccin-mochaTrueColorRecommended — pastel, WCAG AA >=4.5:1
draculaTrueColorVibrant purple/pink accents
nordTrueColorArctic blue, muted tones
noneNo colors (NO_COLOR auto-triggers)

Switch via: export CLAUDE_STATUSLINE_THEME=catppuccin-mocha

For complete token→hex mappings, see themes.md.

Semantic Tokens

Scripts use semantic tokens instead of hardcoded colors:

TokenRoleExample
C_CWDDirectory pathblue / sapphire
C_BRANCHGit branch namemagenta / mauve
C_MODELModel display namecyan / teal
C_CTX_OKContext >= 41%green
C_CTX_WARNContext 21-40%yellow
C_CTX_BADContext <= 20%red
C_COSTCost displaymuted text
C_ALERT>200k token warning (legacy, segment removed)orange/peach + bold
C_SEPPipe separator `\`dim/overlay
C_MUTEDSecondary infosubtext
C_TEXTGeneral textforeground
C_RESETReset all formatting\033[0m

Workflow

No args → Apply best-practice defaults (all ON segments + ansi-default theme). Go to step 4.

Theme change (e.g. "use catppuccin-mocha", "switch to dracula") → Read themes.md, apply requested theme. Go to step 4. Aliases: catppuccincatppuccin-mocha.

Custom requests (e.g. "add cost", "remove git", "no colors") → Interactive flow:

  1. Read current script: cat ~/.claude/statusline-command.sh
  2. Ask segments to enable/disable (AskUserQuestion multiSelect)
  3. Ask theme preference (AskUserQuestion with theme options)
  4. Generate script following Script Rules + selected theme from themes.md
  5. Write to ~/.claude/statusline-command.sh
  6. Verify: echo '{"model":{"display_name":"Opus 4.6"},"workspace":{"current_dir":"/tmp/test"},"context_window":{"remaining_percentage":55},"cost":{"total_cost_usd":0.42},"exceeds_200k_tokens":false}' | ~/.claude/statusline-command.sh

Script Rules

  • Shebang: #!/bin/sh (POSIX)
  • Read stdin: input=$(cat)
  • Parse JSON: jq -r '.field // fallback'
  • Theme from env: theme="${CLAUDE_STATUSLINE_THEME:-ansi-default}"
  • NO_COLOR: [-n "${NO_COLOR:-}"] && theme="none"
  • Theme aliases: catppuccincatppuccin-mocha
  • Invalid theme: fallback to ansi-default
  • Color output: printf "%b" for ANSI/TrueColor, printf "%s" for none
  • TrueColor format: \033[38;2;R;G;Bm (24-bit foreground)
  • Git: git --no-optional-locks -C "$dir"
  • Git cache: /tmp/claude-statusline-git-cache-$(id -u), 5s TTL, stat -f %m (macOS) / stat -c %Y (Linux)
  • CWD truncation: depth >2 → ~/.../basename
  • Cost: only when >= 0.005, format est $X.XX
  • Alert style: C_ALERT + bold (\033[1m) to distinguish from C_CTX_BAD
  • Token format: %.1fk via awk (e.g. 8500 → 8.5k); values < 1000 show raw number
  • Tier format: >=1M → (1M), >=1000 → ({N}k), else raw; used for model suffix + context absolute
  • Model tier suffix: append (1M) or (200k) from context_window_size; skip if display_name already contains context, 1M, or 200k
  • Context absolute: ctx 60% left (600k/1M) — remaining tokens calculated from remaining_percentage * context_window_size / 100
  • Sanitize free-text: strip control chars (tr -d '[:cntrl:]') + truncate 30 chars for agent.name, worktree.name, worktree.branch
  • Worktree replace: when worktree.name present, replace Directory + Git branch with [WT:{name}] {branch} (or [WT:{name}] if worktree.branch absent — hook-based worktrees)
  • Rate limits: show when rate_limits present; display remaining % (100 - used_percentage) with "left" suffix; format 5h: {rem}% left · 7d: {rem}% left; color by worst remaining — Green >40% (C_CTX_OK), Yellow 20-40% (C_CTX_WARN), Red <=20% (C_CTX_BAD); thresholds match context %; OAuth users only
  • Rate limits resets_at: extracted but not displayed in v1 (too verbose for statusline)
  • Render order (normal): Directory | Git branch | Agent? | Model (tier) | Context % (abs) · Token Usage? · Cost? · Rate Limits?
  • Render order (worktree): [WT:name] branch | Agent? | Model (tier) | Context % (abs) · Token Usage? · Cost? · Rate Limits?

Script Structure

#!/bin/sh
input=$(cat)
# ... extract JSON fields ...

theme="${CLAUDE_STATUSLINE_THEME:-ansi-default}"
[ -n "${NO_COLOR:-}" ] && theme="none"

case "$theme" in
  catppuccin|catppuccin-mocha) # set C_* tokens with TrueColor values ;;
  dracula)          # ... ;;
  nord)             # ... ;;
  none)             # all C_* = "" ;;
  *)                # ansi-default: ANSI 16 colors ;;
esac

# ... build output using C_* tokens ...
if [ "$theme" = "none" ]; then
  printf "%s" "$out"
else
  printf "%b" "$out"
fi

Example Output

Normal mode (1M context):
~/.../my-project | feat/auth | Opus 4.6 (1M) | ctx 60% left (600k/1M) · 85.0k/12.0k · est $18.12

Normal mode (200k context):
~/.../my-project | main | Sonnet 4.6 (200k) | ctx 30% left (60k/200k) · 120.0k/8.0k · est $3.50

With agent:
~/.../my-project | feat/auth | security-reviewer | Opus 4.6 (1M) | ctx 48% left (480k/1M) · est $0.12

Worktree mode:
[WT:fix-123] bugfix/issue-123 | Opus 4.6 (1M) | ctx 22% left (220k/1M) · 42.0k/8.0k · est $1.23

With rate limits (OAuth user, green):
~/.../my-project | feat/auth | Opus 4.6 (1M) | ctx 60% left (600k/1M) · 85.0k/12.0k · est $18.12 · 5h: 58% left · 7d: 82% left

Rate limits warning (yellow):
~/.../my-project | main | Opus 4.6 (1M) | ctx 30% left (300k/1M) · 5h: 25% left · 7d: 35% left

Rate limits critical (red):
~/.../my-project | main | Opus 4.6 (1M) | ctx 30% left (300k/1M) · 5h: 8% left · 7d: 55% left

display_name already has context info (no duplicate suffix):
~/.../my-project | main | Opus 4.6 (1M context) | ctx 60% left (600k/1M) · est $18.12

Output

ArtifactPathDescription
StatusLine script~/.claude/statusline-command.shPOSIX shell script consuming JSON stdin

Verification

After generating the script, verify:

  • ~/.claude/statusline-command.sh exists and is executable (chmod +x)
  • v2 test passes: echo '{"model":{"display_name":"Opus 4.6"},"cwd":"/tmp/test","workspace":{"current_dir":"/tmp/test","project_dir":"/tmp/test"},"context_window":{"remaining_percentage":55,"used_percentage":45,"context_window_size":200000,"total_input_tokens":85000,"total_output_tokens":12000,"current_usage":{"input_tokens":8500,"output_tokens":1200,"cache_creation_input_tokens":5000,"cache_read_input_tokens":2000}},"cost":{"total_cost_usd":0.42},"exceeds_200k_tokens":false,"session_id":"test","version":"2.1.80","output_style":{"name":"default"},"rate_limits":{"five_hour":{"used_percentage":42.5,"resets_at":"2026-03-21T14:30:00Z"},"seven_day":{"used_percentage":18.2,"resets_at":"2026-03-25T00:00:00Z"}}}' | ~/.claude/statusline-command.sh
  • Output contains expected segments (directory, model, context %, token usage 8.5k/1.2k)
  • Agent test: echo '{"model":{"display_name":"Opus 4.6"},"workspace":{"current_dir":"/tmp/test"},"context_window":{"remaining_percentage":55},"cost":{"total_cost_usd":0.42},"exceeds_200k_tokens":false,"agent":{"name":"security-reviewer"}}' | ~/.claude/statusline-command.sh shows security-reviewer segment
  • Worktree test: echo '{"model":{"display_name":"Opus 4.6"},"worktree":{"name":"fix-123","branch":"bugfix/issue-123"},"context_window":{"remaining_percentage":55},"cost":{"total_cost_usd":0.42},"exceeds_200k_tokens":false}' | ~/.claude/statusline-command.sh shows [WT:fix-123] bugfix/issue-123 replacing directory/branch
  • Rate limits test: output contains 5h: 58% left · 7d: 82% left with green color
  • Rate limits absent: echo '{"model":{"display_name":"Opus 4.6"},"workspace":{"current_dir":"/tmp/test"},"context_window":{"remaining_percentage":55},"cost":{"total_cost_usd":0.42},"exceeds_200k_tokens":false}' | ~/.claude/statusline-command.sh produces valid output without rate limits segment (no errors)
  • v1 backward compat: echo '{"model":{"display_name":"Opus 4.6"},"workspace":{"current_dir":"/tmp/test"},"context_window":{"remaining_percentage":55},"cost":{"total_cost_usd":0.42},"exceeds_200k_tokens":false}' | ~/.claude/statusline-command.sh produces valid output without errors
  • Theme matches user selection (check color codes in script)
  • NO_COLOR=1 produces uncolored output

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.77%
按下载量换算160

Claude

28.49%
按下载量换算121

Cursor

19.33%
按下载量换算82

Gemini CLI

8.7%
按下载量换算37

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/sd0xdev/sd0x-dev-flow --skill statusline-config 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills