Skip to content

Commit 633f4c0

Browse files
committed
feat(cli): expose 'daemon monitor' command to users
1 parent 98a05ce commit 633f4c0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/omnipkg/cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,8 @@ def create_parser():
557557
daemon_logs = daemon_subparsers.add_parser('logs', help=_('View or follow daemon logs'))
558558
daemon_logs.add_argument('-f', '--follow', action='store_true', help=_('Output appended data as the file grows'))
559559
daemon_logs.add_argument('-n', '--lines', type=int, default=50, help=_('Output the last N lines'))
560+
daemon_monitor = daemon_subparsers.add_parser('monitor', help=_('Live resource usage dashboard (TUI)'))
561+
daemon_monitor.add_argument('-w', '--watch', action='store_true', help=_('Auto-refresh mode (dashboard style)'))
560562
prune_parser = subparsers.add_parser('prune', help=_('Clean up old, bubbled package versions'))
561563
prune_parser.add_argument('package', help=_('Package whose bubbles to prune'))
562564
prune_parser.add_argument('--keep-latest', type=int, metavar='N', help=_('Keep N most recent bubbled versions'))
@@ -1003,6 +1005,13 @@ def main():
10031005
cli_status()
10041006
elif args.daemon_command == 'logs':
10051007
cli_logs(follow=args.follow, tail_lines=args.lines)
1008+
elif args.daemon_command == 'monitor':
1009+
try:
1010+
from omnipkg.isolation.resource_monitor import start_monitor
1011+
start_monitor(watch_mode=args.watch)
1012+
except ImportError:
1013+
safe_print(_("❌ Error: resource_monitor module not found."))
1014+
return 1
10061015
return
10071016
elif args.command == 'run':
10081017
# ✅ Fix: Pass the pkg_instance we already initialized!

0 commit comments

Comments
 (0)