jitters-cli 0.1.0__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.
- jitters_cli-0.1.0/LICENSE +9 -0
- jitters_cli-0.1.0/PKG-INFO +79 -0
- jitters_cli-0.1.0/README.md +61 -0
- jitters_cli-0.1.0/jitters_cli/__init__.py +2 -0
- jitters_cli-0.1.0/jitters_cli/__main__.py +5 -0
- jitters_cli-0.1.0/jitters_cli/cli.py +33 -0
- jitters_cli-0.1.0/jitters_cli/core.py +96 -0
- jitters_cli-0.1.0/jitters_cli/mcp.py +52 -0
- jitters_cli-0.1.0/jitters_cli/rules.py +36 -0
- jitters_cli-0.1.0/jitters_cli.egg-info/PKG-INFO +79 -0
- jitters_cli-0.1.0/jitters_cli.egg-info/SOURCES.txt +15 -0
- jitters_cli-0.1.0/jitters_cli.egg-info/dependency_links.txt +1 -0
- jitters_cli-0.1.0/jitters_cli.egg-info/entry_points.txt +2 -0
- jitters_cli-0.1.0/jitters_cli.egg-info/top_level.txt +1 -0
- jitters_cli-0.1.0/pyproject.toml +24 -0
- jitters_cli-0.1.0/setup.cfg +4 -0
- jitters_cli-0.1.0/tests/test_jitters.py +91 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vibeoverflow
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jitters-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Jitters the VibeCoder, an anxious monkey, in the state of your week of commits: groggy after 2 am, fit after a week of daytime ones. CLI and MCP server; reads only your commit hours, sends nothing.
|
|
5
|
+
Author: Vibeoverflow
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://vibeoverflow.lol/week?src=pypi
|
|
8
|
+
Project-URL: Shop, https://vibeoverflow.lol/shop.html?src=pypi
|
|
9
|
+
Keywords: mcp,mcp-server,git,commits,vibe-coding,claude-code,cli,tamagotchi,monkey
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# jitters-cli
|
|
20
|
+
|
|
21
|
+
**Jitters the VibeCoder, an anxious monkey who codes, in the state of your week of commits.** Groggy after your 2 am commits, fit after a week of daytime ones, on the sofa after a week of none.
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
uvx jitters-cli
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
(or `pipx run jitters-cli`; with Node: `npx -y https://vibeoverflow.lol/dl/jitters-cli.tgz`)
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
.-"""-. 3am
|
|
33
|
+
.-. / .---. \ .-.
|
|
34
|
+
( (_| @ - |_) )
|
|
35
|
+
'-.| v |.-'
|
|
36
|
+
\ ~~~ /
|
|
37
|
+
'-.___.-'
|
|
38
|
+
c[_] c[_] c[_] c[_] c[_]
|
|
39
|
+
|
|
40
|
+
Jitters, your week: groggy
|
|
41
|
+
You commit after midnight. He is groggy and on his fifth coffee.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
It prints one link to see him drawn in that mood, with a picture to save: [vibeoverflow.lol/week](https://vibeoverflow.lol/week?src=pypi).
|
|
45
|
+
|
|
46
|
+
## What it reads
|
|
47
|
+
|
|
48
|
+
Only the dates and hours of **your own** commits (your `git config user.email`) of the last 7 days in the folder it runs in. No network call, no telemetry, no dependency. The link carries the mood word, nothing else. `--all` counts every author.
|
|
49
|
+
|
|
50
|
+
## The rules, first that holds
|
|
51
|
+
|
|
52
|
+
1. seven days with nothing committed: **sofa**
|
|
53
|
+
2. a third or more of your commits between midnight and 5 am: **groggy**
|
|
54
|
+
3. ten or more a day: **wired**
|
|
55
|
+
4. five days or more of daytime commits, none after midnight: **fit**
|
|
56
|
+
5. one or more a day: **steady**
|
|
57
|
+
6. less than one a day: **sleepy**
|
|
58
|
+
|
|
59
|
+
## For your coding agent (MCP)
|
|
60
|
+
|
|
61
|
+
One tool, `jitters_week`: "how wrecked is my monkey?"
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{ "mcpServers": { "jitters": { "command": "uvx", "args": ["jitters-cli", "--mcp"] } } }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Claude Code: `claude mcp add jitters -- uvx jitters-cli --mcp`
|
|
68
|
+
|
|
69
|
+
## Options
|
|
70
|
+
|
|
71
|
+
`--json` prints the answer as JSON; `--all` every author; `--mcp` runs the stdio server.
|
|
72
|
+
|
|
73
|
+
## Him, on your desk
|
|
74
|
+
|
|
75
|
+
Jitters at your own commit hour on a mug, and his night as stickers: [the shop](https://vibeoverflow.lol/shop.html?src=pypi).
|
|
76
|
+
|
|
77
|
+
MIT. Made by the Vibeoverflow team, [vibeoverflow.lol](https://vibeoverflow.lol/?src=pypi).
|
|
78
|
+
|
|
79
|
+
<!-- mcp-name: lol.vibeoverflow/jitters -->
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# jitters-cli
|
|
2
|
+
|
|
3
|
+
**Jitters the VibeCoder, an anxious monkey who codes, in the state of your week of commits.** Groggy after your 2 am commits, fit after a week of daytime ones, on the sofa after a week of none.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
uvx jitters-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
(or `pipx run jitters-cli`; with Node: `npx -y https://vibeoverflow.lol/dl/jitters-cli.tgz`)
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
.-"""-. 3am
|
|
15
|
+
.-. / .---. \ .-.
|
|
16
|
+
( (_| @ - |_) )
|
|
17
|
+
'-.| v |.-'
|
|
18
|
+
\ ~~~ /
|
|
19
|
+
'-.___.-'
|
|
20
|
+
c[_] c[_] c[_] c[_] c[_]
|
|
21
|
+
|
|
22
|
+
Jitters, your week: groggy
|
|
23
|
+
You commit after midnight. He is groggy and on his fifth coffee.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
It prints one link to see him drawn in that mood, with a picture to save: [vibeoverflow.lol/week](https://vibeoverflow.lol/week?src=pypi).
|
|
27
|
+
|
|
28
|
+
## What it reads
|
|
29
|
+
|
|
30
|
+
Only the dates and hours of **your own** commits (your `git config user.email`) of the last 7 days in the folder it runs in. No network call, no telemetry, no dependency. The link carries the mood word, nothing else. `--all` counts every author.
|
|
31
|
+
|
|
32
|
+
## The rules, first that holds
|
|
33
|
+
|
|
34
|
+
1. seven days with nothing committed: **sofa**
|
|
35
|
+
2. a third or more of your commits between midnight and 5 am: **groggy**
|
|
36
|
+
3. ten or more a day: **wired**
|
|
37
|
+
4. five days or more of daytime commits, none after midnight: **fit**
|
|
38
|
+
5. one or more a day: **steady**
|
|
39
|
+
6. less than one a day: **sleepy**
|
|
40
|
+
|
|
41
|
+
## For your coding agent (MCP)
|
|
42
|
+
|
|
43
|
+
One tool, `jitters_week`: "how wrecked is my monkey?"
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{ "mcpServers": { "jitters": { "command": "uvx", "args": ["jitters-cli", "--mcp"] } } }
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Claude Code: `claude mcp add jitters -- uvx jitters-cli --mcp`
|
|
50
|
+
|
|
51
|
+
## Options
|
|
52
|
+
|
|
53
|
+
`--json` prints the answer as JSON; `--all` every author; `--mcp` runs the stdio server.
|
|
54
|
+
|
|
55
|
+
## Him, on your desk
|
|
56
|
+
|
|
57
|
+
Jitters at your own commit hour on a mug, and his night as stickers: [the shop](https://vibeoverflow.lol/shop.html?src=pypi).
|
|
58
|
+
|
|
59
|
+
MIT. Made by the Vibeoverflow team, [vibeoverflow.lol](https://vibeoverflow.lol/?src=pypi).
|
|
60
|
+
|
|
61
|
+
<!-- mcp-name: lol.vibeoverflow/jitters -->
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
from .core import text, week
|
|
6
|
+
|
|
7
|
+
HELP = """jitters-cli: Jitters the VibeCoder in the state of your week.
|
|
8
|
+
|
|
9
|
+
uvx jitters-cli your own commits of the last 7 days in this folder
|
|
10
|
+
uvx jitters-cli --all every author's commits
|
|
11
|
+
uvx jitters-cli --json the answer as JSON
|
|
12
|
+
uvx jitters-cli --mcp run as an MCP stdio server (one tool: jitters_week)
|
|
13
|
+
|
|
14
|
+
It reads only the hours of the commits; nothing leaves your machine."""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def main(argv=None):
|
|
18
|
+
args = sys.argv[1:] if argv is None else argv
|
|
19
|
+
val = next((a.split("=", 1)[1] for a in args if a.startswith("--src=")), None)
|
|
20
|
+
if "--help" in args or "-h" in args:
|
|
21
|
+
print(HELP)
|
|
22
|
+
return 0
|
|
23
|
+
if "--mcp" in args:
|
|
24
|
+
from .mcp import serve
|
|
25
|
+
serve(src=val or "mcp")
|
|
26
|
+
return 0
|
|
27
|
+
r = week(os.getcwd(), "--all" in args, val or os.environ.get("JITTERS_SRC") or "cli")
|
|
28
|
+
print(json.dumps(r, indent=2) if "--json" in args else text(r))
|
|
29
|
+
return 1 if r.get("error") else 0
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
if __name__ == "__main__":
|
|
33
|
+
sys.exit(main())
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"""Reads one thing: the dates and hours of your own commits in the last 7 days of the folder it runs in. Nothing is sent anywhere."""
|
|
2
|
+
import re
|
|
3
|
+
import subprocess
|
|
4
|
+
import time
|
|
5
|
+
|
|
6
|
+
from .rules import mood
|
|
7
|
+
|
|
8
|
+
WEEK = 7 * 86400
|
|
9
|
+
SITE = "https://vibeoverflow.lol/week"
|
|
10
|
+
SAY = {
|
|
11
|
+
"sofa": "Nothing committed in seven days. He has been on the sofa all week.",
|
|
12
|
+
"groggy": "You commit after midnight. He is groggy and on his fifth coffee.",
|
|
13
|
+
"wired": "Ten or more commits a day. He is shaking.",
|
|
14
|
+
"fit": "A week of daytime commits. He is fit.",
|
|
15
|
+
"steady": "A commit or more a day. He types along with you.",
|
|
16
|
+
"sleepy": "A quiet week. He dozes at the desk.",
|
|
17
|
+
}
|
|
18
|
+
FACE = {
|
|
19
|
+
"sofa": ("- -", " ___ ", " zz", [" .-[===========]-.", " |_______________|"]),
|
|
20
|
+
"groggy": ("@ -", " ~~~ ", " 3am", [" c[_] c[_] c[_] c[_] c[_]"]),
|
|
21
|
+
"wired": ("O O", "\\/\\/\\", " !!!", [" c[_] c[_] c[_] c[_] c[_] c[_] c[_]"]),
|
|
22
|
+
"fit": ("^ ^", "\\___/", " \\o/", [" / \\", " / \\"]),
|
|
23
|
+
"steady": ("o o", " --- ", "", [" __________", " [__________]"]),
|
|
24
|
+
"sleepy": ("- o", " o ", " z Z", [" __________", " [__________]"]),
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _git(args, cwd):
|
|
29
|
+
return subprocess.run(["git", *args], cwd=cwd, capture_output=True, text=True, check=True).stdout.strip()
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def parse(out, now=None):
|
|
33
|
+
"""One line per commit, '<unix seconds> YYYY-MM-DD HH'; only the last 7 days kept (git log --since stops at the first
|
|
34
|
+
older commit it walks, so a rebased history would hide commits: the filter is here)."""
|
|
35
|
+
now = time.time() if now is None else now
|
|
36
|
+
got = []
|
|
37
|
+
for line in out.splitlines():
|
|
38
|
+
parts = line.split()
|
|
39
|
+
if len(parts) != 3 or not parts[0].isdigit() or not re.fullmatch(r"\d{4}-\d\d-\d\d", parts[1]) or not parts[2].isdigit():
|
|
40
|
+
continue
|
|
41
|
+
t, hour = int(parts[0]), int(parts[2])
|
|
42
|
+
if now - t <= WEEK and t <= now + 86400 and 0 <= hour < 24:
|
|
43
|
+
got.append((parts[1], hour))
|
|
44
|
+
return got
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def commits(cwd=".", all_authors=False):
|
|
48
|
+
try:
|
|
49
|
+
_git(["rev-parse", "--is-inside-work-tree"], cwd)
|
|
50
|
+
except (subprocess.CalledProcessError, FileNotFoundError):
|
|
51
|
+
return None
|
|
52
|
+
me = ""
|
|
53
|
+
if not all_authors:
|
|
54
|
+
try:
|
|
55
|
+
me = _git(["config", "user.email"], cwd)
|
|
56
|
+
except subprocess.CalledProcessError:
|
|
57
|
+
me = ""
|
|
58
|
+
args = ["log", "-n", "5000", "--format=%ct %cd", "--date=format:%Y-%m-%d %H", "--no-merges"]
|
|
59
|
+
if me:
|
|
60
|
+
args.append(f"--author={me}")
|
|
61
|
+
try:
|
|
62
|
+
return parse(_git(args, cwd))
|
|
63
|
+
except subprocess.CalledProcessError:
|
|
64
|
+
return [] # a repository with no commit yet
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def clean_src(s):
|
|
68
|
+
m = re.search(r"[a-z0-9]{1,24}", str(s or "cli").lower())
|
|
69
|
+
return m.group(0) if m else "cli"
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def link(m, src):
|
|
73
|
+
return f"{SITE}?m={m}&src={clean_src(src)}"
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def week(cwd=".", all_authors=False, src="cli"):
|
|
77
|
+
"""The whole answer: only the mood bucket goes into the link, never a count, an hour or a name."""
|
|
78
|
+
c = commits(cwd, all_authors)
|
|
79
|
+
if c is None:
|
|
80
|
+
return {"error": "Not a git repository. Run it in a folder with your code."}
|
|
81
|
+
r = mood(c)
|
|
82
|
+
return {**r, "say": SAY[r["mood"]], "link": link(r["mood"], src)}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def draw(m):
|
|
86
|
+
eyes, mouth, top, under = FACE.get(m, FACE["steady"])
|
|
87
|
+
return "\n".join([f' .-"""-. {top}', " .-. / .---. \\ .-.", f" ( (_| {eyes} |_) )",
|
|
88
|
+
" '-.| v |.-'", f" \\ {mouth} /", " '-.___.-'", *under])
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def text(r):
|
|
92
|
+
if r.get("error"):
|
|
93
|
+
return r["error"]
|
|
94
|
+
return "\n".join([draw(r["mood"]), "", f"Jitters, your week: {r['mood']}", r["say"],
|
|
95
|
+
f"{r['commits']} commits in 7 days, {r['night']} between midnight and 5 am, on {r['days']} days.",
|
|
96
|
+
f"({r['rule']})", "", f"See him drawn: {r['link']}"])
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""A thin MCP stdio server: newline-delimited JSON-RPC, one tool. No SDK, no network."""
|
|
2
|
+
import json
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
from . import __version__
|
|
7
|
+
from .core import text, week
|
|
8
|
+
|
|
9
|
+
TOOL = {
|
|
10
|
+
"name": "jitters_week",
|
|
11
|
+
"description": "How wrecked is the coder's monkey? Reads only the hours of the user's own commits in the last 7 days of a local git folder and answers Jitters' mood (sofa, groggy, wired, fit, steady or sleepy) with a small drawing and a link.",
|
|
12
|
+
"inputSchema": {"type": "object", "properties": {
|
|
13
|
+
"path": {"type": "string", "description": "The git folder to read; the server's working folder when left out."},
|
|
14
|
+
"all": {"type": "boolean", "description": "Count every author, not only the local git user."}}},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def handle(msg, cwd=None, src="mcp"):
|
|
19
|
+
mid, method, params = msg.get("id"), msg.get("method"), msg.get("params") or {}
|
|
20
|
+
if mid is None:
|
|
21
|
+
return None # a notification gets no answer
|
|
22
|
+
|
|
23
|
+
def ok(result):
|
|
24
|
+
return {"jsonrpc": "2.0", "id": mid, "result": result}
|
|
25
|
+
if method == "initialize":
|
|
26
|
+
return ok({"protocolVersion": params.get("protocolVersion") or "2025-06-18", "capabilities": {"tools": {}},
|
|
27
|
+
"serverInfo": {"name": "jitters", "version": __version__}})
|
|
28
|
+
if method == "ping":
|
|
29
|
+
return ok({})
|
|
30
|
+
if method == "tools/list":
|
|
31
|
+
return ok({"tools": [TOOL]})
|
|
32
|
+
if method == "tools/call":
|
|
33
|
+
if params.get("name") != TOOL["name"]:
|
|
34
|
+
return {"jsonrpc": "2.0", "id": mid, "error": {"code": -32602, "message": f"Unknown tool: {params.get('name')}"}}
|
|
35
|
+
a = params.get("arguments") or {}
|
|
36
|
+
r = week(a.get("path") or cwd or os.getcwd(), bool(a.get("all")), src)
|
|
37
|
+
return ok({"content": [{"type": "text", "text": text(r)}], "isError": bool(r.get("error"))})
|
|
38
|
+
return {"jsonrpc": "2.0", "id": mid, "error": {"code": -32601, "message": f"Method not found: {method}"}}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def serve(src="mcp", inp=None, out=None):
|
|
42
|
+
inp, out = inp or sys.stdin, out or sys.stdout
|
|
43
|
+
for line in inp:
|
|
44
|
+
if not line.strip():
|
|
45
|
+
continue
|
|
46
|
+
try:
|
|
47
|
+
reply = handle(json.loads(line), src=src)
|
|
48
|
+
except (ValueError, AttributeError):
|
|
49
|
+
reply = {"jsonrpc": "2.0", "id": None, "error": {"code": -32700, "message": "Parse error"}}
|
|
50
|
+
if reply:
|
|
51
|
+
out.write(json.dumps(reply) + "\n")
|
|
52
|
+
out.flush()
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""The rules, first that holds, over the last 7 days of your own commits in this folder, at the hour you committed.
|
|
2
|
+
The same rules as the npm package (packages/jitters-cli/lib/rules.js)."""
|
|
3
|
+
RULES = [
|
|
4
|
+
("sofa", "seven days with nothing committed: he is on the sofa, getting round"),
|
|
5
|
+
("groggy", "a third or more of your commits between midnight and 5 am: he is groggy, on his fifth coffee"),
|
|
6
|
+
("wired", "ten or more a day: he shakes, coffee after coffee"),
|
|
7
|
+
("fit", "five days or more of daytime commits, none after midnight: he is fit, on his toes"),
|
|
8
|
+
("steady", "one or more a day: he types along"),
|
|
9
|
+
("sleepy", "less than one a day: he dozes at the desk"),
|
|
10
|
+
]
|
|
11
|
+
MOODS = [m for m, _ in RULES]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def is_night(hour):
|
|
15
|
+
return 0 <= hour < 5
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def mood(commits):
|
|
19
|
+
"""commits: [(day 'YYYY-MM-DD', hour 0..23)] in the committer's own clock."""
|
|
20
|
+
n = len(commits)
|
|
21
|
+
night = sum(1 for _, h in commits if is_night(h))
|
|
22
|
+
days = len({d for d, _ in commits})
|
|
23
|
+
|
|
24
|
+
def pick(i):
|
|
25
|
+
return {"mood": RULES[i][0], "rule": RULES[i][1], "commits": n, "night": night, "days": days}
|
|
26
|
+
if n == 0:
|
|
27
|
+
return pick(0)
|
|
28
|
+
if night * 3 >= n:
|
|
29
|
+
return pick(1)
|
|
30
|
+
if n >= 70:
|
|
31
|
+
return pick(2)
|
|
32
|
+
if days >= 5 and night == 0:
|
|
33
|
+
return pick(3)
|
|
34
|
+
if n >= 7:
|
|
35
|
+
return pick(4)
|
|
36
|
+
return pick(5)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jitters-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Jitters the VibeCoder, an anxious monkey, in the state of your week of commits: groggy after 2 am, fit after a week of daytime ones. CLI and MCP server; reads only your commit hours, sends nothing.
|
|
5
|
+
Author: Vibeoverflow
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://vibeoverflow.lol/week?src=pypi
|
|
8
|
+
Project-URL: Shop, https://vibeoverflow.lol/shop.html?src=pypi
|
|
9
|
+
Keywords: mcp,mcp-server,git,commits,vibe-coding,claude-code,cli,tamagotchi,monkey
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# jitters-cli
|
|
20
|
+
|
|
21
|
+
**Jitters the VibeCoder, an anxious monkey who codes, in the state of your week of commits.** Groggy after your 2 am commits, fit after a week of daytime ones, on the sofa after a week of none.
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
uvx jitters-cli
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
(or `pipx run jitters-cli`; with Node: `npx -y https://vibeoverflow.lol/dl/jitters-cli.tgz`)
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
.-"""-. 3am
|
|
33
|
+
.-. / .---. \ .-.
|
|
34
|
+
( (_| @ - |_) )
|
|
35
|
+
'-.| v |.-'
|
|
36
|
+
\ ~~~ /
|
|
37
|
+
'-.___.-'
|
|
38
|
+
c[_] c[_] c[_] c[_] c[_]
|
|
39
|
+
|
|
40
|
+
Jitters, your week: groggy
|
|
41
|
+
You commit after midnight. He is groggy and on his fifth coffee.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
It prints one link to see him drawn in that mood, with a picture to save: [vibeoverflow.lol/week](https://vibeoverflow.lol/week?src=pypi).
|
|
45
|
+
|
|
46
|
+
## What it reads
|
|
47
|
+
|
|
48
|
+
Only the dates and hours of **your own** commits (your `git config user.email`) of the last 7 days in the folder it runs in. No network call, no telemetry, no dependency. The link carries the mood word, nothing else. `--all` counts every author.
|
|
49
|
+
|
|
50
|
+
## The rules, first that holds
|
|
51
|
+
|
|
52
|
+
1. seven days with nothing committed: **sofa**
|
|
53
|
+
2. a third or more of your commits between midnight and 5 am: **groggy**
|
|
54
|
+
3. ten or more a day: **wired**
|
|
55
|
+
4. five days or more of daytime commits, none after midnight: **fit**
|
|
56
|
+
5. one or more a day: **steady**
|
|
57
|
+
6. less than one a day: **sleepy**
|
|
58
|
+
|
|
59
|
+
## For your coding agent (MCP)
|
|
60
|
+
|
|
61
|
+
One tool, `jitters_week`: "how wrecked is my monkey?"
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{ "mcpServers": { "jitters": { "command": "uvx", "args": ["jitters-cli", "--mcp"] } } }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Claude Code: `claude mcp add jitters -- uvx jitters-cli --mcp`
|
|
68
|
+
|
|
69
|
+
## Options
|
|
70
|
+
|
|
71
|
+
`--json` prints the answer as JSON; `--all` every author; `--mcp` runs the stdio server.
|
|
72
|
+
|
|
73
|
+
## Him, on your desk
|
|
74
|
+
|
|
75
|
+
Jitters at your own commit hour on a mug, and his night as stickers: [the shop](https://vibeoverflow.lol/shop.html?src=pypi).
|
|
76
|
+
|
|
77
|
+
MIT. Made by the Vibeoverflow team, [vibeoverflow.lol](https://vibeoverflow.lol/?src=pypi).
|
|
78
|
+
|
|
79
|
+
<!-- mcp-name: lol.vibeoverflow/jitters -->
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
jitters_cli/__init__.py
|
|
5
|
+
jitters_cli/__main__.py
|
|
6
|
+
jitters_cli/cli.py
|
|
7
|
+
jitters_cli/core.py
|
|
8
|
+
jitters_cli/mcp.py
|
|
9
|
+
jitters_cli/rules.py
|
|
10
|
+
jitters_cli.egg-info/PKG-INFO
|
|
11
|
+
jitters_cli.egg-info/SOURCES.txt
|
|
12
|
+
jitters_cli.egg-info/dependency_links.txt
|
|
13
|
+
jitters_cli.egg-info/entry_points.txt
|
|
14
|
+
jitters_cli.egg-info/top_level.txt
|
|
15
|
+
tests/test_jitters.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
jitters_cli
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "jitters-cli"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Jitters the VibeCoder, an anxious monkey, in the state of your week of commits: groggy after 2 am, fit after a week of daytime ones. CLI and MCP server; reads only your commit hours, sends nothing."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.8"
|
|
12
|
+
authors = [{ name = "Vibeoverflow" }]
|
|
13
|
+
keywords = ["mcp", "mcp-server", "git", "commits", "vibe-coding", "claude-code", "cli", "tamagotchi", "monkey"]
|
|
14
|
+
classifiers = ["Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Environment :: Console", "Topic :: Software Development :: Version Control :: Git"]
|
|
15
|
+
|
|
16
|
+
[project.urls]
|
|
17
|
+
Homepage = "https://vibeoverflow.lol/week?src=pypi"
|
|
18
|
+
Shop = "https://vibeoverflow.lol/shop.html?src=pypi"
|
|
19
|
+
|
|
20
|
+
[project.scripts]
|
|
21
|
+
jitters-cli = "jitters_cli.cli:main"
|
|
22
|
+
|
|
23
|
+
[tool.setuptools]
|
|
24
|
+
packages = ["jitters_cli"]
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"""The Python twin of the npm package's tests. python3 -m pytest tests/ (or unittest)."""
|
|
2
|
+
import io
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
import subprocess
|
|
6
|
+
import sys
|
|
7
|
+
import tempfile
|
|
8
|
+
import time
|
|
9
|
+
import unittest
|
|
10
|
+
|
|
11
|
+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
|
12
|
+
from jitters_cli.core import FACE, SAY, commits, link, text, week # noqa: E402
|
|
13
|
+
from jitters_cli.mcp import handle, serve # noqa: E402
|
|
14
|
+
from jitters_cli.rules import MOODS, mood # noqa: E402
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def repo():
|
|
18
|
+
d = tempfile.mkdtemp(prefix="jit-")
|
|
19
|
+
g = lambda *a, env=None: subprocess.run(["git", *a], cwd=d, check=True, capture_output=True, env={**os.environ, **(env or {})})
|
|
20
|
+
g("init", "-q"); g("config", "user.email", "me@example.com"); g("config", "user.name", "me")
|
|
21
|
+
|
|
22
|
+
def commit(when, email="me@example.com"):
|
|
23
|
+
with open(os.path.join(d, "f"), "w") as f:
|
|
24
|
+
f.write(str(time.time_ns()))
|
|
25
|
+
g("add", "f")
|
|
26
|
+
g("commit", "-q", "-m", "x", f"--author=o <{email}>", env={"GIT_COMMITTER_DATE": when, "GIT_AUTHOR_DATE": when})
|
|
27
|
+
return d, commit
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def ago(days, hour):
|
|
31
|
+
t = int(time.time()) - days * 86400
|
|
32
|
+
t = t - t % 86400 + hour * 3600 + 420
|
|
33
|
+
if t > time.time():
|
|
34
|
+
t -= 86400
|
|
35
|
+
return f"@{t} +0000"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class Rules(unittest.TestCase):
|
|
39
|
+
def test_moods(self):
|
|
40
|
+
self.assertEqual(mood([])["mood"], "sofa")
|
|
41
|
+
self.assertEqual(mood([("2026-10-20", 2), ("2026-10-20", 14), ("2026-10-21", 15)])["mood"], "groggy")
|
|
42
|
+
self.assertEqual(mood([("2026-10-20", 5), ("2026-10-20", 14), ("2026-10-21", 15)])["mood"], "sleepy")
|
|
43
|
+
self.assertEqual(mood([(f"2026-10-1{i % 7}", 13) for i in range(70)])["mood"], "wired")
|
|
44
|
+
self.assertEqual(mood([(f"2026-10-1{i}", 11) for i in range(5)])["mood"], "fit")
|
|
45
|
+
self.assertEqual(mood([(f"2026-10-1{i % 5}", 11) for i in range(9)] + [("2026-10-15", 1)])["mood"], "steady")
|
|
46
|
+
self.assertEqual(mood([("2026-10-15", 16)] * 3)["mood"], "sleepy")
|
|
47
|
+
|
|
48
|
+
def test_every_mood_has_a_face_and_a_line(self):
|
|
49
|
+
for m in MOODS:
|
|
50
|
+
self.assertIn(m, FACE); self.assertIn(m, SAY)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class Git(unittest.TestCase):
|
|
54
|
+
def test_outside_a_repository(self):
|
|
55
|
+
self.assertIsNone(commits(tempfile.mkdtemp()))
|
|
56
|
+
self.assertIn("Not a git repository", week(tempfile.mkdtemp())["error"])
|
|
57
|
+
|
|
58
|
+
def test_only_my_commits_of_the_week(self):
|
|
59
|
+
d, commit = repo()
|
|
60
|
+
commit(ago(1, 14)); commit(ago(2, 15)); commit(ago(20, 3)); commit(ago(1, 2), "other@example.com")
|
|
61
|
+
self.assertEqual(len(commits(d)), 2)
|
|
62
|
+
self.assertEqual(len(commits(d, True)), 3)
|
|
63
|
+
|
|
64
|
+
def test_the_link_carries_only_mood_and_src(self):
|
|
65
|
+
self.assertEqual(link("groggy", "glama"), "https://vibeoverflow.lol/week?m=groggy&src=glama")
|
|
66
|
+
self.assertEqual(link("fit", '"><script>'), "https://vibeoverflow.lol/week?m=fit&src=script")
|
|
67
|
+
d, commit = repo(); commit(ago(1, 3)); commit(ago(1, 3))
|
|
68
|
+
r = week(d)
|
|
69
|
+
self.assertEqual(r["mood"], "groggy")
|
|
70
|
+
self.assertIn("See him drawn: https://vibeoverflow.lol/week?m=groggy&src=cli", text(r))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class Mcp(unittest.TestCase):
|
|
74
|
+
def test_initialize_list_call(self):
|
|
75
|
+
self.assertEqual(handle({"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2025-03-26"}})["result"]["protocolVersion"], "2025-03-26")
|
|
76
|
+
self.assertIsNone(handle({"jsonrpc": "2.0", "method": "notifications/initialized"}))
|
|
77
|
+
self.assertEqual(handle({"jsonrpc": "2.0", "id": 2, "method": "tools/list"})["result"]["tools"][0]["name"], "jitters_week")
|
|
78
|
+
r = handle({"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "jitters_week", "arguments": {"path": os.path.dirname(__file__)}}})
|
|
79
|
+
self.assertIn("src=mcp", r["result"]["content"][0]["text"])
|
|
80
|
+
self.assertEqual(handle({"jsonrpc": "2.0", "id": 4, "method": "nope"})["error"]["code"], -32601)
|
|
81
|
+
|
|
82
|
+
def test_stdio(self):
|
|
83
|
+
out = io.StringIO()
|
|
84
|
+
serve(inp=io.StringIO('{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}\n{"jsonrpc":"2.0","method":"notifications/initialized"}\n{"jsonrpc":"2.0","id":2,"method":"tools/list"}\n'), out=out)
|
|
85
|
+
a, b = [json.loads(l) for l in out.getvalue().splitlines()]
|
|
86
|
+
self.assertEqual(a["result"]["serverInfo"]["name"], "jitters")
|
|
87
|
+
self.assertEqual(b["id"], 2)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
if __name__ == "__main__":
|
|
91
|
+
unittest.main()
|