bevor-cli 0.2.0rc4__tar.gz → 0.2.0rc6__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.
Files changed (111) hide show
  1. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/PKG-INFO +2 -2
  2. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/actions.py +2 -5
  3. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/apps/analyses.py +0 -8
  4. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/apps/findings.py +2 -2
  5. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/client.py +9 -1
  6. bevor_cli-0.2.0rc6/bevor_cli/commands/analyses/lineage.py +53 -0
  7. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/list.py +1 -1
  8. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/select.py +1 -2
  9. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/transitions.py +17 -11
  10. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/view.py +1 -8
  11. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/findings/interactive.py +11 -11
  12. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/findings/list.py +1 -18
  13. bevor_cli-0.2.0rc4/bevor_cli/commands/findings/revert.py → bevor_cli-0.2.0rc6/bevor_cli/commands/findings/undo.py +4 -4
  14. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/status/__init__.py +1 -11
  15. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/sync/__init__.py +1 -6
  16. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/output.py +19 -10
  17. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/pyproject.toml +2 -2
  18. bevor_cli-0.2.0rc4/bevor_cli/commands/analyses/commit.py +0 -43
  19. bevor_cli-0.2.0rc4/bevor_cli/commands/analyses/diff.py +0 -84
  20. bevor_cli-0.2.0rc4/bevor_cli/commands/analyses/lineage.py +0 -104
  21. bevor_cli-0.2.0rc4/bevor_cli/commands/analyses/reset.py +0 -42
  22. bevor_cli-0.2.0rc4/bevor_cli/commands/analyses/retry.py +0 -77
  23. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/.gitignore +0 -0
  24. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/README.md +0 -0
  25. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/__init__.py +0 -0
  26. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/annotations/__init__.py +0 -0
  27. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/annotations/confirmations.py +0 -0
  28. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/annotations/literal_args.py +0 -0
  29. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/annotations/query.py +0 -0
  30. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/apps/chat.py +0 -0
  31. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/apps/codes.py +0 -0
  32. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/apps/main.py +0 -0
  33. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/apps/nodes.py +0 -0
  34. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/apps/projects.py +0 -0
  35. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/apps/sessions.py +0 -0
  36. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/apps/workspaces.py +0 -0
  37. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/callbacks/__init__.py +0 -0
  38. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/callbacks/notify.py +0 -0
  39. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/callbacks/upgrade.py +0 -0
  40. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/callbacks/version.py +0 -0
  41. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/__init__.py +0 -0
  42. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/__init__.py +0 -0
  43. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/chats/__init__.py +0 -0
  44. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/chats/get.py +0 -0
  45. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/chats/list.py +0 -0
  46. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/chats/messages.py +0 -0
  47. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/chats/new.py +0 -0
  48. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/chats/resume.py +0 -0
  49. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/chats/session.py +0 -0
  50. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/create.py +0 -0
  51. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/delete.py +0 -0
  52. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/deselect.py +0 -0
  53. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/entrypoints.py +0 -0
  54. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/fork.py +0 -0
  55. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/materialize.py +0 -0
  56. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/merge.py +0 -0
  57. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/run.py +0 -0
  58. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/analyses/set_head.py +0 -0
  59. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/auth/__init__.py +0 -0
  60. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/auth/login.py +0 -0
  61. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/auth/logout.py +0 -0
  62. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/auth/whoami.py +0 -0
  63. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/codes/__init__.py +0 -0
  64. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/codes/list.py +0 -0
  65. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/codes/push.py +0 -0
  66. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/codes/select.py +0 -0
  67. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/codes/view.py +0 -0
  68. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/findings/__init__.py +0 -0
  69. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/findings/acknowledge.py +0 -0
  70. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/findings/add.py +0 -0
  71. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/findings/delete.py +0 -0
  72. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/findings/edit.py +0 -0
  73. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/findings/get.py +0 -0
  74. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/findings/import_findings.py +0 -0
  75. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/graph/__init__.py +0 -0
  76. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/graph/call_chain.py +0 -0
  77. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/graph/edges.py +0 -0
  78. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/graph/interactive.py +0 -0
  79. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/graph/renderer.py +0 -0
  80. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/link/__init__.py +0 -0
  81. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/link/helpers.py +0 -0
  82. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/nodes/__init__.py +0 -0
  83. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/nodes/get.py +0 -0
  84. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/nodes/list.py +0 -0
  85. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/nodes/source.py +0 -0
  86. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/projects/__init__.py +0 -0
  87. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/projects/create.py +0 -0
  88. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/projects/list.py +0 -0
  89. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/projects/select.py +0 -0
  90. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/projects/view.py +0 -0
  91. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/reflog/__init__.py +0 -0
  92. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/sessions/__init__.py +0 -0
  93. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/sessions/list.py +0 -0
  94. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/sessions/revoke.py +0 -0
  95. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/workspaces/__init__.py +0 -0
  96. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/workspaces/list.py +0 -0
  97. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/workspaces/pick.py +0 -0
  98. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/workspaces/select.py +0 -0
  99. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/commands/workspaces/view.py +0 -0
  100. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/configuration/__init__.py +0 -0
  101. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/configuration/creds.py +0 -0
  102. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/configuration/logs.py +0 -0
  103. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/configuration/state.py +0 -0
  104. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/configuration/update.py +0 -0
  105. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/findings_yaml.py +0 -0
  106. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/fingerprint.py +0 -0
  107. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/main.py +0 -0
  108. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/select.py +0 -0
  109. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/settings.py +0 -0
  110. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/bevor_cli/target.py +0 -0
  111. {bevor_cli-0.2.0rc4 → bevor_cli-0.2.0rc6}/cli-hierarchy.py +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: bevor-cli
