bt-cli 0.4.13__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.
Files changed (121) hide show
  1. bt_cli/__init__.py +3 -0
  2. bt_cli/cli.py +830 -0
  3. bt_cli/commands/__init__.py +1 -0
  4. bt_cli/commands/configure.py +415 -0
  5. bt_cli/commands/learn.py +229 -0
  6. bt_cli/commands/quick.py +784 -0
  7. bt_cli/core/__init__.py +1 -0
  8. bt_cli/core/auth.py +213 -0
  9. bt_cli/core/client.py +313 -0
  10. bt_cli/core/config.py +393 -0
  11. bt_cli/core/config_file.py +420 -0
  12. bt_cli/core/csv_utils.py +91 -0
  13. bt_cli/core/errors.py +247 -0
  14. bt_cli/core/output.py +205 -0
  15. bt_cli/core/prompts.py +87 -0
  16. bt_cli/core/rest_debug.py +221 -0
  17. bt_cli/data/CLAUDE.md +94 -0
  18. bt_cli/data/__init__.py +0 -0
  19. bt_cli/data/skills/bt/SKILL.md +108 -0
  20. bt_cli/data/skills/entitle/SKILL.md +170 -0
  21. bt_cli/data/skills/epmw/SKILL.md +144 -0
  22. bt_cli/data/skills/pra/SKILL.md +150 -0
  23. bt_cli/data/skills/pws/SKILL.md +198 -0
  24. bt_cli/entitle/__init__.py +1 -0
  25. bt_cli/entitle/client/__init__.py +5 -0
  26. bt_cli/entitle/client/base.py +443 -0
  27. bt_cli/entitle/commands/__init__.py +24 -0
  28. bt_cli/entitle/commands/accounts.py +53 -0
  29. bt_cli/entitle/commands/applications.py +39 -0
  30. bt_cli/entitle/commands/auth.py +68 -0
  31. bt_cli/entitle/commands/bundles.py +218 -0
  32. bt_cli/entitle/commands/integrations.py +60 -0
  33. bt_cli/entitle/commands/permissions.py +70 -0
  34. bt_cli/entitle/commands/policies.py +97 -0
  35. bt_cli/entitle/commands/resources.py +131 -0
  36. bt_cli/entitle/commands/roles.py +74 -0
  37. bt_cli/entitle/commands/users.py +123 -0
  38. bt_cli/entitle/commands/workflows.py +187 -0
  39. bt_cli/entitle/models/__init__.py +31 -0
  40. bt_cli/entitle/models/bundle.py +28 -0
  41. bt_cli/entitle/models/common.py +37 -0
  42. bt_cli/entitle/models/integration.py +30 -0
  43. bt_cli/entitle/models/permission.py +27 -0
  44. bt_cli/entitle/models/policy.py +25 -0
  45. bt_cli/entitle/models/resource.py +29 -0
  46. bt_cli/entitle/models/role.py +28 -0
  47. bt_cli/entitle/models/user.py +24 -0
  48. bt_cli/entitle/models/workflow.py +55 -0
  49. bt_cli/epmw/__init__.py +1 -0
  50. bt_cli/epmw/client/__init__.py +5 -0
  51. bt_cli/epmw/client/base.py +848 -0
  52. bt_cli/epmw/commands/__init__.py +33 -0
  53. bt_cli/epmw/commands/audits.py +250 -0
  54. bt_cli/epmw/commands/auth.py +55 -0
  55. bt_cli/epmw/commands/computers.py +140 -0
  56. bt_cli/epmw/commands/events.py +233 -0
  57. bt_cli/epmw/commands/groups.py +215 -0
  58. bt_cli/epmw/commands/policies.py +673 -0
  59. bt_cli/epmw/commands/quick.py +348 -0
  60. bt_cli/epmw/commands/requests.py +224 -0
  61. bt_cli/epmw/commands/roles.py +78 -0
  62. bt_cli/epmw/commands/tasks.py +38 -0
  63. bt_cli/epmw/commands/users.py +219 -0
  64. bt_cli/epmw/models/__init__.py +1 -0
  65. bt_cli/pra/__init__.py +1 -0
  66. bt_cli/pra/client/__init__.py +5 -0
  67. bt_cli/pra/client/base.py +618 -0
  68. bt_cli/pra/commands/__init__.py +30 -0
  69. bt_cli/pra/commands/auth.py +55 -0
  70. bt_cli/pra/commands/import_export.py +442 -0
  71. bt_cli/pra/commands/jump_clients.py +139 -0
  72. bt_cli/pra/commands/jump_groups.py +146 -0
  73. bt_cli/pra/commands/jump_items.py +638 -0
  74. bt_cli/pra/commands/jumpoints.py +95 -0
  75. bt_cli/pra/commands/policies.py +197 -0
  76. bt_cli/pra/commands/quick.py +470 -0
  77. bt_cli/pra/commands/teams.py +81 -0
  78. bt_cli/pra/commands/users.py +87 -0
  79. bt_cli/pra/commands/vault.py +564 -0
  80. bt_cli/pra/models/__init__.py +27 -0
  81. bt_cli/pra/models/common.py +12 -0
  82. bt_cli/pra/models/jump_client.py +25 -0
  83. bt_cli/pra/models/jump_group.py +15 -0
  84. bt_cli/pra/models/jump_item.py +72 -0
  85. bt_cli/pra/models/jumpoint.py +19 -0
  86. bt_cli/pra/models/team.py +14 -0
  87. bt_cli/pra/models/user.py +17 -0
  88. bt_cli/pra/models/vault.py +45 -0
  89. bt_cli/pws/__init__.py +1 -0
  90. bt_cli/pws/client/__init__.py +5 -0
  91. bt_cli/pws/client/base.py +356 -0
  92. bt_cli/pws/client/beyondinsight.py +869 -0
  93. bt_cli/pws/client/passwordsafe.py +1786 -0
  94. bt_cli/pws/commands/__init__.py +33 -0
  95. bt_cli/pws/commands/accounts.py +372 -0
  96. bt_cli/pws/commands/assets.py +311 -0
  97. bt_cli/pws/commands/auth.py +166 -0
  98. bt_cli/pws/commands/clouds.py +221 -0
  99. bt_cli/pws/commands/config.py +344 -0
  100. bt_cli/pws/commands/credentials.py +347 -0
  101. bt_cli/pws/commands/databases.py +306 -0
  102. bt_cli/pws/commands/directories.py +199 -0
  103. bt_cli/pws/commands/functional.py +298 -0
  104. bt_cli/pws/commands/import_export.py +452 -0
  105. bt_cli/pws/commands/platforms.py +118 -0
  106. bt_cli/pws/commands/quick.py +1646 -0
  107. bt_cli/pws/commands/search.py +256 -0
  108. bt_cli/pws/commands/secrets.py +1343 -0
  109. bt_cli/pws/commands/systems.py +389 -0
  110. bt_cli/pws/commands/users.py +415 -0
  111. bt_cli/pws/commands/workgroups.py +166 -0
  112. bt_cli/pws/config.py +18 -0
  113. bt_cli/pws/models/__init__.py +19 -0
  114. bt_cli/pws/models/account.py +186 -0
  115. bt_cli/pws/models/asset.py +102 -0
  116. bt_cli/pws/models/common.py +132 -0
  117. bt_cli/pws/models/system.py +121 -0
  118. bt_cli-0.4.13.dist-info/METADATA +417 -0
  119. bt_cli-0.4.13.dist-info/RECORD +121 -0
  120. bt_cli-0.4.13.dist-info/WHEEL +4 -0
  121. bt_cli-0.4.13.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,146 @@
