Skip to content

Commit c491c04

Browse files
committed
initial check-in
0 parents  commit c491c04

30 files changed

+4762
-0
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ColumnLimit: 0

.github/workflows/ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: mini-ccstatus-ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
- feat/**
9+
- chore/**
10+
- fix/**
11+
pull_request:
12+
branches:
13+
- main
14+
- develop
15+
- feat/**
16+
- chore/**
17+
- fix/**
18+
workflow_dispatch:
19+
20+
jobs:
21+
test:
22+
name: test on debian:lts
23+
runs-on: ubuntu-latest
24+
container: debian:stable
25+
26+
steps:
27+
- name: checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: install dependencies
31+
shell: sh
32+
run: |
33+
if command -v apt-get >/dev/null 2>&1; then
34+
apt-get update
35+
apt-get install -y build-essential git make
36+
fi
37+
echo "All dependencies installed successfully"
38+
39+
- name: build project
40+
shell: sh
41+
run: |
42+
echo "Building project..."
43+
make default
44+
echo "✅ Build completed successfully"
45+
46+
- name: run tests
47+
shell: sh
48+
run: |
49+
echo "Running tests..."
50+
make test
51+
echo "✅ Tests completed successfully"
52+
53+
- name: clean build
54+
shell: sh
55+
run: |
56+
echo "Testing clean target..."
57+
make clean
58+
echo "✅ Clean completed successfully"
59+
60+
- name: full build cycle
61+
shell: sh
62+
run: |
63+
echo "Running full build cycle (clean, build, test)..."
64+
make all
65+
echo "✅ Full build cycle completed successfully"
66+
67+
- name: test summary
68+
shell: sh
69+
run: |
70+
echo "🎉 All checks passed"
71+
echo "- Build successful"
72+
echo "- All tests passing"
73+
echo "- Clean target working"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
obj/
2+
bin/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Michele Tavella <meeghele@proton.me>
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.

Makefile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright (c) 2025 Michele Tavella <meeghele@proton.me>
2+
# Licensed under the MIT License. See LICENSE file for details.
3+
4+
# Colors are enabled by default; set NO_COLOR in the environment to disable.
5+
CC ?= cc
6+
CPPFLAGS ?=
7+
CFLAGS ?= -O3 -pipe -march=native -flto -DNDEBUG
8+
WARNFLAGS ?= -Wall -Wextra -Wpedantic -Wno-sign-conversion
9+
LDFLAGS ?=
10+
11+
TARGET := mini-ccstatus
12+
OBJ_DIR := obj
13+
BIN_DIR := bin
14+
OBJECTS := $(OBJ_DIR)/mini-ccstatus.o $(OBJ_DIR)/cJSON.o
15+
DEMO_SCRIPT := tests/stdout.sh
16+
TEST_SCRIPT := tests/coverage.sh
17+
TEST_MEMORY := tests/memory.sh
18+
FIXTURES := fixtures/*.json
19+
20+
default: $(BIN_DIR)/$(TARGET) demo
21+
22+
.PHONY: all
23+
all: clean default test
24+
25+
$(BIN_DIR)/$(TARGET): $(OBJECTS) | $(BIN_DIR)
26+
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
27+
28+
$(OBJ_DIR)/mini-ccstatus.o: mini-ccstatus.c lib/cjson/cJSON.h | $(OBJ_DIR)
29+
$(CC) $(CPPFLAGS) $(CFLAGS) $(WARNFLAGS) -I. -Ilib -c $< -o $@
30+
31+
$(OBJ_DIR)/cJSON.o: lib/cjson/cJSON.c lib/cjson/cJSON.h | $(OBJ_DIR)
32+
$(CC) $(CPPFLAGS) $(CFLAGS) $(WARNFLAGS) -I. -Ilib -c $< -o $@
33+
34+
$(OBJ_DIR) $(BIN_DIR):
35+
mkdir -p $@
36+
37+
.PHONY: test
38+
test: $(BIN_DIR)/$(TARGET) $(TEST_SCRIPT) $(TEST_MEMORY) $(FIXTURES)
39+
$(TEST_SCRIPT)
40+
$(TEST_MEMORY)
41+
42+
.PHONY: demo
43+
demo: $(BIN_DIR)/$(TARGET) $(DEMO_SCRIPT)
44+
$(DEMO_SCRIPT)
45+
VERBOSE=true $(DEMO_SCRIPT)
46+
47+
.PHONY: clean
48+
clean:
49+
rm -rfv $(BIN_DIR) $(OBJ_DIR)

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[![CI](https://github.com/meeghele/mini-ccstatus/actions/workflows/ci.yml/badge.svg)](https://github.com/meeghele/mini-ccstatus/actions)
2+
[![C](https://img.shields.io/badge/C-00599C?logo=c&logoColor=white)](https://en.wikipedia.org/wiki/C_(programming_language))
3+
[![Single Binary](https://img.shields.io/badge/Single%20Binary-0C7BDC)](#)
4+
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
5+
6+
# mini-ccstatus
7+
8+
A fast/minimal C implementation of the statusline for Claude Code CLI.
9+
10+
## Build & Test
11+
12+
GNU Make will build a binary into `./bin/mini-ccstatus`.`
13+
14+
```bash
15+
make
16+
17+
# Prints the statusline
18+
make demo
19+
20+
# Run the shell-based regression tests
21+
make test
22+
23+
# Clean bin/ and obj/
24+
make clean
25+
```
26+
27+
## Usage
28+
29+
### Compact Mode
30+
```json
31+
{
32+
"statusLine": {
33+
"type": "command",
34+
"command": "~/mini-ccstatus/bin/mini-ccstatus",
35+
"padding": 0
36+
}
37+
}
38+
```
39+
40+
### Verbose Mode
41+
```json
42+
{
43+
"statusLine": {
44+
"type": "command",
45+
"command": "VERBOSE=yeah ~/mini-ccstatus/bin/mini-ccstatus",
46+
"padding": 0
47+
}
48+
}
49+
```
50+
51+
## Screenshots
52+
53+
### Compact Mode
54+
![Compact Mode](docs/mini-ccstatus_compact.png)
55+
56+
### Verbose Mode
57+
![Verbose Mode](docs/mini-ccstatus_verbose.png)
58+
59+
## Dependencies
60+
61+
This project includes [cJSON](https://github.com/DaveGamble/cJSON) (MIT License) vendored in `lib/cjson/`.
62+
63+
## License
64+
65+
Licensed under the MIT License. See `LICENSE` for details.
66+
67+
## Author
68+
69+
**Michele Tavella**[meeghele@proton.me](mailto:meeghele@proton.me)

docs/actual_stdin.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"session_id":"98ac6093-b97b-440b-b699-a5b79fb7693b","transcript_path":"/home/user/.claude/projects/-home-user/00000000-1111-2222-3333-444444444444.jsonl","cwd":"/home/user","model":{"id":"claude-sonnet-4-5-20250929","display_name":"Sonnet 4.5"},"workspace":{"current_dir":"/home/user","project_dir":"/home/user"},"version":"2.0.1","output_style":{"name":"default"},"cost":{"total_cost_usd":0,"total_duration_ms":1633,"total_api_duration_ms":0,"total_lines_added":0,"total_lines_removed":0},"exceeds_200k_tokens":false}

docs/mini-ccstatus_compact.png

42.8 KB
Loading

docs/mini-ccstatus_verbose.png

43.9 KB
Loading

fixtures/edge_case_01.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"hook_event_name": "Status", "model": {"id": "test-1", "display_name": "Test1"}, "cwd": "/", "workspace": {"project_dir": "/"}, "version": "1.0", "cost": {}, "exceeds_200k_tokens": false}

0 commit comments

Comments
 (0)