# DawLine **Repository Path**: ZwGood/daw-line ## Basic Information - **Project Name**: DawLine - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-19 - **Last Updated**: 2026-01-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # DawLine 高性能 Claude Code 状态栏工具,集成 DawAPI 余额显示。 ## 功能特性 - **高性能**: Rust 编写,启动速度极快 - **DawAPI 集成**: 实时显示 API 余额 - **丰富显示**: 模型、目录、Git 分支、上下文窗口等信息 - **主题系统**: 多种内置主题,支持自定义 - **跨平台**: 支持 macOS、Linux、Windows ## 安装 需要先安装 [Rust](https://rustup.rs/): ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` 然后编译安装: ```bash # 克隆仓库 git clone https://gitee.com/ZwGood/daw-line.git cd daw-line # 编译 cargo build --release # 安装到 Claude Code 目录 mkdir -p ~/.claude/dawline cp target/release/dawline ~/.claude/dawline/ # 初始化配置 ~/.claude/dawline/dawline --init cp ~/.claude/dawline/themes/cometix.toml ~/.claude/dawline/config.toml ``` ## 配置 Claude Code 在 `~/.claude/settings.json` 中添加 `statusLine` 配置: ```json { "statusLine": { "type": "command", "command": "~/.claude/dawline/dawline" } } ``` 如果已有其他配置,只需添加 `statusLine` 部分即可。 ## DawAPI 配置 ### 设置 API Key ```bash ~/.claude/dawline/dawline --set-dawapi-key "你的API密钥" ``` 设置后,状态栏将显示: - `剩余$XX.XX` - 账户剩余余额(绿色) - `DawAPI竭诚为您服务` - 标语(金色,显示在最后) ### API Key 存储位置 ``` ~/.claude/dawline/dawapi_key.txt ``` ## 状态栏显示效果 ``` 󰦗 剩余$125.27 | Opus 4.5 | 󰉋 DawLine | master ✓ | 71.5% · 143k tokens | DawAPI竭诚为您服务 ``` ### 各段说明 | 图标 | 内容 | 说明 | |------|------|------| | 󰦗 | 剩余$XX.XX | DawAPI 账户余额 | | | Opus 4.5 | 当前使用的模型 | | 󰉋 | DawLine | 当前工作目录 | | | master ✓ | Git 分支和状态 | | | 71.5% · 143k | 上下文窗口使用率 | | | DawAPI竭诚为您服务 | 标语 | ## 命令行选项 ```bash dawline [OPTIONS] 选项: -c, --config 进入 TUI 配置界面 -t, --theme 设置主题 --print 打印当前配置 --init 初始化配置文件 --check 检查配置有效性 --set-dawapi-key 设置 DawAPI 密钥 -h, --help 显示帮助 -V, --version 显示版本 ``` ## TUI 配置器 运行交互式配置界面: ```bash ~/.claude/dawline/dawline -c ``` ### 快捷键 | 按键 | 功能 | |------|------| | Tab | 切换面板 | | Enter | 切换/编辑 | | Shift+↑↓ | 调整段落顺序 | | 1-4 | 快速切换主题 | | P | 循环切换主题 | | R | 重置为主题默认值 | | E | 编辑分隔符 | | S | 保存配置 | | W | 写入当前主题 | | Ctrl+S | 另存为新主题 | | Esc | 退出 | ## 内置主题 - `cometix` - 默认主题,包含 DawAPI 显示 - `default` - 基础主题 - `minimal` - 极简主题 - `gruvbox` - Gruvbox 配色 - `nord` - Nord 配色 - `powerline-dark` - 深色 Powerline - `powerline-light` - 浅色 Powerline - `powerline-rose-pine` - Rose Pine Powerline - `powerline-tokyo-night` - Tokyo Night Powerline 切换主题: ```bash # 方式一:命令行 ~/.claude/dawline/dawline --theme cometix --init # 方式二:TUI 配置器 ~/.claude/dawline/dawline -c ``` ## 配置文件 配置文件位置:`~/.claude/dawline/config.toml` 主题文件位置:`~/.claude/dawline/themes/` ### 示例配置 ```toml theme = "cometix" [style] mode = "nerd_font" separator = " | " [[segments]] id = "daw_api" enabled = true [[segments]] id = "model" enabled = true [[segments]] id = "directory" enabled = true [[segments]] id = "git" enabled = true [[segments]] id = "context_window" enabled = true [[segments]] id = "daw_api_slogan" enabled = true ``` ## 段落类型 | ID | 名称 | 说明 | |----|------|------| | `daw_api` | DawAPI | 显示账户余额 | | `model` | 模型 | 当前 Claude 模型 | | `directory` | 目录 | 当前工作目录 | | `git` | Git | 分支和状态 | | `context_window` | 上下文 | 使用率和 token 数 | | `usage` | 用量 | API 用量统计 | | `cost` | 费用 | 会话费用 | | `session` | 会话 | 会话时长和代码修改 | | `output_style` | 输出风格 | 当前输出风格 | | `daw_api_slogan` | 标语 | DawAPI 标语 | ## 字体要求 推荐安装 Nerd Font 以获得最佳显示效果: - [Nerd Fonts](https://www.nerdfonts.com/) - 推荐字体:JetBrainsMono Nerd Font、FiraCode Nerd Font ## 故障排除 ### 图标显示为方块 确保终端使用了 Nerd Font 字体。 ### DawAPI 余额不显示 1. 检查 API Key 是否设置: ```bash cat ~/.claude/dawline/dawapi_key.txt ``` 2. 检查配置是否启用了 `daw_api` 段落: ```bash ~/.claude/dawline/dawline --print | grep daw_api ``` 3. 使用 cometix 主题(包含 DawAPI): ```bash cp ~/.claude/dawline/themes/cometix.toml ~/.claude/dawline/config.toml ``` ### 缓存问题 DawAPI 数据默认缓存 5 分钟。缓存文件位置: ``` ~/.claude/dawline/.dawapi_cache.json ``` 删除此文件可强制刷新数据。 ## License MIT