1
+ """Jump Group commands."""
2
+
3
+ from typing import Optional
4
+
5
+ import httpx
6
+ import typer
7
+
8
+ from bt_cli.core.output import OutputFormat, print_table, print_json, print_error, print_api_error
9
+
10
+ app = typer.Typer(no_args_is_help=True)
11
+
12
+
13
+ @app.command("list")
14
+ def list_jump_groups(
15
+ output: OutputFormat = typer.Option(
16
+ OutputFormat.TABLE, "--output", "-o", help="Output format"
17
+ ),
18
+ ):
19
+ """List all Jump Groups."""
20
+ from bt_cli.pra.client import get_client
21
+
22
+ try:
23
+ client = get_client()
24
+ groups = client.list_jump_groups()
25
+
26
+ if output == OutputFormat.JSON:
27
+ print_json(groups)
28
+ else:
29
+ columns = [
30
+ ("ID", "id"),
31
+ ("Name", "name"),
32
+ ("Code Name", "code_name"),
33
+ ("Comments", "comments"),
34
+ ]
35
+ print_table(groups, columns, title="Jump Groups")
36
+ except httpx.HTTPStatusError as e:
37
+ print_api_error(e, "list jump groups")
38
+ raise typer.Exit(1)
39
+ except httpx.RequestError as e:
40
+ print_api_error(e, "list jump groups")
41
+ raise typer.Exit(1)
42
+ except Exception as e:
43
+ print_api_error(e, "list jump groups")
44
+ raise typer.Exit(1)
45
+
46
+
47
+ @app.command("get")
48
+ def get_jump_group(
49
+ group_id: int = typer.Argument(..., help="Jump Group ID"),
50
+ output: OutputFormat = typer.Option(
51
+ OutputFormat.TABLE, "--output", "-o", help="Output format"
52
+ ),
53
+ ):
54
+ """Get Jump Group details."""
55
+ from bt_cli.pra.client import get_client
56
+ from rich.console import Console
57
+ from rich.panel import Panel
58
+
59
+ console = Console()
60
+
61
+ try:
62
+ client = get_client()
63
+ group = client.get_jump_group(group_id)
64
+
65
+ if output == OutputFormat.JSON:
66
+ print_json(group)
67
+ else:
68
+ name = group.get("name", "")
69
+ code_name = group.get("code_name", "")
70
+ comments = group.get("comments", "") or "-"
71
+
72
+ console.print(Panel(
73
+ f"[bold]{name}[/bold]\n\n"
74
+ f"[dim]Code Name:[/dim] {code_name}\n"
75
+ f"[dim]Comments:[/dim] {comments}",
76
+ title="Jump Group Details",
77
+ subtitle=f"ID: {group.get('id', '')}",
78
+ ))
79
+ except httpx.HTTPStatusError as e:
80
+ print_api_error(e, "get jump group")
81
+ raise typer.Exit(1)
82
+ except httpx.RequestError as e:
83
+ print_api_error(e, "get jump group")
84
+ raise typer.Exit(1)
85
+ except Exception as e:
86
+ print_api_error(e, "get jump group")
87
+ raise typer.Exit(1)
88
+
89
+
90
+ @app.command("create")
91
+ def create_jump_group(
92
+ name: str = typer.Option(..., "--name", "-n", help="Display name for the jump group"),
93
+ code_name: str = typer.Option(..., "--code-name", "-c", help="Short code name (lowercase, underscores)"),
94
+ comments: Optional[str] = typer.Option(None, "--comments", help="Description/comments"),
95
+ output: OutputFormat = typer.Option(
96
+ OutputFormat.JSON, "--output", "-o", help="Output format"
97
+ ),
98
+ ):
99
+ """Create a new Jump Group.
100
+
101
+ Example:
102
+ bt pra jump-groups create --name "Customer-05 (Bing7)" --code-name bing7 --comments "Bing7 Technologies"
103
+ """
104
+ from bt_cli.pra.client import get_client
105
+
106
+ try:
107
+ client = get_client()
108
+ group = client.create_jump_group(name=name, code_name=code_name, comments=comments)
109
+
110
+ typer.echo(f"Created jump group: {group['name']} (ID: {group['id']})")
111
+ if output == OutputFormat.JSON:
112
+ print_json(group)
113
+ except httpx.HTTPStatusError as e:
114
+ print_api_error(e, "create jump group")
115
+ raise typer.Exit(1)
116
+ except httpx.RequestError as e:
117
+ print_api_error(e, "create jump group")
118
+ raise typer.Exit(1)
119
+ except Exception as e:
120
+ print_api_error(e, "create jump group")
121
+ raise typer.Exit(1)
122
+
123
+
124
+ @app.command("delete")
125
+ def delete_jump_group(
126
+ group_id: int = typer.Argument(..., help="Jump Group ID"),
127
+ ):
128
+ """Delete a Jump Group.
129
+
130
+ Note: Jump group must be empty (no jump items) before deletion.
131
+ """
132
+ from bt_cli.pra.client import get_client
133
+
134
+ try:
135
+ client = get_client()
136
+ client.delete_jump_group(group_id)
137
+ typer.echo(f"Deleted jump group: {group_id}")
138
+ except httpx.HTTPStatusError as e:
139
+ print_api_error(e, "delete jump group")
140
+ raise typer.Exit(1)
141
+ except httpx.RequestError as e:
142
+ print_api_error(e, "delete jump group")
143
+ raise typer.Exit(1)
144
+ except Exception as e:
145
+ print_api_error(e, "delete jump group")
146
+ raise typer.Exit(1)