mcli-framework 7.0.0__py3-none-any.whl → 7.0.1__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.
Potentially problematic release.
This version of mcli-framework might be problematic. Click here for more details.
- mcli/app/logs_cmd.py +26 -27
- mcli/lib/logger/logger.py +5 -7
- mcli/lib/paths.py +82 -0
- {mcli_framework-7.0.0.dist-info → mcli_framework-7.0.1.dist-info}/METADATA +1 -1
- {mcli_framework-7.0.0.dist-info → mcli_framework-7.0.1.dist-info}/RECORD +9 -8
- {mcli_framework-7.0.0.dist-info → mcli_framework-7.0.1.dist-info}/WHEEL +0 -0
- {mcli_framework-7.0.0.dist-info → mcli_framework-7.0.1.dist-info}/entry_points.txt +0 -0
- {mcli_framework-7.0.0.dist-info → mcli_framework-7.0.1.dist-info}/licenses/LICENSE +0 -0
- {mcli_framework-7.0.0.dist-info → mcli_framework-7.0.1.dist-info}/top_level.txt +0 -0
mcli/app/logs_cmd.py
CHANGED
|
@@ -16,6 +16,8 @@ from rich.live import Live
|
|
|
16
16
|
from rich.panel import Panel
|
|
17
17
|
from rich.text import Text
|
|
18
18
|
|
|
19
|
+
from mcli.lib.paths import get_logs_dir
|
|
20
|
+
|
|
19
21
|
console = Console()
|
|
20
22
|
|
|
21
23
|
|
|
@@ -25,6 +27,24 @@ def logs_group():
|
|
|
25
27
|
pass
|
|
26
28
|
|
|
27
29
|
|
|
30
|
+
@logs_group.command(name="location")
|
|
31
|
+
def show_location():
|
|
32
|
+
"""Show the location of the logs directory"""
|
|
33
|
+
logs_dir = get_logs_dir()
|
|
34
|
+
console.print(f"📁 [cyan]Logs directory:[/cyan] {logs_dir}")
|
|
35
|
+
console.print(f" [dim]Set MCLI_HOME environment variable to change location[/dim]")
|
|
36
|
+
|
|
37
|
+
# Show if directory exists and has files
|
|
38
|
+
if logs_dir.exists():
|
|
39
|
+
log_files = list(logs_dir.glob("mcli*.log"))
|
|
40
|
+
if log_files:
|
|
41
|
+
console.print(f" [green]✓ {len(log_files)} log file(s) found[/green]")
|
|
42
|
+
else:
|
|
43
|
+
console.print(f" [yellow]⚠ Directory exists but no log files yet[/yellow]")
|
|
44
|
+
else:
|
|
45
|
+
console.print(f" [yellow]⚠ Directory will be created on first use[/yellow]")
|
|
46
|
+
|
|
47
|
+
|
|
28
48
|
@logs_group.command(name="stream")
|
|
29
49
|
@click.option(
|
|
30
50
|
"--type",
|
|
@@ -49,13 +69,7 @@ def stream_logs(type: str, lines: int, follow: bool):
|
|
|
49
69
|
Shows log output with syntax highlighting and real-time updates.
|
|
50
70
|
Similar to 'tail -f' but with enhanced formatting for MCLI logs.
|
|
51
71
|
"""
|
|
52
|
-
logs_dir =
|
|
53
|
-
|
|
54
|
-
if not logs_dir.exists():
|
|
55
|
-
console.print(
|
|
56
|
-
"❌ No logs directory found. Run some MCLI commands to generate logs.", style="red"
|
|
57
|
-
)
|
|
58
|
-
return
|
|
72
|
+
logs_dir = get_logs_dir()
|
|
59
73
|
|
|
60
74
|
# Get today's log files
|
|
61
75
|
today = datetime.now().strftime("%Y%m%d")
|
|
@@ -98,12 +112,7 @@ def stream_logs(type: str, lines: int, follow: bool):
|
|
|
98
112
|
@click.option("--date", "-d", help="Show logs for specific date (YYYYMMDD format)")
|
|
99
113
|
def list_logs(date: Optional[str]):
|
|
100
114
|
"""List available log files"""
|
|
101
|
-
logs_dir =
|
|
102
|
-
|
|
103
|
-
if not logs_dir.exists():
|
|
104
|
-
console.print("❌ No logs directory found", style="red")
|
|
105
|
-
return
|
|
106
|
-
|
|
115
|
+
logs_dir = get_logs_dir()
|
|
107
116
|
_list_available_logs(logs_dir, date)
|
|
108
117
|
|
|
109
118
|
|
|
@@ -113,11 +122,9 @@ def list_logs(date: Optional[str]):
|
|
|
113
122
|
@click.option("--date", "-d", help="Date for log file (YYYYMMDD format, default: today)")
|
|
114
123
|
def tail_logs(log_type: str, lines: int, date: Optional[str]):
|
|
115
124
|
"""Show the last N lines of a specific log file"""
|
|
116
|
-
logs_dir =
|
|
125
|
+
logs_dir = get_logs_dir()
|
|
117
126
|
|
|
118
|
-
|
|
119
|
-
console.print("❌ No logs directory found", style="red")
|
|
120
|
-
return
|
|
127
|
+
# Note: get_logs_dir() creates the directory automatically
|
|
121
128
|
|
|
122
129
|
# Use provided date or default to today
|
|
123
130
|
log_date = date or datetime.now().strftime("%Y%m%d")
|
|
@@ -168,11 +175,7 @@ def tail_logs(log_type: str, lines: int, date: Optional[str]):
|
|
|
168
175
|
)
|
|
169
176
|
def grep_logs(pattern: str, type: str, date: Optional[str], context: int):
|
|
170
177
|
"""Search for patterns in log files"""
|
|
171
|
-
logs_dir =
|
|
172
|
-
|
|
173
|
-
if not logs_dir.exists():
|
|
174
|
-
console.print("❌ No logs directory found", style="red")
|
|
175
|
-
return
|
|
178
|
+
logs_dir = get_logs_dir()
|
|
176
179
|
|
|
177
180
|
# Use provided date or default to today
|
|
178
181
|
log_date = date or datetime.now().strftime("%Y%m%d")
|
|
@@ -216,11 +219,7 @@ def grep_logs(pattern: str, type: str, date: Optional[str], context: int):
|
|
|
216
219
|
@click.option("--confirm", "-y", is_flag=True, help="Skip confirmation prompt")
|
|
217
220
|
def clear_logs(older_than: Optional[int], confirm: bool):
|
|
218
221
|
"""Clear old log files"""
|
|
219
|
-
logs_dir =
|
|
220
|
-
|
|
221
|
-
if not logs_dir.exists():
|
|
222
|
-
console.print("❌ No logs directory found", style="red")
|
|
223
|
-
return
|
|
222
|
+
logs_dir = get_logs_dir()
|
|
224
223
|
|
|
225
224
|
# Find log files
|
|
226
225
|
log_files = list(logs_dir.glob("mcli*.log"))
|
mcli/lib/logger/logger.py
CHANGED
|
@@ -208,13 +208,11 @@ class McliLogger:
|
|
|
208
208
|
|
|
209
209
|
# Set up file handler with path resolution
|
|
210
210
|
try:
|
|
211
|
-
#
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
#
|
|
215
|
-
|
|
216
|
-
log_dir = project_root / "logs"
|
|
217
|
-
log_dir.mkdir(exist_ok=True)
|
|
211
|
+
# Import paths utility for consistent path resolution
|
|
212
|
+
from mcli.lib.paths import get_logs_dir
|
|
213
|
+
|
|
214
|
+
# Get logs directory (e.g., ~/.mcli/logs)
|
|
215
|
+
log_dir = get_logs_dir()
|
|
218
216
|
|
|
219
217
|
# Create daily log file
|
|
220
218
|
timestamp = datetime.now().strftime("%Y%m%d")
|
mcli/lib/paths.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Path resolution utilities for mcli
|
|
3
|
+
|
|
4
|
+
Provides consistent path resolution for logs, config, and data directories
|
|
5
|
+
that work both when running from source and when installed as a package.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from typing import Optional
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def get_mcli_home() -> Path:
|
|
14
|
+
"""
|
|
15
|
+
Get the mcli home directory for storing logs, config, and data.
|
|
16
|
+
|
|
17
|
+
Returns:
|
|
18
|
+
Path to ~/.mcli directory, created if it doesn't exist
|
|
19
|
+
"""
|
|
20
|
+
# Check for MCLI_HOME environment variable first
|
|
21
|
+
mcli_home = os.getenv("MCLI_HOME")
|
|
22
|
+
if mcli_home:
|
|
23
|
+
path = Path(mcli_home)
|
|
24
|
+
else:
|
|
25
|
+
# Use XDG_DATA_HOME if set, otherwise default to ~/.mcli
|
|
26
|
+
xdg_data_home = os.getenv("XDG_DATA_HOME")
|
|
27
|
+
if xdg_data_home:
|
|
28
|
+
path = Path(xdg_data_home) / "mcli"
|
|
29
|
+
else:
|
|
30
|
+
path = Path.home() / ".mcli"
|
|
31
|
+
|
|
32
|
+
# Create directory if it doesn't exist
|
|
33
|
+
path.mkdir(parents=True, exist_ok=True)
|
|
34
|
+
return path
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def get_logs_dir() -> Path:
|
|
38
|
+
"""
|
|
39
|
+
Get the logs directory for mcli.
|
|
40
|
+
|
|
41
|
+
Returns:
|
|
42
|
+
Path to logs directory (e.g., ~/.mcli/logs), created if it doesn't exist
|
|
43
|
+
"""
|
|
44
|
+
logs_dir = get_mcli_home() / "logs"
|
|
45
|
+
logs_dir.mkdir(parents=True, exist_ok=True)
|
|
46
|
+
return logs_dir
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def get_config_dir() -> Path:
|
|
50
|
+
"""
|
|
51
|
+
Get the config directory for mcli.
|
|
52
|
+
|
|
53
|
+
Returns:
|
|
54
|
+
Path to config directory (e.g., ~/.mcli/config), created if it doesn't exist
|
|
55
|
+
"""
|
|
56
|
+
config_dir = get_mcli_home() / "config"
|
|
57
|
+
config_dir.mkdir(parents=True, exist_ok=True)
|
|
58
|
+
return config_dir
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def get_data_dir() -> Path:
|
|
62
|
+
"""
|
|
63
|
+
Get the data directory for mcli.
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
Path to data directory (e.g., ~/.mcli/data), created if it doesn't exist
|
|
67
|
+
"""
|
|
68
|
+
data_dir = get_mcli_home() / "data"
|
|
69
|
+
data_dir.mkdir(parents=True, exist_ok=True)
|
|
70
|
+
return data_dir
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def get_cache_dir() -> Path:
|
|
74
|
+
"""
|
|
75
|
+
Get the cache directory for mcli.
|
|
76
|
+
|
|
77
|
+
Returns:
|
|
78
|
+
Path to cache directory (e.g., ~/.mcli/cache), created if it doesn't exist
|
|
79
|
+
"""
|
|
80
|
+
cache_dir = get_mcli_home() / "cache"
|
|
81
|
+
cache_dir.mkdir(parents=True, exist_ok=True)
|
|
82
|
+
return cache_dir
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mcli-framework
|
|
3
|
-
Version: 7.0.
|
|
3
|
+
Version: 7.0.1
|
|
4
4
|
Summary: 🚀 High-performance CLI framework with Rust extensions, AI chat, and stunning visuals
|
|
5
5
|
Author-email: Luis Fernandez de la Vara <luis@lefv.io>
|
|
6
6
|
Maintainer-email: Luis Fernandez de la Vara <luis@lefv.io>
|
|
@@ -5,7 +5,7 @@ mcli/app/commands_cmd.py,sha256=5MccxYKNkzIisDeBPJj6K4ZwWeZFB2a4P8AS9B1_EDs,8441
|
|
|
5
5
|
mcli/app/completion_cmd.py,sha256=8gtYDddviBCD6Gk57lkLKOpim5QAMMcugYPmwfraBeo,7862
|
|
6
6
|
mcli/app/completion_helpers.py,sha256=GJvkxJ5lU_Gh4K35Q275QW1fN39poasyYjDO5-5kxM0,8809
|
|
7
7
|
mcli/app/cron_test_cmd.py,sha256=Ai4Smg2WxULeiMD5s2m_S_fXdMAAQsKHpSc4iJGSnwI,26156
|
|
8
|
-
mcli/app/logs_cmd.py,sha256=
|
|
8
|
+
mcli/app/logs_cmd.py,sha256=xkGjUiuV1a1-2j8rkffp0OwnG9nS39-i2jpCnKUn9f0,13777
|
|
9
9
|
mcli/app/main.py,sha256=iA9HdqhBaOnOJ2--edLPD7iAatAzhIl5NAcNhw9qJAw,19010
|
|
10
10
|
mcli/app/model_cmd.py,sha256=wRs2xfDbWrdzmVH1hbHr8jypucNUKpXvNdYJAlvk5xc,8153
|
|
11
11
|
mcli/app/redis_cmd.py,sha256=Cl0LQ3Mqt27gLeb542_xw6bJBbIE-CBmWyMmaUTSk8c,9426
|
|
@@ -18,6 +18,7 @@ mcli/chat/enhanced_chat.py,sha256=e3odh5klewDHIjfNOyvifLzCdHrysDc2IvNVHzTPIh4,27
|
|
|
18
18
|
mcli/chat/system_controller.py,sha256=SuGvnIh2QObvM1DMicF3gGyeBkbz_xXS-hOOHjWx5j4,39114
|
|
19
19
|
mcli/chat/system_integration.py,sha256=xQ11thOUswPg8r1HZkId6U3bTCOtMYngt0-mUYYXpt4,40196
|
|
20
20
|
mcli/lib/lib.py,sha256=mlp2INx-UKTOECcA7Kens9yNt2gJi7GbKWFmf4cxj0c,632
|
|
21
|
+
mcli/lib/paths.py,sha256=Pz-4FfVlHxuXsYa4_3hAEk4LzFCBoEoOsxmbzvJtmaI,2116
|
|
21
22
|
mcli/lib/api/api.py,sha256=sPgAIYC8Z7AWV2TCBssNSKotbRggBqNLsbfzbjkhmUY,18558
|
|
22
23
|
mcli/lib/api/daemon_client.py,sha256=Nq8sVvNKyIGvWp9G_O3NEFo9JDqA1TEx5FOB7iqslB4,7415
|
|
23
24
|
mcli/lib/api/daemon_client_local.py,sha256=cki6-ErWtyVRk12BYB5hFZMGc8HisHFze_vRNlydnOI,1749
|
|
@@ -39,7 +40,7 @@ mcli/lib/erd/erd.py,sha256=zr9C6RPaCPX2qDJqOe2VA5pfTL5UF3Kj5M8BLFnNrUc,51843
|
|
|
39
40
|
mcli/lib/erd/generate_graph.py,sha256=wpSZpn2W9zQ6XaLBjq_2AJv20Sol-L1if92quypp7Ac,15596
|
|
40
41
|
mcli/lib/files/files.py,sha256=8z87uR1nOaTXtn7ExdKZMGgaHpk6cR9FJ1JvuYV2qJw,2538
|
|
41
42
|
mcli/lib/fs/fs.py,sha256=b-u6t3hps-XpKOndhsnNE5tVFATwuxpdD_oilpfwAe4,2823
|
|
42
|
-
mcli/lib/logger/logger.py,sha256=
|
|
43
|
+
mcli/lib/logger/logger.py,sha256=FdQBknaMqaqf1KP25lspvmIvMd_S6QLGjf8ZPPQ0ukI,24388
|
|
43
44
|
mcli/lib/performance/optimizer.py,sha256=erOp0shbvE7obM5-ljj3Fgz8S4ws9UghslFNSi34Qh0,14938
|
|
44
45
|
mcli/lib/performance/rust_bridge.py,sha256=y_8WLvWkDbHAT06ma_qwaGDDS8d0oJNOj4tj5P_yxuE,16744
|
|
45
46
|
mcli/lib/performance/uvloop_config.py,sha256=wyI5pQnec2RAhgm52HJ1AxYGFa3bjTa-CjhOqB2Oucc,4736
|
|
@@ -178,9 +179,9 @@ mcli/workflow/sync/sync_cmd.py,sha256=S8TuZS_WAsdeD3_j8-XSAZFFrpynAwTWnCC0e6DCLh
|
|
|
178
179
|
mcli/workflow/sync/test_cmd.py,sha256=neVgs9zEnKSxlvzDpFkuCGucqnzjrShm2OvJtHibslg,10009
|
|
179
180
|
mcli/workflow/videos/videos.py,sha256=C47ViVv6qqqkSKQz6YXjzhok4UrqFbya8w5k_x7hToM,8360
|
|
180
181
|
mcli/workflow/wakatime/wakatime.py,sha256=sEjsUKa3-XyE8Ni6sAb_D3GAY5jDcA30KknW9YTbLTA,142
|
|
181
|
-
mcli_framework-7.0.
|
|
182
|
-
mcli_framework-7.0.
|
|
183
|
-
mcli_framework-7.0.
|
|
184
|
-
mcli_framework-7.0.
|
|
185
|
-
mcli_framework-7.0.
|
|
186
|
-
mcli_framework-7.0.
|
|
182
|
+
mcli_framework-7.0.1.dist-info/licenses/LICENSE,sha256=sahwAMfrJv2-V66HNPTp7A9UmMjxtyejwTZZoWQvEcI,1075
|
|
183
|
+
mcli_framework-7.0.1.dist-info/METADATA,sha256=Yu0uL04t1BERVyyqaab5dYVbUzNW21VRd5HTnK3u8wU,14307
|
|
184
|
+
mcli_framework-7.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
185
|
+
mcli_framework-7.0.1.dist-info/entry_points.txt,sha256=dYrZbDIm-KUPsl1wfv600Kx_8sMy89phMkCihbDRgP8,261
|
|
186
|
+
mcli_framework-7.0.1.dist-info/top_level.txt,sha256=_bnO8J2EUkliWivey_1le0UrnocFKmyVMQjbQ8iVXjc,5
|
|
187
|
+
mcli_framework-7.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|