scc-cli 1.5.3__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 scc-cli might be problematic. Click here for more details.

Files changed (153) hide show
  1. scc_cli/__init__.py +15 -0
  2. scc_cli/audit/__init__.py +37 -0
  3. scc_cli/audit/parser.py +191 -0
  4. scc_cli/audit/reader.py +180 -0
  5. scc_cli/auth.py +145 -0
  6. scc_cli/claude_adapter.py +485 -0
  7. scc_cli/cli.py +311 -0
  8. scc_cli/cli_common.py +190 -0
  9. scc_cli/cli_helpers.py +244 -0
  10. scc_cli/commands/__init__.py +20 -0
  11. scc_cli/commands/admin.py +708 -0
  12. scc_cli/commands/audit.py +246 -0
  13. scc_cli/commands/config.py +528 -0
  14. scc_cli/commands/exceptions.py +696 -0
  15. scc_cli/commands/init.py +272 -0
  16. scc_cli/commands/launch/__init__.py +73 -0
  17. scc_cli/commands/launch/app.py +1247 -0
  18. scc_cli/commands/launch/render.py +309 -0
  19. scc_cli/commands/launch/sandbox.py +135 -0
  20. scc_cli/commands/launch/workspace.py +339 -0
  21. scc_cli/commands/org/__init__.py +49 -0
  22. scc_cli/commands/org/_builders.py +264 -0
  23. scc_cli/commands/org/app.py +41 -0
  24. scc_cli/commands/org/import_cmd.py +267 -0
  25. scc_cli/commands/org/init_cmd.py +269 -0
  26. scc_cli/commands/org/schema_cmd.py +76 -0
  27. scc_cli/commands/org/status_cmd.py +157 -0
  28. scc_cli/commands/org/update_cmd.py +330 -0
  29. scc_cli/commands/org/validate_cmd.py +138 -0
  30. scc_cli/commands/support.py +323 -0
  31. scc_cli/commands/team.py +910 -0
  32. scc_cli/commands/worktree/__init__.py +72 -0
  33. scc_cli/commands/worktree/_helpers.py +57 -0
  34. scc_cli/commands/worktree/app.py +170 -0
  35. scc_cli/commands/worktree/container_commands.py +385 -0
  36. scc_cli/commands/worktree/context_commands.py +61 -0
  37. scc_cli/commands/worktree/session_commands.py +128 -0
  38. scc_cli/commands/worktree/worktree_commands.py +734 -0
  39. scc_cli/config.py +647 -0
  40. scc_cli/confirm.py +20 -0
  41. scc_cli/console.py +562 -0
  42. scc_cli/contexts.py +394 -0
  43. scc_cli/core/__init__.py +68 -0
  44. scc_cli/core/constants.py +101 -0
  45. scc_cli/core/errors.py +297 -0
  46. scc_cli/core/exit_codes.py +91 -0
  47. scc_cli/core/workspace.py +57 -0
  48. scc_cli/deprecation.py +54 -0
  49. scc_cli/deps.py +189 -0
  50. scc_cli/docker/__init__.py +127 -0
  51. scc_cli/docker/core.py +467 -0
  52. scc_cli/docker/credentials.py +726 -0
  53. scc_cli/docker/launch.py +595 -0
  54. scc_cli/doctor/__init__.py +105 -0
  55. scc_cli/doctor/checks/__init__.py +166 -0
  56. scc_cli/doctor/checks/cache.py +314 -0
  57. scc_cli/doctor/checks/config.py +107 -0
  58. scc_cli/doctor/checks/environment.py +182 -0
  59. scc_cli/doctor/checks/json_helpers.py +157 -0
  60. scc_cli/doctor/checks/organization.py +264 -0
  61. scc_cli/doctor/checks/worktree.py +278 -0
  62. scc_cli/doctor/render.py +365 -0
  63. scc_cli/doctor/types.py +66 -0
  64. scc_cli/evaluation/__init__.py +27 -0
  65. scc_cli/evaluation/apply_exceptions.py +207 -0
  66. scc_cli/evaluation/evaluate.py +97 -0
  67. scc_cli/evaluation/models.py +80 -0
  68. scc_cli/git.py +84 -0
  69. scc_cli/json_command.py +166 -0
  70. scc_cli/json_output.py +159 -0
  71. scc_cli/kinds.py +65 -0
  72. scc_cli/marketplace/__init__.py +123 -0
  73. scc_cli/marketplace/adapter.py +74 -0
  74. scc_cli/marketplace/compute.py +377 -0
  75. scc_cli/marketplace/constants.py +87 -0
  76. scc_cli/marketplace/managed.py +135 -0
  77. scc_cli/marketplace/materialize.py +846 -0
  78. scc_cli/marketplace/normalize.py +548 -0
  79. scc_cli/marketplace/render.py +281 -0
  80. scc_cli/marketplace/resolve.py +459 -0
  81. scc_cli/marketplace/schema.py +506 -0
  82. scc_cli/marketplace/sync.py +279 -0
  83. scc_cli/marketplace/team_cache.py +195 -0
  84. scc_cli/marketplace/team_fetch.py +689 -0
  85. scc_cli/marketplace/trust.py +244 -0
  86. scc_cli/models/__init__.py +41 -0
  87. scc_cli/models/exceptions.py +273 -0
  88. scc_cli/models/plugin_audit.py +434 -0
  89. scc_cli/org_templates.py +269 -0
  90. scc_cli/output_mode.py +167 -0
  91. scc_cli/panels.py +113 -0
  92. scc_cli/platform.py +350 -0
  93. scc_cli/profiles.py +960 -0
  94. scc_cli/remote.py +443 -0
  95. scc_cli/schemas/__init__.py +1 -0
  96. scc_cli/schemas/org-v1.schema.json +456 -0
  97. scc_cli/schemas/team-config.v1.schema.json +163 -0
  98. scc_cli/services/__init__.py +1 -0
  99. scc_cli/services/git/__init__.py +79 -0
  100. scc_cli/services/git/branch.py +151 -0
  101. scc_cli/services/git/core.py +216 -0
  102. scc_cli/services/git/hooks.py +108 -0
  103. scc_cli/services/git/worktree.py +444 -0
  104. scc_cli/services/workspace/__init__.py +36 -0
  105. scc_cli/services/workspace/resolver.py +223 -0
  106. scc_cli/services/workspace/suspicious.py +200 -0
  107. scc_cli/sessions.py +425 -0
  108. scc_cli/setup.py +589 -0
  109. scc_cli/source_resolver.py +470 -0
  110. scc_cli/stats.py +378 -0
  111. scc_cli/stores/__init__.py +13 -0
  112. scc_cli/stores/exception_store.py +251 -0
  113. scc_cli/subprocess_utils.py +88 -0
  114. scc_cli/teams.py +383 -0
  115. scc_cli/templates/__init__.py +2 -0
  116. scc_cli/templates/org/__init__.py +0 -0
  117. scc_cli/templates/org/minimal.json +19 -0
  118. scc_cli/templates/org/reference.json +74 -0
  119. scc_cli/templates/org/strict.json +38 -0
  120. scc_cli/templates/org/teams.json +42 -0
  121. scc_cli/templates/statusline.sh +75 -0
  122. scc_cli/theme.py +348 -0
  123. scc_cli/ui/__init__.py +154 -0
  124. scc_cli/ui/branding.py +68 -0
  125. scc_cli/ui/chrome.py +401 -0
  126. scc_cli/ui/dashboard/__init__.py +62 -0
  127. scc_cli/ui/dashboard/_dashboard.py +794 -0
  128. scc_cli/ui/dashboard/loaders.py +452 -0
  129. scc_cli/ui/dashboard/models.py +185 -0
  130. scc_cli/ui/dashboard/orchestrator.py +735 -0
  131. scc_cli/ui/formatters.py +444 -0
  132. scc_cli/ui/gate.py +350 -0
  133. scc_cli/ui/git_interactive.py +869 -0
  134. scc_cli/ui/git_render.py +176 -0
  135. scc_cli/ui/help.py +157 -0
  136. scc_cli/ui/keys.py +615 -0
  137. scc_cli/ui/list_screen.py +437 -0
  138. scc_cli/ui/picker.py +763 -0
  139. scc_cli/ui/prompts.py +201 -0
  140. scc_cli/ui/quick_resume.py +116 -0
  141. scc_cli/ui/wizard.py +576 -0
  142. scc_cli/update.py +680 -0
  143. scc_cli/utils/__init__.py +39 -0
  144. scc_cli/utils/fixit.py +264 -0
  145. scc_cli/utils/fuzzy.py +124 -0
  146. scc_cli/utils/locks.py +114 -0
  147. scc_cli/utils/ttl.py +376 -0
  148. scc_cli/validate.py +455 -0
  149. scc_cli-1.5.3.dist-info/METADATA +401 -0
  150. scc_cli-1.5.3.dist-info/RECORD +153 -0
  151. scc_cli-1.5.3.dist-info/WHEEL +4 -0
  152. scc_cli-1.5.3.dist-info/entry_points.txt +2 -0
  153. scc_cli-1.5.3.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,61 @@
