{"id":49069401,"url":"https://github.com/mysticaldevil/kime","last_synced_at":"2026-04-25T19:01:43.427Z","repository":{"id":351151656,"uuid":"1209539862","full_name":"MysticalDevil/kime","owner":"MysticalDevil","description":"A beautiful CLI tool to display your Kimi Code Console stats in the terminal.","archived":false,"fork":false,"pushed_at":"2026-04-18T17:58:21.000Z","size":205,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-20T06:40:24.654Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MysticalDevil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-13T14:28:05.000Z","updated_at":"2026-04-18T17:58:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/MysticalDevil/kime","commit_stats":null,"previous_names":["mysticaldevil/kime"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/MysticalDevil/kime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MysticalDevil%2Fkime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MysticalDevil%2Fkime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MysticalDevil%2Fkime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MysticalDevil%2Fkime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MysticalDevil","download_url":"https://codeload.github.com/MysticalDevil/kime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MysticalDevil%2Fkime/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32273223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-20T06:34:15.189Z","updated_at":"2026-04-25T19:01:43.421Z","avatar_url":"https://github.com/MysticalDevil.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ekime\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://go.dev\"\u003e\u003cimg src=\"https://img.shields.io/badge/Go-1.26.2%2B-00ADD8?logo=go\" alt=\"Go\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.kimi.com/code\"\u003e\u003cimg src=\"https://img.shields.io/badge/Kimi-Code%20Console-5B5B5B\" alt=\"Kimi\"\u003e\u003c/a\u003e\n  \u003ca href=\"./LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-BSD--3--Clause-blue\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003e [!IMPORTANT]\n\u003e This project uses `encoding/json/v2`. You **must** build with `GOEXPERIMENT=jsonv2`.\n\nA beautiful CLI tool to display your **Kimi Code Console** stats in the terminal.\n\n---\n\n## Features\n\n- **Weekly Usage** – real-time API call\n- **Rate Limit Details** – real-time API call\n- **Usage Ratio** – real-time API call\n- **Current Plan \u0026 Validity** – cached until the subscription expires\n- **Model Permissions** – cached until the subscription expires\n- Beautiful Unicode-box UI powered by [Lipgloss](https://github.com/charmbracelet/lipgloss)\n- Automatic ASCII fallback for non-modern terminals, with environment overrides\n- Multilingual output: **Chinese (default)**, Traditional Chinese, English, and Japanese\n- Mock mode for safe testing without hitting real APIs\n\n---\n\n## Installation\n\n### Via `go install`\n\n```bash\nGOEXPERIMENT=jsonv2 go install github.com/MysticalDevil/kime@latest\n```\n\n### Via `mise`\n\n```bash\n# using the Go backend\nmise use -g go:github.com/MysticalDevil/kime@latest\n\n# or using the GitHub backend (prebuilt binary)\nmise use -g github:MysticalDevil/kime@latest\n```\n\n### Build from source\n\nUnix-like:\n\n```bash\ngit clone https://github.com/MysticalDevil/kime.git\ncd kime\ngo mod tidy\nGOEXPERIMENT=jsonv2 go build -o kime\n```\n\nThen move the binary to a directory in your `$PATH`:\n\n```bash\nmv kime ~/.local/bin/\n```\n\nWindows PowerShell:\n\n```powershell\ngit clone https://github.com/MysticalDevil/kime.git\ncd kime\ngo mod tidy\n$env:GOEXPERIMENT = \"jsonv2\"\ngo build -o kime.exe .\nNew-Item -ItemType Directory -Force \"$HOME\\bin\" | Out-Null\nMove-Item .\\kime.exe \"$HOME\\bin\\kime.exe\"\n$env:Path = \"$HOME\\bin;$env:Path\"\n```\n\nWindows binary name: `kime.exe`\n\n### Developer commands\n\nThis repository uses `just` as the task runner:\n\n```bash\njust fmt         # format with gofumpt\njust fmt-check   # verify formatting only\njust lint        # run golangci-lint with --fix\njust lint-check  # CI-style lint check\njust test        # run the full test suite\njust coverage    # enforce the coverage gate\njust check       # fmt + lint-check + test + coverage\n```\n\nCurrent CI coverage gate: **73%** total coverage.\n\n---\n\n## Configuration\n\n`kime` reads credentials from the platform config directory:\n\n- Linux: `~/.config/kime/config.json`\n- macOS: `~/Library/Application Support/kime/config.json`\n- Windows: `%AppData%\\kime\\config.json`\n\nThe cache file is also platform-specific:\n\n- Linux: `~/.cache/kime/membership.json`\n- macOS: `~/Library/Caches/kime/membership.json`\n- Windows: `%LocalAppData%\\kime\\membership.json`\n\nBoth files are created automatically when needed, or you can create them manually.\n\n### Interactive setup\n\nThe easiest way to configure `kime` is via the built-in interactive wizard:\n\n```bash\nkime init\n```\n\nWindows PowerShell:\n\n```powershell\n.\\kime.exe init\n```\n\nThis will prompt you for your token and auto-extract `device_id`, `session_id`,\nand `user_id` from the JWT payload. You can also set your preferred language and\nother options. `kime init` requires an interactive terminal; non-TTY stdin returns a clear error.\n\n### How to obtain credentials (DevTools)\n\n1. Open [https://www.kimi.com/code/console?from=kfc_overview_topbar](https://www.kimi.com/code/console?from=kfc_overview_topbar) and log in.\n2. Open **Developer Tools** (`F12` or `Ctrl+Shift+I`).\n3. Go to the **Console** tab and run:\n\n   ```javascript\n   copy(localStorage.getItem('access_token'))\n   ```\n\n   This copies your JWT token to the clipboard. Paste it as the `token` field.\n4. (Optional) If you want to fill the other fields manually, paste the token into\n   [jwt.io](https://jwt.io) to decode the payload, or run in Console:\n\n   ```javascript\n   const parts = localStorage.getItem('access_token').split('.');\n   const payload = JSON.parse(atob(parts[1].replace(/-/g, '+').replace(/_/g, '/')));\n   console.log('device_id:', payload.device_id);\n   console.log('session_id (ssid):', payload.ssid);\n   console.log('user_id (sub):', payload.sub);\n   ```\n\n   `kime` can auto-extract `device_id`, `session_id`, and `user_id` from the JWT, so providing only `token` is usually enough.\n\n### Config file example\n\n```json\n{\n  \"token\": \"eyJhbGciOiJIUzUxMiIs...\",\n  \"device_id\": \"1234567890123456789\",\n  \"session_id\": \"9876543210987654321\",\n  \"user_id\": \"your_user_id_here\",\n  \"language\": \"zh\",\n  \"show_progress\": false\n}\n```\n\n| Field | Description |\n|-------|-------------|\n| `token` | JWT access token (`kimi-auth` cookie or `access_token` in LocalStorage) |\n| `device_id` | `x-msh-device-id` header value (auto-extracted from JWT if omitted) |\n| `session_id` | `x-msh-session-id` header value (auto-extracted from JWT if omitted) |\n| `user_id` | `x-traffic-id` header value, i.e. your user ID (auto-extracted from JWT if omitted) |\n| `language` | UI language: `\"zh\"` (default), `\"zh_TW\"`, `\"en\"`, or `\"ja\"` |\n| `show_progress` | Set to `true` to show usage cards as progress bars instead of plain numbers |\n\n### Environment variables (override config)\n\n| Variable | Description |\n|----------|-------------|\n| `KIME_TOKEN` | JWT token |\n| `KIME_DEVICE_ID` | Device ID |\n| `KIME_SESSION_ID` | Session ID |\n| `KIME_USER_ID` | User ID |\n| `KIME_LANG` | UI language: `zh`, `zh_TW`, `en`, or `ja` |\n| `KIME_RENDER_MODE` | Render mode: `auto` (default), `unicode`, or `ascii` |\n| `KIME_MOCK` | Set to `1` to enable mock mode (no real API calls) |\n| `KIME_FORCE_REFRESH` | Set to `1` to force a full refresh and update cache |\n| `KIME_CONFIG_DIR` | Override config directory path |\n| `KIME_CACHE_DIR` | Override cache directory path |\n\nIf `device_id` or `user_id` is missing, `kime` will try to extract them from the JWT payload automatically.\n\nASCII rendering uses English labels and ASCII-only decorations so it remains readable in non-UTF-8 terminals.\n\nWhen both config and environment variables are present, environment variables take precedence.\n\n---\n\n## Usage\n\n```bash\n# Show help\nkime\nkime --help\n\n# Check stats (Chinese UI, default)\nkime check\n\n# English UI\nKIME_LANG=en kime check   # or set \"language\": \"en\" in config\n\n# Mock mode (no network requests)\nKIME_MOCK=1 kime check\n\n# Force ASCII rendering\nKIME_RENDER_MODE=ascii kime check\n\n# Force refresh (bypass cache and update it)\nKIME_FORCE_REFRESH=1 kime check\n```\n\nWindows PowerShell:\n\n```powershell\n.\\kime.exe --help\n.\\kime.exe check\n$env:KIME_LANG = \"en\"; .\\kime.exe check\n$env:KIME_MOCK = \"1\"; .\\kime.exe check\n$env:KIME_FORCE_REFRESH = \"1\"; .\\kime.exe check\n```\n\n---\n\n## Cache\n\n- **Cache file**:\n  Linux `~/.cache/kime/membership.json`\n  macOS `~/Library/Caches/kime/membership.json`\n  Windows `%LocalAppData%\\kime\\membership.json`\n- **TTL**: until `subscription.currentEndTime`\n- \"Current Plan\", \"Validity\", and \"Model Permissions\" are served from cache when the subscription is still active.\n- \"Weekly Usage\", \"Rate Limit\", and \"Usage Ratio\" are always fetched live.\n- Set `KIME_FORCE_REFRESH=1` to bypass cache and force a full update.\n\n---\n\n## Platform Support\n\n- Supported OS targets: Linux, macOS, Windows\n- Windows target: Windows Terminal is the primary supported terminal\n- Recommended Windows shell: PowerShell 7\n- `cmd.exe` and legacy Windows consoles are not supported targets\n\n---\n\n## License\n\nBSD 3-Clause License. See [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmysticaldevil%2Fkime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmysticaldevil%2Fkime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmysticaldevil%2Fkime/lists"}