agent-cli-helper 0.2.3__tar.gz → 0.2.4__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.
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/PKG-INFO +1 -1
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/agent_cli_helper.egg-info/PKG-INFO +1 -1
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/cli_tool/main.py +10 -12
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/cli_tool/manage.py +5 -12
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/pyproject.toml +1 -1
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/tests/test_cli_tool.py +18 -0
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/LICENSE.MIT +0 -0
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/README.md +0 -0
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/agent_cli_helper.egg-info/SOURCES.txt +0 -0
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/agent_cli_helper.egg-info/dependency_links.txt +0 -0
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/agent_cli_helper.egg-info/entry_points.txt +0 -0
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/agent_cli_helper.egg-info/top_level.txt +0 -0
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/cli_tool/__init__.py +0 -0
- {agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/setup.cfg +0 -0
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
cli-
|
|
7
|
-
cli-
|
|
8
|
-
cli-tool process-info <id> # Get process info for a session
|
|
9
|
-
cli-tool kill-all-tools # Kill all sessions
|
|
10
|
-
cli-tool --global # View all sessions globally
|
|
3
|
+
Examples:
|
|
4
|
+
agent-cli-helper run-command <cmd> # Run a program in a session
|
|
5
|
+
agent-cli-helper send-keystrokes <id> <keys> # Send keystrokes to a session
|
|
6
|
+
agent-cli-helper process-info <id> # Get process info for a session
|
|
7
|
+
agent-cli-helper kill-all-tools # Kill all sessions
|
|
11
8
|
"""
|
|
12
9
|
|
|
13
10
|
import argparse
|
|
@@ -825,9 +822,10 @@ def main():
|
|
|
825
822
|
|
|
826
823
|
args = parser.parse_args()
|
|
827
824
|
|
|
828
|
-
#
|
|
829
|
-
if args.
|
|
830
|
-
|
|
825
|
+
# If no command is provided, print help and exit with 1
|
|
826
|
+
if not args.command:
|
|
827
|
+
parser.print_help()
|
|
828
|
+
sys.exit(1)
|
|
831
829
|
|
|
832
830
|
# Dispatch to appropriate command handler
|
|
833
831
|
if args.command == 'run-command':
|
|
@@ -852,4 +850,4 @@ def main():
|
|
|
852
850
|
|
|
853
851
|
|
|
854
852
|
if __name__ == '__main__':
|
|
855
|
-
sys.exit(main())
|
|
853
|
+
sys.exit(main())
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
A human-facing tool to view and manage all agent-cli-helper sessions across
|
|
6
|
-
different namespaces (harnesses). Shows liveness of parent processes,
|
|
7
|
-
session tree, and supports glob patterns for operations.
|
|
8
|
-
|
|
9
|
-
Examples:
|
|
10
|
-
acli-manage # Show tree of all sessions
|
|
11
|
-
acli-manage kill "<pattern>" # Kill sessions matching pattern
|
|
3
|
+
Manage agent-cli-helper sessions across different namespaces.
|
|
12
4
|
"""
|
|
13
5
|
|
|
14
6
|
import argparse
|
|
@@ -17,6 +9,7 @@ import os
|
|
|
17
9
|
import subprocess
|
|
18
10
|
import sys
|
|
19
11
|
import time
|
|
12
|
+
from importlib.metadata import version
|
|
20
13
|
from pathlib import Path
|
|
21
14
|
from typing import Dict, List, Optional, Tuple
|
|
22
15
|
|
|
@@ -263,10 +256,10 @@ def kill_matching_sessions(pattern: str, verbose: bool = False) -> int:
|
|
|
263
256
|
def main():
|
|
264
257
|
"""Main entry point for acli-manage."""
|
|
265
258
|
parser = argparse.ArgumentParser(
|
|
266
|
-
description='
|
|
267
|
-
formatter_class=argparse.RawDescriptionHelpFormatter
|
|
268
|
-
epilog=__doc__
|
|
259
|
+
description='View and manage agent-cli-helper sessions.',
|
|
260
|
+
formatter_class=argparse.RawDescriptionHelpFormatter
|
|
269
261
|
)
|
|
262
|
+
parser.add_argument('--version', action='version', version=f'%(prog)s {version("agent-cli-helper")}')
|
|
270
263
|
|
|
271
264
|
subparsers = parser.add_subparsers(dest='command', help='Available commands')
|
|
272
265
|
|
|
@@ -40,6 +40,24 @@ class TestGenerateSessionId:
|
|
|
40
40
|
assert "session" in session_id.lower()
|
|
41
41
|
|
|
42
42
|
|
|
43
|
+
class TestCLIArgs:
|
|
44
|
+
"""Tests for CLI argument parsing."""
|
|
45
|
+
|
|
46
|
+
def test_no_arguments_exits_with_error(self):
|
|
47
|
+
"""Running the CLI without arguments should print help and return exit code 1."""
|
|
48
|
+
from cli_tool.main import main
|
|
49
|
+
# We need to mock sys.argv because main() calls parser.parse_args() which reads it.
|
|
50
|
+
import sys
|
|
51
|
+
old_argv = sys.argv
|
|
52
|
+
sys.argv = ["agent-cli-helper"]
|
|
53
|
+
try:
|
|
54
|
+
with pytest.raises(SystemExit) as excinfo:
|
|
55
|
+
main()
|
|
56
|
+
assert excinfo.value.code == 1
|
|
57
|
+
finally:
|
|
58
|
+
sys.argv = old_argv
|
|
59
|
+
|
|
60
|
+
|
|
43
61
|
class TestParseKeystrokes:
|
|
44
62
|
"""Tests for parse_keystrokes function."""
|
|
45
63
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/agent_cli_helper.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{agent_cli_helper-0.2.3 → agent_cli_helper-0.2.4}/agent_cli_helper.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|