jitters-cli 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,2 @@
1
+ """Jitters the VibeCoder, an anxious monkey, in the state of your week of commits."""
2
+ __version__ = "0.1.0"
@@ -0,0 +1,5 @@
1
+ import sys
2
+
3
+ from .cli import main
4
+
5
+ sys.exit(main())
jitters_cli/cli.py ADDED
@@ -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())
jitters_cli/core.py ADDED
@@ -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']}"])
jitters_cli/mcp.py ADDED
@@ -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()
jitters_cli/rules.py ADDED
@@ -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
+ ![Jitters at 3:33 am, asleep on the keys](https://vibeoverflow.lol/shop/333am.webp)
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,12 @@
1
+ jitters_cli/__init__.py,sha256=pvZ4v1YII34R5JHPg74SBmLAa54TpapmMzIRE5qhT6k,108
2
+ jitters_cli/__main__.py,sha256=E6Gls0DNz8GQK2K-kOUIx8cYhgANW_CH54VKrfCfs14,52
3
+ jitters_cli/cli.py,sha256=RcuOPNBZ0n1EfMWiVICRL8skR_tWmGHvpRRs4fe9BDw,1047
4
+ jitters_cli/core.py,sha256=BZrAlOFwB0scOIv0-c7JGq_TtBhRndC6M87IQRON7u4,3818
5
+ jitters_cli/mcp.py,sha256=3HmJwCvPPA31gqnRx2zATBQg3r7vP1DohQN4m2JTsQA,2378
6
+ jitters_cli/rules.py,sha256=2w8Ga2-1GKgBAo4acTQuBLmUxw3Ew9LP70rtuQLrtBg,1330
7
+ jitters_cli-0.1.0.dist-info/licenses/LICENSE,sha256=a22lFGJxGTRMdRbnyfEG5MOSnowSA0LGKz-5kdWBA24,1069
8
+ jitters_cli-0.1.0.dist-info/METADATA,sha256=JpNa_YWtgaob5t4QX_MnXRmI03I1bIaj7mq8hpfLLA4,2846
9
+ jitters_cli-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
10
+ jitters_cli-0.1.0.dist-info/entry_points.txt,sha256=2FinuLJUpp3okf0bI7yujqGacFE-oxLg8db0Q3dxyo0,53
11
+ jitters_cli-0.1.0.dist-info/top_level.txt,sha256=jY257LHYWJfD9SgZ0SPmm0TuOVwLm23OpY7wfdSE1zI,12
12
+ jitters_cli-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ jitters-cli = jitters_cli.cli:main
@@ -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 @@
1
+ jitters_cli