1
+ """Context commands for work context management."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import typer
6
+
7
+ from ... import contexts
8
+ from ...cli_common import console, handle_errors
9
+ from ...confirm import Confirm
10
+ from ...panels import create_info_panel, create_success_panel
11
+
12
+
13
+ @handle_errors
14
+ def context_clear_cmd(
15
+ yes: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation prompt"),
16
+ ) -> None:
17
+ """Clear all recent work contexts from cache.
18
+
19
+ Use this command when the Recent Contexts list shows stale or
20
+ incorrect entries that you want to reset.
21
+
22
+ Examples:
23
+ scc context clear # With confirmation prompt
24
+ scc context clear --yes # Skip confirmation
25
+ """
26
+ cache_path = contexts._get_contexts_path()
27
+
28
+ # Show current count
29
+ current_count = len(contexts.load_recent_contexts())
30
+ if current_count == 0:
31
+ console.print(
32
+ create_info_panel(
33
+ "No Contexts",
34
+ "No work contexts to clear.",
35
+ "Contexts are created when you run: scc start <workspace>",
36
+ )
37
+ )
38
+ return
39
+
40
+ # Confirm unless --yes (improved what/why/next confirmation)
41
+ if not yes:
42
+ console.print(
43
+ f"[yellow]This will remove {current_count} context(s) from {cache_path}[/yellow]"
44
+ )
45
+ if not Confirm.ask("Continue?"):
46
+ console.print("[dim]Cancelled.[/dim]")
47
+ return
48
+
49
+ # Clear and report
50
+ cleared = contexts.clear_contexts()
51
+
52
+ console.print(
53
+ create_success_panel(
54
+ "Contexts Cleared",
55
+ {
56
+ "Removed": f"{cleared} work context(s)",
57
+ "Cache file": str(cache_path),
58
+ },
59
+ )
60
+ )
61
+ console.print("[dim]Run 'scc start' to repopulate.[/dim]")
@@ -0,0 +1,128 @@
1
+ """Session commands for Claude Code session management."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import typer
6
+
7
+ from ... import config, sessions
8
+ from ...cli_common import console, handle_errors, render_responsive_table
9
+ from ...panels import create_warning_panel
10
+ from ...ui.picker import TeamSwitchRequested, pick_session
11
+
12
+
13
+ @handle_errors
14
+ def sessions_cmd(
15
+ limit: int = typer.Option(10, "-n", "--limit", help="Number of sessions to show"),
16
+ team: str | None = typer.Option(None, "-t", "--team", help="Filter by team"),
17
+ all_teams: bool = typer.Option(
18
+ False, "--all", help="Show sessions for all teams (ignore active team)"
19
+ ),
20
+ select: bool = typer.Option(
21
+ False, "--select", "-s", help="Interactive picker to select a session"
22
+ ),
23
+ ) -> None:
24
+ """List recent Claude Code sessions."""
25
+ cfg = config.load_user_config()
26
+ active_team = cfg.get("selected_profile")
27
+ standalone_mode = config.is_standalone_mode()
28
+
29
+ # Resolve effective filter
30
+ filter_team: str | None
31
+ if all_teams:
32
+ filter_team = "__all__"
33
+ elif team:
34
+ filter_team = team
35
+ elif standalone_mode:
36
+ filter_team = None
37
+ elif active_team:
38
+ filter_team = active_team
39
+ else:
40
+ filter_team = "__all__"
41
+ console.print(
42
+ "[dim]No active team selected — showing all sessions. "
43
+ "Use 'scc team switch' or --team to filter.[/dim]"
44
+ )
45
+
46
+ recent = sessions.list_recent(limit)
47
+ if filter_team != "__all__":
48
+ recent = [s for s in recent if s.get("team") == filter_team]
49
+
50
+ # Interactive picker mode
51
+ if select and recent:
52
+ try:
53
+ selected = pick_session(
54
+ recent,
55
+ title="Select Session",
56
+ subtitle=f"{len(recent)} recent sessions",
57
+ )
58
+ if selected:
59
+ console.print(f"[green]Selected session:[/green] {selected.get('name', '-')}")
60
+ console.print(f"[dim]Workspace: {selected.get('workspace', '-')}[/dim]")
61
+ except TeamSwitchRequested:
62
+ console.print("[dim]Use 'scc team switch' to change teams[/dim]")
63
+ return
64
+
65
+ if not recent:
66
+ hint = "Start a session with: scc start <workspace>"
67
+ if filter_team not in ("__all__", None):
68
+ hint = "Use --all to show all teams or start a new session"
69
+ console.print(
70
+ create_warning_panel(
71
+ "No Sessions",
72
+ "No recent sessions found.",
73
+ hint,
74
+ )
75
+ )
76
+ return
77
+
78
+ # Build rows for responsive table
79
+ rows = []
80
+ for s in recent:
81
+ # Shorten workspace path if needed
82
+ ws = s.get("workspace", "-")
83
+ if len(ws) > 40:
84
+ ws = "..." + ws[-37:]
85
+ rows.append([s.get("name", "-"), ws, s.get("last_used", "-"), s.get("team", "-")])
86
+
87
+ title = "Recent Sessions"
88
+ if filter_team not in ("__all__", None):
89
+ title = f"Recent Sessions ({filter_team})"
90
+ elif filter_team is None and standalone_mode:
91
+ title = "Recent Sessions (standalone)"
92
+
93
+ render_responsive_table(
94
+ title=title,
95
+ columns=[
96
+ ("Session", "cyan"),
97
+ ("Workspace", "white"),
98
+ ],
99
+ rows=rows,
100
+ wide_columns=[
101
+ ("Last Used", "yellow"),
102
+ ("Team", "green"),
103
+ ],
104
+ )
105
+
106
+
107
+ @handle_errors
108
+ def session_list_cmd(
109
+ limit: int = typer.Option(10, "-n", "--limit", help="Number of sessions to show"),
110
+ team: str | None = typer.Option(None, "-t", "--team", help="Filter by team"),
111
+ all_teams: bool = typer.Option(
112
+ False, "--all", help="Show sessions for all teams (ignore active team)"
113
+ ),
114
+ select: bool = typer.Option(
115
+ False, "--select", "-s", help="Interactive picker to select a session"
116
+ ),
117
+ ) -> None:
118
+ """List recent Claude Code sessions.
119
+
120
+ Alias for 'scc sessions'. Provides symmetric command structure.
121
+
122
+ Examples:
123
+ scc session list
124
+ scc session list -n 20
125
+ scc session list --select
126
+ """
127
+ # Delegate to sessions_cmd to avoid duplication
128
+ sessions_cmd(limit=limit, team=team, all_teams=all_teams, select=select)