rubber-ducky 1.2.2__py3-none-any.whl → 1.4.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.
- crumbs/disk-usage/disk-usage.sh +12 -0
- crumbs/disk-usage/info.txt +3 -0
- crumbs/git-log/git-log.sh +24 -0
- crumbs/git-log/info.txt +3 -0
- crumbs/git-status/git-status.sh +21 -0
- crumbs/git-status/info.txt +3 -0
- crumbs/process-list/info.txt +3 -0
- crumbs/process-list/process-list.sh +20 -0
- crumbs/recent-files/info.txt +3 -0
- crumbs/recent-files/recent-files.sh +13 -0
- crumbs/system-health/info.txt +3 -0
- crumbs/system-health/system-health.sh +58 -0
- ducky/__init__.py +3 -1
- ducky/config.py +60 -0
- ducky/ducky.py +731 -90
- examples/POLLING_USER_GUIDE.md +470 -0
- examples/mock-logs/info.txt +7 -0
- examples/mock-logs/mock-logs.sh +39 -0
- rubber_ducky-1.4.0.dist-info/METADATA +210 -0
- rubber_ducky-1.4.0.dist-info/RECORD +24 -0
- rubber_ducky-1.4.0.dist-info/top_level.txt +3 -0
- rubber_ducky-1.2.2.dist-info/METADATA +0 -72
- rubber_ducky-1.2.2.dist-info/RECORD +0 -8
- rubber_ducky-1.2.2.dist-info/top_level.txt +0 -1
- {rubber_ducky-1.2.2.dist-info → rubber_ducky-1.4.0.dist-info}/WHEEL +0 -0
- {rubber_ducky-1.2.2.dist-info → rubber_ducky-1.4.0.dist-info}/entry_points.txt +0 -0
- {rubber_ducky-1.2.2.dist-info → rubber_ducky-1.4.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Show disk usage with highlights
|
|
4
|
+
|
|
5
|
+
echo "=== Disk Usage Overview ==="
|
|
6
|
+
df -h 2>/dev/null | grep -E "(/|Filesystem)"
|
|
7
|
+
|
|
8
|
+
echo -e "\n=== Detailed Disk Usage ==="
|
|
9
|
+
du -h -d 2 . 2>/dev/null | sort -hr | head -20
|
|
10
|
+
|
|
11
|
+
echo -e "\n=== Largest Files in Current Directory ==="
|
|
12
|
+
find . -type f -not -path '*/\.git/*' -not -path '*/node_modules/*' -not -path '*/venv/*' -not -path '*/\__pycache__/*' -exec du -h {} + 2>/dev/null | sort -rh | head -10
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Show recent commit history with details
|
|
4
|
+
|
|
5
|
+
if ! git rev-parse --git-dir > /dev/null 2>&1; then
|
|
6
|
+
echo "Not a git repository."
|
|
7
|
+
exit 1
|
|
8
|
+
fi
|
|
9
|
+
|
|
10
|
+
# Default to showing last 10 commits
|
|
11
|
+
COMMIT_COUNT=10
|
|
12
|
+
|
|
13
|
+
if [ -n "$1" ] && [[ "$1" =~ ^[0-9]+$ ]]; then
|
|
14
|
+
COMMIT_COUNT=$1
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
echo "=== Recent ${COMMIT_COUNT} Commits ==="
|
|
18
|
+
git log --oneline -$COMMIT_COUNT
|
|
19
|
+
|
|
20
|
+
echo -e "\n=== Detailed View of Last ${COMMIT_COUNT} Commits ==="
|
|
21
|
+
git log -${COMMIT_COUNT} --pretty=format:"%h - %an, %ar : %s" --stat
|
|
22
|
+
|
|
23
|
+
echo -e "\n=== Author Statistics ==="
|
|
24
|
+
git shortlog -sn --all -${COMMIT_COUNT} 2>/dev/null
|
crumbs/git-log/info.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Show comprehensive git status and recent activity
|
|
4
|
+
|
|
5
|
+
echo "=== Git Status ==="
|
|
6
|
+
git status --short 2>/dev/null || echo "Not a git repository."
|
|
7
|
+
|
|
8
|
+
echo -e "\n=== Current Branch ==="
|
|
9
|
+
git branch --show-current 2>/dev/null || echo "Not a git repository."
|
|
10
|
+
|
|
11
|
+
echo -e "\n=== Last 3 Commits ==="
|
|
12
|
+
git log --oneline -3 2>/dev/null || echo "No commits found."
|
|
13
|
+
|
|
14
|
+
echo -e "\n=== Staged Changes (if any) ==="
|
|
15
|
+
git diff --cached --stat 2>/dev/null
|
|
16
|
+
|
|
17
|
+
echo -e "\n=== Unstaged Changes (if any) ==="
|
|
18
|
+
git diff --stat 2>/dev/null
|
|
19
|
+
|
|
20
|
+
echo -e "\n=== Untracked Files (if any) ==="
|
|
21
|
+
git ls-files --others --exclude-standard 2>/dev/null | head -20
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Show running processes with useful information
|
|
4
|
+
|
|
5
|
+
echo "=== Running Processes (Top 20 by CPU) ==="
|
|
6
|
+
ps aux | sort -rk 3,3 | head -21 | awk '{printf "%-8s %-6s %-8s %s\n", $1, $2, $3, $11}' | column -t
|
|
7
|
+
|
|
8
|
+
echo -e "\n=== Running Processes (Top 20 by Memory) ==="
|
|
9
|
+
ps aux | sort -rk 4,4 | head -21 | awk '{printf "%-8s %-6s %-8s %s\n", $1, $2, $4, $11}' | column -t
|
|
10
|
+
|
|
11
|
+
echo -e "\n=== Process Counts by User ==="
|
|
12
|
+
ps aux | awk '{print $1}' | sort | uniq -c | sort -rn | head -10
|
|
13
|
+
|
|
14
|
+
echo -e "\n=== Check for Specific Processes ==="
|
|
15
|
+
for proc in "node" "python" "java" "docker" "npm" "uv"; do
|
|
16
|
+
count=$(pgrep -c "$proc" 2>/dev/null || echo "0")
|
|
17
|
+
if [ "$count" -gt 0 ]; then
|
|
18
|
+
echo "$proc: $count process(es)"
|
|
19
|
+
fi
|
|
20
|
+
done | sort
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Show recently modified files in current directory
|
|
4
|
+
# Takes optional argument for number of files to show (default 20)
|
|
5
|
+
|
|
6
|
+
FILE_COUNT=20
|
|
7
|
+
|
|
8
|
+
if [ -n "$1" ] && [[ "$1" =~ ^[0-9]+$ ]]; then
|
|
9
|
+
FILE_COUNT=$1
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
echo "=== ${FILE_COUNT} Most Recently Modified Files ==="
|
|
13
|
+
find . -type f -not -path '*/\.*' -not -path '*/node_modules/*' -not -path '*/\.git/*' -not -path '*/venv/*' -not -path '*/\__pycache__/*' -printf '%T@ %p\n' 2>/dev/null | sort -rn | head -${FILE_COUNT} | awk '{print strftime("%Y-%m-%d %H:%M:%S", $1), $2}'
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Show system health metrics
|
|
4
|
+
# Works on macOS and Linux
|
|
5
|
+
|
|
6
|
+
detect_os() {
|
|
7
|
+
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
8
|
+
echo "macos"
|
|
9
|
+
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
|
10
|
+
echo "linux"
|
|
11
|
+
else
|
|
12
|
+
echo "unknown"
|
|
13
|
+
fi
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
OS=$(detect_os)
|
|
17
|
+
|
|
18
|
+
echo "=== System Health ==="
|
|
19
|
+
echo "Platform: $OS"
|
|
20
|
+
echo "Uptime: $(uptime)" | awk '{print $3, $4}'
|
|
21
|
+
echo "Users logged in: $(who | wc -l | tr -d ' ')"
|
|
22
|
+
|
|
23
|
+
echo -e "\n=== CPU Usage ==="
|
|
24
|
+
|
|
25
|
+
if [ "$OS" == "macos" ]; then
|
|
26
|
+
echo "Load averages (1m, 5m, 15m): $(sysctl -n vm.loadavg)"
|
|
27
|
+
top -l 1 | grep "CPU usage"
|
|
28
|
+
elif [ "$OS" == "linux" ]; then
|
|
29
|
+
echo "Load averages (1m, 5m, 15m): $(uptime | awk -F'load average:' '{print $2}')"
|
|
30
|
+
top -bn1 | grep "Cpu(s)"
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
echo -e "\n=== Memory Usage ==="
|
|
34
|
+
|
|
35
|
+
if [ "$OS" == "macos" ]; then
|
|
36
|
+
# macOS memory
|
|
37
|
+
echo "Memory Stats:"
|
|
38
|
+
vm_stat | perl -ne '/page size of (\d+)/ and $ps=$1; /Pages\s+([^:]+)[^\d]+(\d+)/ and printf("%-16s % 16.2f MB\n", "$1:", $2 * $ps / 1048576);'
|
|
39
|
+
elif [ "$OS" == "linux" ]; then
|
|
40
|
+
free -h
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
echo -e "\n=== Disk Space ==="
|
|
44
|
+
df -h | grep -vE '^Filesystem|tmpfs|cdrom|devtmpfs'
|
|
45
|
+
|
|
46
|
+
echo -e "\n=== Network Connections ==="
|
|
47
|
+
|
|
48
|
+
if [ "$OS" == "macos" ]; then
|
|
49
|
+
netstat -an | grep ESTABLISHED | wc -l | xargs echo "Active network connections:"
|
|
50
|
+
elif [ "$OS" == "linux" ]; then
|
|
51
|
+
ss -tun | grep ESTAB | wc -l | xargs echo "Active network connections:"
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
echo -e "\n=== Top 5 Processes by CPU ==="
|
|
55
|
+
ps aux | sort -rk 3,3 | head -11 | tail -10 | awk '{printf "%-10s %6s %s\n", $1, $3, $11}'
|
|
56
|
+
|
|
57
|
+
echo -e "\n=== Top 5 Processes by Memory ==="
|
|
58
|
+
ps aux | sort -rk 4,4 | head -11 | tail -10 | awk '{printf "%-10s %6s %s\n", $1, $4, $11}'
|
ducky/__init__.py
CHANGED
ducky/config.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Dict, Any, Optional
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ConfigManager:
|
|
8
|
+
"""Manages Ducky configuration including model preferences."""
|
|
9
|
+
|
|
10
|
+
def __init__(self, config_dir: Optional[Path] = None):
|
|
11
|
+
if config_dir is None:
|
|
12
|
+
config_dir = Path.home() / ".ducky"
|
|
13
|
+
self.config_dir = config_dir
|
|
14
|
+
self.config_file = self.config_dir / "config"
|
|
15
|
+
self.config_dir.mkdir(parents=True, exist_ok=True)
|
|
16
|
+
|
|
17
|
+
def load_config(self) -> Dict[str, Any]:
|
|
18
|
+
"""Load configuration from file, returning defaults if not found."""
|
|
19
|
+
default_config = {
|
|
20
|
+
"last_model": "qwen3-coder:480b-cloud",
|
|
21
|
+
"last_host": "https://ollama.com"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if not self.config_file.exists():
|
|
25
|
+
return default_config
|
|
26
|
+
|
|
27
|
+
try:
|
|
28
|
+
with open(self.config_file, 'r') as f:
|
|
29
|
+
config = json.load(f)
|
|
30
|
+
# Ensure all required keys are present
|
|
31
|
+
for key in default_config:
|
|
32
|
+
if key not in config:
|
|
33
|
+
config[key] = default_config[key]
|
|
34
|
+
return config
|
|
35
|
+
except (json.JSONDecodeError, IOError):
|
|
36
|
+
return default_config
|
|
37
|
+
|
|
38
|
+
def save_config(self, config: Dict[str, Any]) -> None:
|
|
39
|
+
"""Save configuration to file."""
|
|
40
|
+
try:
|
|
41
|
+
with open(self.config_file, 'w') as f:
|
|
42
|
+
json.dump(config, f, indent=2)
|
|
43
|
+
except IOError as e:
|
|
44
|
+
print(f"Warning: Could not save config: {e}")
|
|
45
|
+
|
|
46
|
+
def get_last_model(self) -> tuple[str, str]:
|
|
47
|
+
"""Get the last used model and host.
|
|
48
|
+
|
|
49
|
+
Returns:
|
|
50
|
+
Tuple of (model_name, host)
|
|
51
|
+
"""
|
|
52
|
+
config = self.load_config()
|
|
53
|
+
return config.get("last_model", "qwen3-coder:480b-cloud"), config.get("last_host", "https://ollama.com")
|
|
54
|
+
|
|
55
|
+
def save_last_model(self, model_name: str, host: str) -> None:
|
|
56
|
+
"""Save the last used model and host."""
|
|
57
|
+
config = self.load_config()
|
|
58
|
+
config["last_model"] = model_name
|
|
59
|
+
config["last_host"] = host
|
|
60
|
+
self.save_config(config)
|