@vimukthid/ccsl 1.0.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 vimukthid
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.
package/README.md ADDED
@@ -0,0 +1,251 @@
1
+ # @vimukthid/ccsl
2
+
3
+ **Claude Code Status Line** - A customizable status line formatter for Claude Code CLI.
4
+
5
+ Transform Claude Code status data into beautifully formatted, themed terminal displays.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install -g @vimukthid/ccsl
11
+ ```
12
+
13
+ **Requirements:** Node.js 22.x or higher
14
+
15
+ ## Quick Start
16
+
17
+ ### 1. Install to Claude Code
18
+
19
+ ```bash
20
+ # Run the installer
21
+ ccsl install
22
+
23
+ # Or launch the TUI and select "Install to Claude Code"
24
+ ccsl
25
+ ```
26
+
27
+ This automatically configures `~/.claude/settings.json` with:
28
+
29
+ ```json
30
+ {
31
+ "statusLine": {
32
+ "type": "command",
33
+ "command": "npx @vimukthid/ccsl"
34
+ }
35
+ }
36
+ ```
37
+
38
+ ### 2. Restart Claude Code
39
+
40
+ After installation, restart Claude Code to see your new status line!
41
+
42
+ ## How It Works
43
+
44
+ Claude Code passes JSON data via stdin to ccsl, which formats it into a beautiful status line:
45
+
46
+ ```
47
+ Opus │ 42% │ ↑15.2k ↓4.5k │ $0.02
48
+ ```
49
+
50
+ ## Features
51
+
52
+ ### Available Widgets
53
+
54
+ | Widget | Description | Example |
55
+ |-------------|------------------------|----------------|
56
+ | `model` | Claude model name | `Opus` |
57
+ | `context` | Context window usage % | `42%` |
58
+ | `tokens` | Input/Output tokens | `↑15.2k ↓4.5k` |
59
+ | `cost` | Session cost USD | `$0.02` |
60
+ | `duration` | Session duration | `45s` |
61
+ | `lines` | Lines added/removed | `+156 -23` |
62
+ | `directory` | Current directory | `my-project` |
63
+ | `version` | Claude Code version | `v1.0.80` |
64
+
65
+ ### Built-in Themes
66
+
67
+ **Colorful:**
68
+ - `neon` - Vibrant cyberpunk with electric colors
69
+ - `rainbow` - Colorful gradient transitions
70
+ - `ocean` - Cool blues and teals
71
+
72
+ **Professional:**
73
+ - `minimal` - Clean and subtle (default)
74
+ - `monochrome` - Pure grayscale
75
+ - `corporate` - Professional muted blues
76
+
77
+ ### Icon Modes
78
+
79
+ - `auto` - Detect terminal capabilities (default)
80
+ - `nerd` - Nerd Font icons
81
+ - `unicode` - Standard Unicode symbols
82
+ - `ascii` - Plain ASCII text
83
+
84
+ ## CLI Commands
85
+
86
+ ```bash
87
+ # Interactive TUI configuration
88
+ ccsl
89
+
90
+ # Install/Uninstall from Claude Code
91
+ ccsl install # Add to Claude Code settings
92
+ ccsl uninstall # Remove from Claude Code settings
93
+
94
+ # Theme management
95
+ ccsl theme <name> # Quick switch theme
96
+ ccsl theme --list # List available themes
97
+
98
+ # Other commands
99
+ ccsl preview # Preview with sample data
100
+ ccsl init # Create local config file
101
+ ccsl init --global # Create global config file
102
+ ccsl config # Open TUI configuration
103
+ ccsl --version # Show version
104
+ ccsl --help # Show help
105
+ ```
106
+
107
+ ## Configuration
108
+
109
+ ### Config File Locations
110
+
111
+ | Scope | Location | Priority |
112
+ |--------|------------------------------|----------|
113
+ | Local | `.ccslrc.json` | Highest |
114
+ | Global | `~/.config/ccsl/config.json` | Default |
115
+
116
+ ### Config Schema
117
+
118
+ ```json
119
+ {
120
+ "theme": "minimal",
121
+ "widgets": ["model", "context", "tokens", "cost"],
122
+ "separator": " │ ",
123
+ "icons": "auto",
124
+ "padding": 1
125
+ }
126
+ ```
127
+
128
+ ### Custom Theme
129
+
130
+ ```json
131
+ {
132
+ "theme": "minimal",
133
+ "customTheme": {
134
+ "name": "my-theme",
135
+ "colors": {
136
+ "model": { "fg": "#61afef", "bold": true },
137
+ "context": { "fg": "#98c379" },
138
+ "contextHigh": { "fg": "#e5c07b" },
139
+ "contextCritical": { "fg": "#e06c75" },
140
+ "tokens": { "fg": "#c678dd" },
141
+ "cost": { "fg": "#e06c75" },
142
+ "duration": { "fg": "#56b6c2" },
143
+ "lines": { "fg": "#d19a66" },
144
+ "linesAdded": { "fg": "#98c379" },
145
+ "linesRemoved": { "fg": "#e06c75" },
146
+ "directory": { "fg": "#61afef" },
147
+ "version": { "fg": "#abb2bf" },
148
+ "separator": { "fg": "#5c6370" }
149
+ }
150
+ }
151
+ }
152
+ ```
153
+
154
+ ## Input Format
155
+
156
+ ccsl receives JSON from Claude Code via stdin:
157
+
158
+ ```json
159
+ {
160
+ "model": { "display_name": "Opus" },
161
+ "context_window": {
162
+ "used_percentage": 42.5,
163
+ "total_input_tokens": 15234,
164
+ "total_output_tokens": 4521
165
+ },
166
+ "cost": {
167
+ "total_cost_usd": 0.0234,
168
+ "total_duration_ms": 45000,
169
+ "total_lines_added": 156,
170
+ "total_lines_removed": 23
171
+ },
172
+ "workspace": { "current_dir": "/path/to/project" },
173
+ "version": "1.0.80"
174
+ }
175
+ ```
176
+
177
+ ## Development
178
+
179
+ ### Build from Source
180
+
181
+ ```bash
182
+ # Clone the repository
183
+ git clone https://github.com/vimukthid/ccsl.git
184
+ cd ccsl
185
+
186
+ # Install dependencies
187
+ npm install
188
+
189
+ # Build
190
+ npm run build
191
+
192
+ # Run tests
193
+ npm test
194
+ ```
195
+
196
+ ### Local Installation (without npm publish)
197
+
198
+ You can install ccsl locally without publishing to npm:
199
+
200
+ ```bash
201
+ # Option 1: Install globally from local directory
202
+ cd /path/to/ccsl
203
+ npm run build
204
+ npm link
205
+
206
+ # Now you can use 'ccsl' command globally
207
+ ccsl --help
208
+ ccsl install
209
+ ```
210
+
211
+ ```bash
212
+ # Option 2: Install directly from the built package
213
+ cd /path/to/ccsl
214
+ npm run build
215
+ npm pack # Creates @vimukthid-ccsl-1.0.0.tgz
216
+
217
+ # Install the tarball globally
218
+ npm install -g ./vimukthid-ccsl-1.0.0.tgz
219
+ ```
220
+
221
+ ```bash
222
+ # Option 3: Reference the local build in Claude Code settings
223
+ # Edit ~/.claude/settings.json manually:
224
+ {
225
+ "statusLine": {
226
+ "type": "command",
227
+ "command": "node /path/to/ccsl/dist/cli.js"
228
+ }
229
+ }
230
+ ```
231
+
232
+ ### Test the Status Line
233
+
234
+ ```bash
235
+ # Preview with sample data
236
+ npm run build && node dist/cli.js preview
237
+
238
+ # Test piped input (simulates what Claude Code sends)
239
+ echo '{"model":{"display_name":"Opus"},"context_window":{"used_percentage":45}}' | node dist/cli.js
240
+ ```
241
+
242
+ ### Unlink Local Installation
243
+
244
+ ```bash
245
+ # Remove the global link
246
+ npm unlink -g @vimukthid/ccsl
247
+ ```
248
+
249
+ ## License
250
+
251
+ MIT