3
- Version: 0.2.0rc4
3
+ Version: 0.2.0rc6
4
4
  Summary: Bevor CLI tool for security analysis and graph inspection
5
5
  Classifier: Development Status :: 3 - Alpha
6
6
  Requires-Python: >=3.13
7
- Requires-Dist: bevor-sdk==0.2.0rc4
7
+ Requires-Dist: bevor-sdk==0.2.0rc6
8
8
  Requires-Dist: click~=8.1
9
9
  Requires-Dist: httpx~=0.28
10
10
  Requires-Dist: packaging~=26.2
@@ -6,11 +6,8 @@ from bevor_cli.output import console
6
6
  def action_commands(actions: AnalysisActions) -> list[tuple[str, ActionDetails]]:
7
7
  return [
8
8
  ("sync / create", actions.create_child),
9
- ("commit", actions.commit_changes),
10
- ("findings add/import/edit/delete", actions.stage_changes),
11
- ("run", actions.run_first_party_pipeline),
12
- ("run --all", actions.run_pipeline),
13
- ("retry", actions.retry_pipeline),
9
+ ("alter findings", actions.alter_findings),
10
+ ("run", actions.run_pipeline),
14
11
  ("fork", actions.fork),
15
12
  ("merge (into this)", actions.merge_to),
16
13
  ("merge (from this)", actions.merge_from),
@@ -1,20 +1,16 @@
1
1
  import typer
2
- from bevor_cli.commands.analyses.commit import commit_analysis
3
2
  from bevor_cli.commands.analyses.create import create_analysis
4
3
  from bevor_cli.commands.analyses.delete import (
5
4
  delete_analysis_full,
6
5
  delete_analysis_version,
7
6
  )
8
7
  from bevor_cli.commands.analyses.deselect import deselect_analysis
9
- from bevor_cli.commands.analyses.diff import diff_analysis
10
8
  from bevor_cli.commands.analyses.entrypoints import list_entrypoints
11
9
  from bevor_cli.commands.analyses.fork import fork_analysis
12
10
  from bevor_cli.commands.analyses.lineage import lineage_analysis
13
11
  from bevor_cli.commands.analyses.list import list_analyses
14
12
  from bevor_cli.commands.analyses.materialize import materialize_analysis
15
13
  from bevor_cli.commands.analyses.merge import merge_analysis
16
- from bevor_cli.commands.analyses.reset import reset_analysis
17
- from bevor_cli.commands.analyses.retry import retry_analysis
18
14
  from bevor_cli.commands.analyses.run import run_analysis
19
15
  from bevor_cli.commands.analyses.select import select_analysis
20
16
  from bevor_cli.commands.analyses.set_head import set_analysis_head
@@ -39,16 +35,12 @@ app.command("select")(select_analysis)
39
35
  app.command("deselect")(deselect_analysis)
40
36
 
41
37
  app.command("create")(create_analysis)
42
- app.command("commit")(commit_analysis)
43
- app.command("reset")(reset_analysis)
44
38
  app.command("fork")(fork_analysis)
45
39
  app.command("merge")(merge_analysis)
46
40
 
47
41
  app.command("run")(run_analysis)
48
- app.command("retry")(retry_analysis)
49
42
  app.command("entrypoints")(list_entrypoints)
50
43
  app.command("materialize")(materialize_analysis)
51
- app.command("diff")(diff_analysis)
52
44
  app.command("transitions")(list_transitions)
53
45
 
54
46
  app.command("set-head")(set_analysis_head)
@@ -9,7 +9,7 @@ from bevor_cli.commands.findings.edit import edit_finding
9
9
  from bevor_cli.commands.findings.get import get_finding
10
10
  from bevor_cli.commands.findings.import_findings import import_findings
11
11
  from bevor_cli.commands.findings.list import list_findings
12
- from bevor_cli.commands.findings.revert import revert_finding
12
+ from bevor_cli.commands.findings.undo import undo_change
13
13
 
14
14
  app = typer.Typer(
15
15
  help=(
@@ -26,7 +26,7 @@ app.command("add")(add_finding)
26
26
  app.command("import")(import_findings)
27
27
  app.command("edit")(edit_finding)
28
28
  app.command("delete")(delete_finding)
29
- app.command("revert")(revert_finding)
29
+ app.command("undo")(undo_change)
30
30
  app.command("acknowledge")(acknowledge_finding)
31
31
  app.command("unacknowledge")(unacknowledge_finding)
32
32
 
@@ -11,6 +11,7 @@ from bevor_sdk.exceptions import ERROR_REGISTRY, BevorErrorTypes
11
11
  from httpx._types import QueryParamTypes, TimeoutTypes
12
12
 
13
13
  from bevor_cli import output
14
+ from bevor_cli.callbacks.version import _current_version
14
15
  from bevor_cli.configuration.creds import Credentials
15
16
  from bevor_cli.settings import API_URL
16
17
 
@@ -38,7 +39,12 @@ class BevorInternalClient(BevorClient):
38
39
  headers.update({"bevor-workspace-id": workspace_id})
39
40
  if project_id:
40
41
  headers.update({"bevor-project-id": project_id})
41
- super().__init__(api_key=creds.token, base_url=API_URL, default_headers=headers)
42
+ super().__init__(
43
+ api_key=creds.token,
44
+ base_url=API_URL,
45
+ default_headers=headers,
46
+ app=f"bevor-cli/{_current_version()}",
47
+ )
42
48
 
43
49
 
44
50
  class BevorInternalBusinessClient(httpx.Client):
@@ -51,6 +57,8 @@ class BevorInternalBusinessClient(httpx.Client):
51
57
  ) -> None:
52
58
  super().__init__(base_url=API_URL, timeout=timeout or self._TIMEOUT)
53
59
 
60
+ self.headers.update({"User-Agent": f"bevor-cli/{_current_version()}"})
61
+
54
62
  if creds.token:
55
63
  self.headers.update({"Authorization": f"Bearer {creds.token}"})
56
64
  if workspace_id:
@@ -0,0 +1,53 @@
1
+ """``bevor analyses lineage`` — ancestry of HEAD in the selected analysis."""
2
+
3
+ import typer
4
+
5
+ from bevor_cli.annotations.confirmations import JSON_OUT
6
+ from bevor_cli.client import BevorInternalClient
7
+ from bevor_cli.configuration.creds import Credentials
8
+ from bevor_cli.configuration.state import State
9
+ from bevor_cli.output import console, findings_detail, print_json
10
+
11
+
12
+ def lineage_analysis(
13
+ limit: int = typer.Option(10, "--limit", "-n", help="Maximum number of versions to show."),
14
+ oneline: bool = typer.Option(False, "--oneline", help="One line per version."),
15
+ json_out: JSON_OUT = False,
16
+ ) -> None:
17
+ """Show HEAD of the selected analysis and its ancestors, back toward the root.
18
+
19
+ Each version is fetched individually, so keep ``--limit`` small on long histories.
20
+ """
21
+ creds = Credentials.load()
22
+ creds.require_token()
23
+
24
+ state = State.load()
25
+ workspace_id = state.validate_workspace()
26
+
27
+ client = BevorInternalClient(
28
+ creds=creds, workspace_id=workspace_id, project_id=state.validate_project()
29
+ )
30
+
31
+ lineage = client.analyses.lineage(state.validate_analysis())
32
+
33
+ if json_out:
34
+ print_json(lineage.model_dump_json())
35
+ return
36
+
37
+ for i, e in enumerate(lineage.results):
38
+ head_marker = " [bold cyan](HEAD)[/bold cyan]" if e.is_head else ""
39
+ detail = findings_detail(e.n_findings, e.n_remediations)
40
+
41
+ if oneline:
42
+ console.print(f"[yellow]{e.id}[/yellow]{head_marker} {e.trigger} {detail}")
43
+ continue
44
+
45
+ if i:
46
+ console.print()
47
+ console.print(f"[yellow]version {e.id}[/yellow]{head_marker}")
48
+ if e.merged_from_version_id:
49
+ console.print(f"Merged: {e.merged_from_version_id}")
50
+ console.print(f"Trigger: {e.trigger}")
51
+ console.print(f"Code: {e.code_id}")
52
+ console.print(f"Findings: {e.n_findings}{detail}")
53
+ console.print(f"Date: {e.created_at:%Y-%m-%d %H:%M}")
@@ -73,7 +73,7 @@ def list_analyses(
73
73
  a.id,
74
74
  a.name,
75
75
  head.code_version.id,
76
- f"{head.n_findings}{findings_detail(head.n_staged, head.n_remediations)}",
76
+ f"{findings_detail(head.n_findings, head.n_remediations)}",
77
77
  a.user.username,
78
78
  str(a.created_at.date()),
79
79
  ]
@@ -80,8 +80,7 @@ def select_analysis(
80
80
  questionary.Choice(
81
81
  title=(
82
82
  f"{a.name} · {a.version.code_version.id} "
83
- f"{a.version.n_findings} findings"
84
- f"{findings_detail(a.version.n_staged, a.version.n_remediations)} "
83
+ f"{findings_detail(a.version.n_findings, a.version.n_remediations)} "
85
84
  f"{a.user.username} "
86
85
  f"{a.id} {a.created_at.date()}"
87
86
  ),
@@ -3,8 +3,9 @@
3
3
  from typing import Annotated, Optional
4
4
 
5
5
  import typer
6
- from bevor_sdk.types.literals import FindingTransitionReason
6
+ from bevor_sdk.types.literals import FindingTransitionKind
7
7
  from bevor_sdk.types.requests import TransitionListParams
8
+ from bevor_sdk.types.responses import FindingBare, FindingTransition
8
9
  from rich.table import Table
9
10
  from rich.text import Text
10
11
 
@@ -12,24 +13,29 @@ from bevor_cli.annotations.confirmations import JSON_OUT
12
13
  from bevor_cli.annotations.literal_args import literal_option
13
14
  from bevor_cli.annotations.query import ORDER, ORDER_BY, PAGE, PAGE_SIZE
14
15
  from bevor_cli.client import BevorInternalClient
15
- from bevor_cli.commands.analyses.diff import _snapshot
16
16
  from bevor_cli.commands.findings.get import LEVEL_COLORS
17
17
  from bevor_cli.configuration.creds import Credentials
18
18
  from bevor_cli.configuration.state import State
19
19
  from bevor_cli.output import console, print_json
20
20
 
21
21
 
22
+ def _snapshot(item: FindingTransition) -> FindingBare:
23
+ to_render = item.after_finding or item.before_finding
24
+ assert to_render
25
+ return to_render
26
+
27
+
22
28
  def list_transitions(
23
29
  page: PAGE = None,
24
30
  page_size: PAGE_SIZE = None,
25
31
  order: ORDER = None,
26
32
  order_by: ORDER_BY = None,
27
- reason: Annotated[
28
- FindingTransitionReason | None,
33
+ kind: Annotated[
34
+ FindingTransitionKind | None,
29
35
  literal_option(
30
- FindingTransitionReason,
31
- "--reason",
32
- help="Only show transitions with this reason (e.g. remediated).",
36
+ FindingTransitionKind,
37
+ "--kind",
38
+ help="Only show transitions with this kind (e.g. remediated, carried).",
33
39
  ),
34
40
  ] = None,
35
41
  version: Optional[str] = typer.Option(
@@ -64,8 +70,8 @@ def list_transitions(
64
70
  query_params["order"] = order
65
71
  if order_by is not None:
66
72
  query_params["order_by"] = order_by
67
- if reason is not None:
68
- query_params["reason"] = reason
73
+ if kind is not None:
74
+ query_params["kind"] = kind
69
75
  if version:
70
76
  query_params["after_version_id"] = version
71
77
  elif not project_wide:
@@ -82,11 +88,11 @@ def list_transitions(
82
88
  console.print("No transitions.")
83
89
  return
84
90
 
85
- table = Table("Reason", "Type", "Level", "Name", "Version", "Created")
91
+ table = Table("Kind", "Type", "Level", "Name", "Version", "Created")
86
92
  for item in result.results:
87
93
  snapshot = _snapshot(item)
88
94
  table.add_row(
89
- item.reason,
95
+ item.kind,
90
96
  snapshot.type,
91
97
  Text(snapshot.level, style=LEVEL_COLORS[snapshot.level]),
92
98
  snapshot.name,
@@ -61,7 +61,7 @@ def view_analysis(
61
61
  table.add_row("Owner", str(analysis_meta_.is_owner))
62
62
  table.add_row(
63
63
  "Findings",
64
- f"{version_.n_findings}{findings_detail(version_.n_staged, version_.n_remediations)}",
64
+ f"{findings_detail(version_.n_findings, version_.n_remediations)}",
65
65
  )
66
66
  table.add_row("Code version", version_.code_version.id)
67
67
  table.add_row("Is head", str(version_.is_head))
@@ -84,13 +84,6 @@ def view_analysis(
84
84
 
85
85
  table.add_row("In sync w/ .bevor code", str(in_sync))
86
86
 
87
- table.add_row(
88
- "Staged",
89
- f"{version_.n_staged} change(s) — `bevor analyses diff --staged`"
90
- if version_.n_staged
91
- else "nothing",
92
- )
93
-
94
87
  console.print(table)
95
88
  console.print()
96
89
  print_actions(version_.actions, label_width=8)
@@ -7,7 +7,7 @@ from typing import Callable, List
7
7
 
8
8
  import click
9
9
  import typer
10
- from bevor_sdk.types.literals import FindingDraftOperation
10
+ from bevor_sdk.types.literals import FindingEventKind
11
11
  from bevor_sdk.types.responses import Finding
12
12
  from rich.console import Group
13
13
  from rich.live import Live
@@ -26,10 +26,10 @@ _MIN_DETAIL_LINES = 6
26
26
  _OP_COLORS = {"add": "green", "edit": "yellow", "delete": "red"}
27
27
 
28
28
 
29
- def _op_badge(operation: FindingDraftOperation | None) -> Text:
30
- if not operation:
29
+ def _op_badge(event_kind: FindingEventKind | None) -> Text:
30
+ if not event_kind:
31
31
  return Text("—", style="dim")
32
- return Text(operation.upper(), style=f"bold {_OP_COLORS.get(operation, 'white')}")
32
+ return Text(event_kind.upper(), style=f"bold {_OP_COLORS.get(event_kind, 'white')}")
33
33
 
34
34
 
35
35
  def _nav_delta(key: str) -> int:
@@ -50,8 +50,8 @@ def _action_hints(finding: Finding) -> str:
50
50
  parts = ["↑↓/j/k move", "q quit"]
51
51
  if finding.actions.edit.is_allowed:
52
52
  parts.append("e edit")
53
- if finding.actions.revert.is_allowed:
54
- parts.append("r revert")
53
+ if finding.actions.undo.is_allowed:
54
+ parts.append("u undo")
55
55
  if finding.actions.delete.is_allowed:
56
56
  parts.append("x delete")
57
57
  return " ".join(parts)
@@ -137,7 +137,7 @@ def _findings_table_with_ops(
137
137
  for i, finding in enumerate(rows):
138
138
  style = "reverse" if focus is not None and i == focus else ""
139
139
  table.add_row(
140
- _op_badge(finding.operation),
140
+ _op_badge(finding.last_event_kind),
141
141
  Text(finding.level, style=LEVEL_COLORS[finding.level]),
142
142
  finding.type,
143
143
  finding.name,
@@ -166,7 +166,7 @@ def _findings_table_with_ops(
166
166
  for i in range(start, end):
167
167
  finding = rows[i]
168
168
  table.add_row(
169
- _op_badge(finding.operation),
169
+ _op_badge(finding.last_event_kind),
170
170
  Text(finding.level, style=LEVEL_COLORS[finding.level]),
171
171
  finding.type,
172
172
  finding.name,
@@ -299,10 +299,10 @@ def browse_findings_with_actions(
299
299
 
300
300
  f = rows[focus]
301
301
 
302
- if key.lower() == "r" and f.actions.revert.is_allowed:
302
+ if key.lower() == "u" and f.actions.undo.is_allowed:
303
303
  live.stop()
304
- if typer.confirm(f"Revert staged {f.operation} on {f.name!r}?"):
305
- client.findings.revert(f.id)
304
+ if typer.confirm(f"Revert staged {f.last_event_kind} on {f.name!r}?"):
305
+ client.findings.undo(f.id)
306
306
  rows = refetch()
307
307
  focus = min(focus, len(rows) - 1)
308
308
  live.start()
@@ -7,7 +7,7 @@ from typing import Annotated, List, Literal, Optional
7
7
  import typer
8
8
  from bevor_sdk import Graph
9
9
  from bevor_sdk.helpers.sarif import bevor_to_sarif_sync
10
- from bevor_sdk.types.literals import FindingDraftOperation, FindingLevel
10
+ from bevor_sdk.types.literals import FindingLevel
11
11
  from bevor_sdk.types.requests import (
12
12
  FindingListParams,
13
13
  VersionIdentifierParam,
@@ -35,7 +35,6 @@ def _matches(
35
35
  finding_type: Optional[str],
36
36
  level: Optional[FindingLevel],
37
37
  is_acknowledged: Optional[bool],
38
- operation: Optional[FindingDraftOperation],
39
38
  ) -> bool:
40
39
  if finding_type and finding.type != finding_type:
41
40
  return False
@@ -43,8 +42,6 @@ def _matches(
43
42
  return False
44
43
  if is_acknowledged is not None and finding.is_acknowledged is not is_acknowledged:
45
44
  return False
46
- if operation and finding.operation != operation:
47
- return False
48
45
  return True
49
46
 
50
47
 
@@ -86,15 +83,6 @@ def list_findings(
86
83
  is_acknowledged: Optional[bool] = typer.Option(
87
84
  None, "--acknowledged", help="Only acknowledged findings.", rich_help_panel=FILTER_PANEL
88
85
  ),
89
- operation: Annotated[
90
- FindingDraftOperation | None,
91
- literal_option(
92
- FindingDraftOperation,
93
- "--operation",
94
- help="Only staged changes of this kind.",
95
- rich_help_panel=FILTER_PANEL,
96
- ),
97
- ] = None,
98
86
  page: Annotated[
99
87
  Optional[int], typer.Option("--page", help="Page number.", rich_help_panel=SEARCH_PANEL)
100
88
  ] = None,
@@ -205,7 +193,6 @@ def list_findings(
205
193
  finding_type=finding_type,
206
194
  level=level,
207
195
  is_acknowledged=is_acknowledged,
208
- operation=operation,
209
196
  is_self=is_self,
210
197
  user_id=user_id,
211
198
  code_id=code_id,
@@ -235,7 +222,6 @@ def list_findings(
235
222
  finding_type=finding_type,
236
223
  level=level,
237
224
  is_acknowledged=is_acknowledged,
238
- operation=operation,
239
225
  )
240
226
  ]
241
227
 
@@ -274,7 +260,6 @@ def _search_params(
274
260
  finding_type: Optional[str],
275
261
  level: Optional[FindingLevel],
276
262
  is_acknowledged: Optional[bool],
277
- operation: Optional[FindingDraftOperation],
278
263
  is_self: Optional[bool],
279
264
  user_id: Optional[str],
280
265
  code_id: Optional[str],
@@ -297,8 +282,6 @@ def _search_params(
297
282
  query_params["level"] = level
298
283
  if is_acknowledged is not None:
299
284
  query_params["is_acknowledged"] = is_acknowledged
300
- if operation is not None:
301
- query_params["operation"] = operation
302
285
 
303
286
  if is_self is not None:
304
287
  query_params["is_self"] = is_self
@@ -9,8 +9,8 @@ from bevor_cli.configuration.creds import Credentials
9
9
  from bevor_cli.configuration.state import State
10
10
 
11
11
 
12
- def revert_finding(
13
- finding_id: str = typer.Argument(..., help="Finding id to revert."),
12
+ def undo_change(
13
+ finding_id: str = typer.Argument(..., help="Finding id to undo changes to."),
14
14
  ) -> None:
15
15
  """Discard the staged change to a finding. To discard everything staged, use `bevor analyses reset`."""
16
16
  creds = Credentials.load()
@@ -23,6 +23,6 @@ def revert_finding(
23
23
  creds=creds, workspace_id=workspace_id, project_id=state.validate_project()
24
24
  )
25
25
 
26
- client.findings.revert(ID(finding_id))
26
+ client.findings.undo(ID(finding_id))
27
27
 
28
- output.success("Staged change discarded.")
28
+ output.success("Recent finding change undone.")
@@ -104,9 +104,7 @@ def run_status(
104
104
  head = analysis.version
105
105
  lines.append(f"Analysis : {analysis.name} [{analysis.id}]")
106
106
  lines.append(f"HEAD : {head.id} ({head.trigger}, {head.created_at.date()})")
107
- lines.append(
108
- f"Findings : {head.n_findings}{findings_detail(head.n_staged, head.n_remediations)}"
109
- )
107
+ lines.append(f"Findings : {findings_detail(head.n_findings, head.n_remediations)}")
110
108
  payload["analysis"] = analysis.model_dump(mode="json")
111
109
 
112
110
  head_matches = (
@@ -118,14 +116,6 @@ def run_status(
118
116
  f"HEAD code : {head.code_version.id} (differs from pushed code — run `bevor sync`)"
119
117
  )
120
118
 
121
- payload["staged"] = head.n_staged
122
- if head.n_staged:
123
- lines.append(
124
- f"Staged : {head.n_staged} change(s) — review with `bevor analyses diff --staged`"
125
- )
126
- else:
127
- lines.append("Staged : nothing")
128
-
129
119
  entrypoints = client.analyses.entrypoints(analysis.id)
130
120
  counts = Counter(str(ep.pipeline_status) for ep in entrypoints.results)
131
121
  payload["pipeline"] = dict(counts)
@@ -42,13 +42,8 @@ def run_sync(
42
42
  output.info(f"Analysis {state.analysis_id} is already on this code.")
43
43
  elif not head.actions.create_child.is_allowed:
44
44
  reasons = "; ".join(head.actions.create_child.reasons) or "not allowed on this version"
45
- hint = (
46
- f"HEAD has {head.n_staged} staged change(s): run `bevor analyses commit` or `bevor analyses reset`, then `bevor sync`."
47
- if head.n_staged
48
- else None
49
- )
50
45
  output.error(
51
- f"Pushed, but can't add a version to analysis {state.analysis_id}: {reasons}", hint=hint
46
+ f"Pushed, but can't add a version to analysis {state.analysis_id}: {reasons}",
52
47
  )
53
48
  raise typer.Exit(1)
54
49
  else:
@@ -72,13 +72,22 @@ def print_json(data: str) -> None:
72
72
  sys.stdout.write(data if data.endswith("\n") else data + "\n")
73
73
 
74
74
 
75
-
76
- def findings_detail(n_staged: int, n_remediations: int) -> str:
77
- """`` (1 staged, 2 remediated)`` suffix for a findings count; empty when both are zero."""
78
- parts = [f"{n_staged} staged"] if n_staged else []
79
- if n_remediations:
80
- parts.append(f"{n_remediations} remediated")
81
- return f" ({', '.join(parts)})" if parts else ""
82
-
83
-
84
- __all__ = ["set_quiet", "info", "success", "warning", "error", "spinner", "console", "print_json", "findings_detail"]
75
+ def findings_detail(n_findings: int, n_remediations: int) -> str:
76
+ detail = ""
77
+ if n_remediations > 0:
78
+ detail = f" ({n_remediations} remediated)"
79
+
80
+ return f"{n_findings} finding{'' if n_findings == 1 else 's'}{detail}"
81
+
82
+
83
+ __all__ = [
84
+ "set_quiet",
85
+ "info",
86
+ "success",
87
+ "warning",
88
+ "error",
89
+ "spinner",
90
+ "console",
91
+ "print_json",
92
+ "findings_detail",
93
+ ]
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "bevor-cli"
3
- version = "0.2.0rc4"
3
+ version = "0.2.0rc6"
4
4
  description = "Bevor CLI tool for security analysis and graph inspection"
5
5
  requires-python = ">=3.13"
6
6
  dependencies = [
7
- "bevor-sdk==0.2.0rc4",
7
+ "bevor-sdk==0.2.0rc6",
8
8
  "typer~=0.26",
9
9
  "httpx~=0.28",
10
10
  "pydantic~=2.12",
@@ -1,43 +0,0 @@
1
- """``bevor analyses commit`` — commit staged finding changes."""
2
-
3
- from typing import Optional
4
-
5
- import typer
6
- from bevor_sdk.types.requests import VersionIdentifierBody
7
-
8
- from bevor_cli import output
9
- from bevor_cli.client import BevorInternalClient
10
- from bevor_cli.configuration.creds import Credentials
11
- from bevor_cli.configuration.state import State
12
- from bevor_cli.target import resolve_target
13
-
14
-
15
- def commit_analysis(
16
- version: Optional[str] = typer.Option(
17
- None,
18
- "--version",
19
- help="Use this version instead of HEAD.",
20
- ),
21
- ) -> None:
22
- """Commit the staged findings on HEAD (or ``--version``) as a new version, and move HEAD to it."""
23
- creds = Credentials.load()
24
- creds.require_token()
25
-
26
- state = State.load()
27
- workspace_id = state.validate_workspace()
28
-
29
- client = BevorInternalClient(
30
- creds=creds, workspace_id=workspace_id, project_id=state.validate_project()
31
- )
32
-
33
- body = VersionIdentifierBody()
34
- analysis_id, version_id = resolve_target(client, state, version)
35
- if version_id:
36
- body["version_id"] = version_id
37
-
38
- result = client.analyses.commit(analysis_id, body)
39
-
40
- state.set_analysis(result)
41
- state.save()
42
-
43
- output.success(f"Committed changes → new head {result.version.id} (analysis {result.id}).")
@@ -1,84 +0,0 @@
1
- """``bevor analyses diff``."""
2
-
3
- from typing import Optional
4
-
5
- import typer
6
- from bevor_sdk.types.requests import VersionIdentifierParam
7
- from bevor_sdk.types.responses import FindingBare, FindingTransition
8
- from rich.table import Table
9
- from rich.text import Text
10
-
11
- from bevor_cli.annotations.confirmations import JSON_OUT
12
- from bevor_cli.client import BevorInternalClient
13
- from bevor_cli.commands.findings.get import LEVEL_COLORS
14
- from bevor_cli.configuration.creds import Credentials
15
- from bevor_cli.configuration.state import State
16
- from bevor_cli.output import console, print_json
17
- from bevor_cli.target import resolve_target
18
-
19
-
20
- def _snapshot(item: FindingTransition) -> FindingBare:
21
- to_render = item.after_finding or item.before_finding
22
- assert to_render
23
- return to_render
24
-
25
-
26
- def diff_analysis(
27
- version: Optional[str] = typer.Option(
28
- None,
29
- "--version",
30
- help="Use this version instead of HEAD.",
31
- ),
32
- staged: bool = typer.Option(
33
- False,
34
- "--staged",
35
- help="Show staged drafts instead of version-vs-parent diffs.",
36
- ),
37
- json_out: JSON_OUT = False,
38
- ) -> None:
39
- """Show how findings changed between HEAD (or ``--version``) and its parent.
40
-
41
- With ``--staged``, show the uncommitted changes on HEAD instead."""
42
- creds = Credentials.load()
43
- creds.require_token()
44
-
45
- state = State.load()
46
- workspace_id = state.validate_workspace()
47
-
48
- client = BevorInternalClient(
49
- creds=creds, workspace_id=workspace_id, project_id=state.validate_project()
50
- )
51
-
52
- opts = VersionIdentifierParam()
53
- analysis_id, version_id = resolve_target(client, state, version)
54
- if version_id:
55
- opts["version_id"] = version_id
56
-
57
- analysis_source = client.analyses(analysis_id)
58
-
59
- if staged:
60
- page = analysis_source.diff_staged(opts)
61
- else:
62
- page = analysis_source.diff_version(opts)
63
-
64
- if json_out:
65
- print_json(page.model_dump_json(indent=2))
66
- return
67
-
68
- if not page.results:
69
- console.print("No diffs.")
70
- return
71
-
72
- table = Table("Reason", "Type", "Level", "Name", "Changed")
73
- for item in page.results:
74
- snapshot = _snapshot(item)
75
-
76
- table.add_row(
77
- item.reason,
78
- snapshot.type,
79
- Text(snapshot.level, style=LEVEL_COLORS[snapshot.level]),
80
- snapshot.name,
81
- ", ".join(item.changed_fields),
82
- )
83
-
84
- console.print(table)