cc-statusline 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cc_statusline-0.0.1/.flake8 +3 -0
- cc_statusline-0.0.1/.github/workflows/pr.yml +35 -0
- cc_statusline-0.0.1/.github/workflows/publish.yml +26 -0
- cc_statusline-0.0.1/.gitignore +207 -0
- cc_statusline-0.0.1/.vscode/launch.json +31 -0
- cc_statusline-0.0.1/.vscode/settings.json +14 -0
- cc_statusline-0.0.1/LICENSE +21 -0
- cc_statusline-0.0.1/PKG-INFO +228 -0
- cc_statusline-0.0.1/README.md +201 -0
- cc_statusline-0.0.1/pyproject.toml +63 -0
- cc_statusline-0.0.1/setup.cfg +4 -0
- cc_statusline-0.0.1/src/cc_statusline.egg-info/PKG-INFO +228 -0
- cc_statusline-0.0.1/src/cc_statusline.egg-info/SOURCES.txt +17 -0
- cc_statusline-0.0.1/src/cc_statusline.egg-info/dependency_links.txt +1 -0
- cc_statusline-0.0.1/src/cc_statusline.egg-info/entry_points.txt +2 -0
- cc_statusline-0.0.1/src/cc_statusline.egg-info/requires.txt +13 -0
- cc_statusline-0.0.1/src/cc_statusline.egg-info/top_level.txt +1 -0
- cc_statusline-0.0.1/src/cc_statusline.py +787 -0
- cc_statusline-0.0.1/tests/test_utils.py +224 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: PR
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
types:
|
|
5
|
+
- opened
|
|
6
|
+
- synchronize
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
name: Test
|
|
11
|
+
runs-on: ubuntu-24.04
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v6
|
|
16
|
+
|
|
17
|
+
- name: Python venv
|
|
18
|
+
run: |
|
|
19
|
+
python3 -m venv .venv
|
|
20
|
+
source .venv/bin/activate \
|
|
21
|
+
&& pip install --upgrade pip \
|
|
22
|
+
&& pip install -e ".[test]"
|
|
23
|
+
|
|
24
|
+
- name: Tests
|
|
25
|
+
run: |
|
|
26
|
+
source .venv/bin/activate \
|
|
27
|
+
&& pytest --cov=cc_statusline --cov-report=html
|
|
28
|
+
|
|
29
|
+
- name: Store coverage
|
|
30
|
+
uses: actions/upload-artifact@v7
|
|
31
|
+
with:
|
|
32
|
+
name: cov-reports
|
|
33
|
+
path: |
|
|
34
|
+
htmlcov
|
|
35
|
+
retention-days: 7
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
on:
|
|
3
|
+
release:
|
|
4
|
+
types:
|
|
5
|
+
- published
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
|
|
9
|
+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
package:
|
|
13
|
+
name: Publish
|
|
14
|
+
runs-on: ubuntu-24.04
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout
|
|
17
|
+
uses: actions/checkout@v6
|
|
18
|
+
|
|
19
|
+
- name: Build and publish
|
|
20
|
+
run: |
|
|
21
|
+
python3 -m venv .venv
|
|
22
|
+
source .venv/bin/activate \
|
|
23
|
+
&& pip install --upgrade pip \
|
|
24
|
+
&& pip install -e ".[package,publish]" \
|
|
25
|
+
&& python -m build \
|
|
26
|
+
&& twine upload dist/*
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"name": "Debug Tests",
|
|
6
|
+
"type": "debugpy",
|
|
7
|
+
"request": "launch",
|
|
8
|
+
"module": "pytest",
|
|
9
|
+
"args": [
|
|
10
|
+
"tests",
|
|
11
|
+
"-v"
|
|
12
|
+
],
|
|
13
|
+
"cwd": "${workspaceFolder}",
|
|
14
|
+
"python": "${workspaceFolder}/.venv/bin/python",
|
|
15
|
+
"justMyCode": false
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "Debug Current Test File",
|
|
19
|
+
"type": "debugpy",
|
|
20
|
+
"request": "launch",
|
|
21
|
+
"module": "pytest",
|
|
22
|
+
"args": [
|
|
23
|
+
"${file}",
|
|
24
|
+
"-v"
|
|
25
|
+
],
|
|
26
|
+
"cwd": "${workspaceFolder}",
|
|
27
|
+
"python": "${workspaceFolder}/.venv/bin/python",
|
|
28
|
+
"justMyCode": false
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor.formatOnSave": true,
|
|
3
|
+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
|
|
4
|
+
"python.testing.pytestEnabled": true,
|
|
5
|
+
"python.testing.pytestArgs": ["tests"],
|
|
6
|
+
"flake8.interpreter": [".venv/bin/python"],
|
|
7
|
+
"flake8.path": [".venv/bin/flake8"],
|
|
8
|
+
"flake8.args": ["--line-max-length", "88"],
|
|
9
|
+
"black-formatter.interpreter": [".venv/bin/python"],
|
|
10
|
+
"black-formatter.path": [".venv/bin/black"],
|
|
11
|
+
"black-formatter.args": ["--line-length", "88"],
|
|
12
|
+
"isort.path": [".venv/bin/isort"],
|
|
13
|
+
"isort.args": ["--profile", "black"]
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 J Al-Ansari
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cc-statusline
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Powerline-style statusline for ClaudeCode
|
|
5
|
+
Author: j
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/jalansari/cc-statusline
|
|
8
|
+
Project-URL: Issues, https://github.com/jalansari/cc-statusline/issues
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Requires-Python: >=3.12
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Provides-Extra: test
|
|
17
|
+
Requires-Dist: pytest==9.0.3; extra == "test"
|
|
18
|
+
Requires-Dist: pytest-cov==7.1.0; extra == "test"
|
|
19
|
+
Requires-Dist: black==26.3.1; extra == "test"
|
|
20
|
+
Requires-Dist: flake8==7.3.0; extra == "test"
|
|
21
|
+
Requires-Dist: isort==8.0.1; extra == "test"
|
|
22
|
+
Provides-Extra: package
|
|
23
|
+
Requires-Dist: build==1.4.3; extra == "package"
|
|
24
|
+
Provides-Extra: publish
|
|
25
|
+
Requires-Dist: twine==6.2.0; extra == "publish"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# Claude Code Status Line
|
|
29
|
+
|
|
30
|
+
- [Claude Code Status Line](#claude-code-status-line)
|
|
31
|
+
- [Introduction](#introduction)
|
|
32
|
+
- [Segments](#segments)
|
|
33
|
+
- [Segment breakdown](#segment-breakdown)
|
|
34
|
+
- [Detected languages](#detected-languages)
|
|
35
|
+
- [Installation](#installation)
|
|
36
|
+
- [Configuration](#configuration)
|
|
37
|
+
- [Caching](#caching)
|
|
38
|
+
- [Development](#development)
|
|
39
|
+
- [Testing](#testing)
|
|
40
|
+
- [Build and publish](#build-and-publish)
|
|
41
|
+
- [Configure Publishing to Pypi](#configure-publishing-to-pypi)
|
|
42
|
+
- [Publishing to Test Pypi](#publishing-to-test-pypi)
|
|
43
|
+
- [Publishing to Pypi](#publishing-to-pypi)
|
|
44
|
+
|
|
45
|
+
## Introduction
|
|
46
|
+
|
|
47
|
+
Powerline-style status line for
|
|
48
|
+
[Claude Code](https://code.claude.com/docs/en/statusline).
|
|
49
|
+
|
|
50
|
+
Requires a [Nerd Font](https://www.nerdfonts.com/font-downloads) installed and
|
|
51
|
+
setup as your terminals default font.
|
|
52
|
+
|
|
53
|
+
Recommendation is to install either:
|
|
54
|
+
|
|
55
|
+
- FiraCode Nerd Font
|
|
56
|
+
- JetBrainsMono Nerd Font
|
|
57
|
+
|
|
58
|
+
## Segments
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
project > branch_name > ai_model > ctx% | tokens | cost > quota / usages / enterprise > cli | mcp
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Example (Pro/Max plan):
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
my-app > feat/abc123 > Opus 4.6 > 12% | 58.3k | 1.42$ > 34% (2h05m) > 61% (4.2d) > cli | mcp
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Example (Enterprise plan):
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
my-app > feat/abc123 > Opus 4.6 > 12% | 58.3k | 1.42$ > $78.50 22d > cli | mcp
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Segment breakdown
|
|
77
|
+
|
|
78
|
+
| # | Segment | Description |
|
|
79
|
+
|---|---------|-------------|
|
|
80
|
+
| 1 | **Directory** | Current working directory name. |
|
|
81
|
+
| 2 | **Git branch** | Branch name with color coding: red for `main`/`master`, yellow for `staging`, blue otherwise. Shows worktree icon if in a worktree. And, language icon, based on best guess. |
|
|
82
|
+
| 3 | **Model** | Active Claude model name. |
|
|
83
|
+
| 4 | **Context** | Context window usage: percentage, input tokens, and session cost (USD). Turns red at 80%+ usage. |
|
|
84
|
+
| 5a | **Window quota** | *(Pro/Max only)* 5-hour rolling usage percentage and time until reset. |
|
|
85
|
+
| 5b | **Weekly quota** | *(Pro/Max only)* 7-day usage percentage and time until reset. |
|
|
86
|
+
| 5c | **Enterprise** | *(Enterprise only)* Monthly cumulative cost* (all sessions) and days remaining in billing period. |
|
|
87
|
+
| 6a | **CLI Services** | Auth status for CLI services (green = authenticated, red = not): GitHub CLI, Atlassian CLI. |
|
|
88
|
+
| 6b | **Services** | Auth status for MCP services (green = authenticated, red = not): Notion MCP, Atlassian MCP, Figma MCP. |
|
|
89
|
+
|
|
90
|
+
\* Cost is estimated, and requires the cost tracking hook to function.
|
|
91
|
+
|
|
92
|
+
### Detected languages
|
|
93
|
+
|
|
94
|
+
The branch segment appends an icon for the detected project language:
|
|
95
|
+
|
|
96
|
+
- Terraform
|
|
97
|
+
- Node.js
|
|
98
|
+
- TypeScript
|
|
99
|
+
- Python
|
|
100
|
+
- Rust
|
|
101
|
+
- Go
|
|
102
|
+
- Java
|
|
103
|
+
- Perl
|
|
104
|
+
- Shell
|
|
105
|
+
|
|
106
|
+
## Installation
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
pip install cc-statusline
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Configuration
|
|
113
|
+
|
|
114
|
+
Add to `~/.claude/settings.json`:
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"statusLine": {
|
|
119
|
+
"type": "command",
|
|
120
|
+
"command": "cc-statusline"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Caching
|
|
126
|
+
|
|
127
|
+
Data is cached at multiple tiers to keep the status line fast:
|
|
128
|
+
|
|
129
|
+
| TTL | Data |
|
|
130
|
+
|-----|------|
|
|
131
|
+
| 1s | Git branch, stdin JSON (session data). |
|
|
132
|
+
| 10s | CLI/MCP auth status checks. |
|
|
133
|
+
| 60s | Directory name, language detection, monthly cost. |
|
|
134
|
+
| 5m | API rate limit usage (Pro/Max). |
|
|
135
|
+
|
|
136
|
+
## Development
|
|
137
|
+
|
|
138
|
+
Set up a virtual environment:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
python3 -m venv .venv
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Activate the virtual environment before running any of the steps below:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
source .venv/bin/activate
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Testing
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
pip install -e ".[test]"
|
|
154
|
+
pytest
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Build and publish
|
|
158
|
+
|
|
159
|
+
Build the distribution:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
pip install -e ".[package]"
|
|
163
|
+
python -m build
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
This creates `dist/` with `.tar.gz` and `.whl` files.
|
|
167
|
+
|
|
168
|
+
#### Configure Publishing to Pypi
|
|
169
|
+
|
|
170
|
+
Configure PyPI credentials in `~/.pypirc`:
|
|
171
|
+
|
|
172
|
+
```ini
|
|
173
|
+
[distutils]
|
|
174
|
+
index-servers =
|
|
175
|
+
pypi
|
|
176
|
+
testpypi
|
|
177
|
+
|
|
178
|
+
[pypi]
|
|
179
|
+
username = __token__
|
|
180
|
+
password = pypi-<your-api-token>
|
|
181
|
+
|
|
182
|
+
[testpypi]
|
|
183
|
+
repository = https://test.pypi.org/legacy/
|
|
184
|
+
username = __token__
|
|
185
|
+
password = pypi-<your-test-api-token>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
API tokens can be created at:
|
|
189
|
+
|
|
190
|
+
- PyPI: https://pypi.org/manage/account/token/
|
|
191
|
+
- TestPyPI: https://test.pypi.org/manage/account/token/
|
|
192
|
+
|
|
193
|
+
Alternatively, set credentials via environment variables instead of `~/.pypirc`:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
export TWINE_USERNAME=__token__
|
|
197
|
+
export TWINE_PASSWORD=pypi-<your-api-token>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
To target TestPyPI, override the repository URL:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
export TWINE_REPOSITORY_URL=https://test.pypi.org/legacy/
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
#### Publishing to Test Pypi
|
|
207
|
+
|
|
208
|
+
To publish to TestPyPI first:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
pip install -e ".[build,publish]"
|
|
212
|
+
|
|
213
|
+
# Using ini file:
|
|
214
|
+
twine upload --repository testpypi dist/*
|
|
215
|
+
|
|
216
|
+
# Or, with environment variables:
|
|
217
|
+
export TWINE_REPOSITORY_URL=https://test.pypi.org/legacy/
|
|
218
|
+
twine upload dist/*
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
#### Publishing to Pypi
|
|
222
|
+
|
|
223
|
+
Publish to PyPI:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
pip install -e ".[publish]"
|
|
227
|
+
twine upload dist/*
|
|
228
|
+
```
|