bevor-cli 0.1.1__tar.gz → 0.1.2__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 (107) hide show
  1. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/.gitignore +2 -1
  2. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/PKG-INFO +3 -2
  3. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/README.md +1 -0
  4. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/create.py +4 -3
  5. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/retry.py +12 -8
  6. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/run.py +11 -9
  7. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/auth/login.py +2 -0
  8. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/codes/push.py +6 -3
  9. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/codes/view.py +3 -3
  10. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/configuration/creds.py +1 -0
  11. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/configuration/state.py +10 -8
  12. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/pyproject.toml +2 -2
  13. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/__init__.py +0 -0
  14. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/annotations/__init__.py +0 -0
  15. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/annotations/confirmations.py +0 -0
  16. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/annotations/query.py +0 -0
  17. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/apps/agent.py +0 -0
  18. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/apps/analyses.py +0 -0
  19. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/apps/chat.py +0 -0
  20. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/apps/codes.py +0 -0
  21. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/apps/findings.py +0 -0
  22. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/apps/main.py +0 -0
  23. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/apps/nodes.py +0 -0
  24. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/apps/projects.py +0 -0
  25. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/apps/sessions.py +0 -0
  26. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/apps/workspaces.py +0 -0
  27. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/callbacks/__init__.py +0 -0
  28. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/callbacks/notify.py +0 -0
  29. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/callbacks/upgrade.py +0 -0
  30. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/callbacks/version.py +0 -0
  31. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/client.py +0 -0
  32. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/__init__.py +0 -0
  33. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/agent/__init__.py +0 -0
  34. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/agent/materialze_cmd.py +0 -0
  35. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/agent/setup_cmd.py +0 -0
  36. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/__init__.py +0 -0
  37. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/active.py +0 -0
  38. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/chats/__init__.py +0 -0
  39. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/chats/get.py +0 -0
  40. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/chats/list.py +0 -0
  41. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/chats/messages.py +0 -0
  42. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/chats/new.py +0 -0
  43. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/chats/resume.py +0 -0
  44. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/chats/session.py +0 -0
  45. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/child.py +0 -0
  46. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/commit.py +0 -0
  47. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/delete.py +0 -0
  48. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/diff.py +0 -0
  49. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/entrypoints.py +0 -0
  50. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/findings.py +0 -0
  51. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/fork.py +0 -0
  52. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/list.py +0 -0
  53. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/merge.py +0 -0
  54. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/select.py +0 -0
  55. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/set_head.py +0 -0
  56. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/transitions.py +0 -0
  57. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/analyses/view.py +0 -0
  58. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/auth/__init__.py +0 -0
  59. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/auth/logout.py +0 -0
  60. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/auth/whoami.py +0 -0
  61. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/codes/__init__.py +0 -0
  62. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/codes/list.py +0 -0
  63. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/codes/select.py +0 -0
  64. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/context/__init__.py +0 -0
  65. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/findings/__init__.py +0 -0
  66. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/findings/acknowledge.py +0 -0
  67. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/findings/add.py +0 -0
  68. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/findings/bulk.py +0 -0
  69. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/findings/delete.py +0 -0
  70. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/findings/edit.py +0 -0
  71. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/findings/get.py +0 -0
  72. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/findings/interactive.py +0 -0
  73. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/findings/list.py +0 -0
  74. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/findings/revert.py +0 -0
  75. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/graph/__init__.py +0 -0
  76. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/graph/call_chain.py +0 -0
  77. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/graph/edges.py +0 -0
  78. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/graph/interactive.py +0 -0
  79. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/graph/renderer.py +0 -0
  80. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/link/__init__.py +0 -0
  81. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/link/helpers.py +0 -0
  82. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/nodes/__init__.py +0 -0
  83. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/nodes/get.py +0 -0
  84. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/nodes/list.py +0 -0
  85. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/nodes/source.py +0 -0
  86. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/projects/__init__.py +0 -0
  87. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/projects/create.py +0 -0
  88. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/projects/list.py +0 -0
  89. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/projects/select.py +0 -0
  90. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/projects/view.py +0 -0
  91. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/sessions/__init__.py +0 -0
  92. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/sessions/list.py +0 -0
  93. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/sessions/revoke.py +0 -0
  94. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/workspaces/__init__.py +0 -0
  95. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/workspaces/list.py +0 -0
  96. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/workspaces/pick.py +0 -0
  97. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/workspaces/select.py +0 -0
  98. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/commands/workspaces/view.py +0 -0
  99. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/configuration/__init__.py +0 -0
  100. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/configuration/settings.py +0 -0
  101. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/configuration/update.py +0 -0
  102. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/findings_yaml.py +0 -0
  103. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/main.py +0 -0
  104. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/output.py +0 -0
  105. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/select.py +0 -0
  106. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/bevor_cli/settings.py +0 -0
  107. {bevor_cli-0.1.1 → bevor_cli-0.1.2}/cli-hierarchy.py +0 -0
@@ -25,6 +25,7 @@ htmlcov/
25
25
  # Env files
26
26
  .env
27
27
  .env.*
28
+ !.env.test
28
29
  !.env.example
29
30
 
30
31
  # Terraform
@@ -34,13 +35,13 @@ htmlcov/
34
35
  *.tfvars
35
36
  *.tfvars.json
36
37
  !*.tfvars.example
38
+ *.tfplan
37
39
  crash.log
38
40
  crash.*.log
39
41
 
40
42
  # Editors / OS
41
43
  .vscode/
42
44
  .idea/
43
- .zed/
44
45
  .DS_Store
45
46
 
46
47
  # Scratch
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: bevor-cli
3
- Version: 0.1.1
3
+ Version: 0.1.2
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.1.1
7
+ Requires-Dist: bevor-sdk==0.1.2
8
8
  Requires-Dist: click~=8.1
9
9
  Requires-Dist: httpx~=0.28
10
10
  Requires-Dist: packaging~=26.2
@@ -53,6 +53,7 @@ Simplifies the DX, and we can take the stance that it's a rare state to want to
53
53
  "version" is a flag that can be passed, but it's intentionally hard to act on arbitrary versions, unless the head is moved or the flag is passed.
54
54
 
55
55
  ### Local Configuration
56
+
56
57
  - workspace [id]
57
58
  - project [id]
58
59
  - code [id, fingerprint]
@@ -36,6 +36,7 @@ Simplifies the DX, and we can take the stance that it's a rare state to want to
36
36
  "version" is a flag that can be passed, but it's intentionally hard to act on arbitrary versions, unless the head is moved or the flag is passed.
37
37
 
38
38
  ### Local Configuration
39
+
39
40
  - workspace [id]
40
41
  - project [id]
41
42
  - code [id, fingerprint]
@@ -4,7 +4,7 @@ from pathlib import Path
4
4
  from typing import Literal, Optional
5
5
 
6
6
  import typer
7
- from bevor_sdk.helpers.source_fingerprint import zip_source_tree
7
+ from bevor_sdk.helpers.source_fingerprint import directory_files, fingerprint_source
8
8
  from bevor_sdk.types import ID
9
9
  from bevor_sdk.types.requests.security.analyses import CreateAnalysisRootBodyDict
10
10
  from bevor_sdk.types.responses.security import AnalysisCollisionResult, AnalysisCreatedResult
@@ -38,8 +38,9 @@ def apply_create_analysis(
38
38
  code_id = state.validate_code()
39
39
 
40
40
  if not force:
41
- _, _, content_hash = zip_source_tree(Path.cwd())
42
- if content_hash != state.code_fingerprint:
41
+ root = Path.cwd()
42
+ _, _, _, fingerprint = fingerprint_source(directory_files(root), root.name)
43
+ if fingerprint != state.code_fingerprint:
43
44
  output.error(
44
45
  "Working directory does not match the configured code fingerprint "
45
46
  "(run `bevor codes push` after your latest changes).",
@@ -6,6 +6,8 @@ import typer
6
6
  from bevor_sdk._sync.resources._modules import EventResource
7
7
  from bevor_sdk.types import ID
8
8
  from bevor_sdk.types.requests.security import VersionBodyDict
9
+ from bevor_sdk.types.responses.events import AnalysisRunStatusEventData
10
+ from rich.live import Live
9
11
 
10
12
  from bevor_cli import output
11
13
  from bevor_cli.annotations.confirmations import NO_WAIT, SILENT
@@ -55,17 +57,19 @@ def retry_analysis(
55
57
  ep_map[ep.node.id] = (ep.node.short_id, ep.node.name, ep.pipeline_status)
56
58
 
57
59
  if not silent:
58
- with output.spinner("Analysis running…"):
60
+ with Live(render_status(ep_map), console=output.console, refresh_per_second=8) as live:
59
61
  for event in run_result.stream_completion():
60
- if event.id in ep_map:
61
- short_id, name, _ = ep_map[event.id]
62
- ep_map[event.id] = (short_id, name, event.payload.status)
63
- render_status(ep_map)
62
+ if isinstance(event, AnalysisRunStatusEventData):
63
+ if event.payload.node_id in ep_map:
64
+ short_id, name, _ = ep_map[event.payload.node_id]
65
+ ep_map[event.payload.node_id] = (short_id, name, event.payload.status)
66
+ live.update(render_status(ep_map))
64
67
  else:
65
68
  for event in run_result.stream_completion():
66
- if event.id in ep_map:
67
- short_id, name, _ = ep_map[event.id]
68
- ep_map[event.id] = (short_id, name, event.payload.status)
69
+ if isinstance(event, AnalysisRunStatusEventData):
70
+ if event.payload.node_id in ep_map:
71
+ short_id, name, _ = ep_map[event.payload.node_id]
72
+ ep_map[event.payload.node_id] = (short_id, name, event.payload.status)
69
73
 
70
74
  n_failures = sum(1 if status == "failed" else 0 for _, _, status in ep_map.values())
71
75
  if n_failures > 0:
@@ -7,6 +7,7 @@ from bevor_sdk._sync.resources._modules import EventResource
7
7
  from bevor_sdk.types import ID
8
8
  from bevor_sdk.types.literals import AnalysisRunStatus
9
9
  from bevor_sdk.types.requests.security import RunAnalysisBodyDict
10
+ from bevor_sdk.types.responses.events import AnalysisRunStatusEventData
10
11
  from rich.live import Live
11
12
  from rich.table import Table
12
13
 
@@ -39,11 +40,10 @@ def run_analysis(
39
40
  creds.require_token()
40
41
 
41
42
  state = State.load()
42
- workspace_id = state.validate_workspace()
43
43
 
44
44
  wait = not no_wait
45
45
  client = BevorInternalClient(
46
- creds=creds, workspace_id=workspace_id, project_id=state.validate_project()
46
+ creds=creds, workspace_id=state.validate_workspace(), project_id=state.validate_project()
47
47
  )
48
48
 
49
49
  opts: RunAnalysisBodyDict = {}
@@ -67,15 +67,17 @@ def run_analysis(
67
67
  if not silent:
68
68
  with Live(render_status(ep_map), console=output.console, refresh_per_second=8) as live:
69
69
  for event in run_result.stream_completion():
70
- if event.id in ep_map:
71
- short_id, name, _ = ep_map[event.id]
72
- ep_map[event.id] = (short_id, name, event.payload.status)
73
- live.update(render_status(ep_map))
70
+ if isinstance(event, AnalysisRunStatusEventData):
71
+ if event.payload.node_id in ep_map:
72
+ short_id, name, _ = ep_map[event.payload.node_id]
73
+ ep_map[event.payload.node_id] = (short_id, name, event.payload.status)
74
+ live.update(render_status(ep_map))
74
75
  else:
75
76
  for event in run_result.stream_completion():
76
- if event.id in ep_map:
77
- short_id, name, _ = ep_map[event.id]
78
- ep_map[event.id] = (short_id, name, event.payload.status)
77
+ if isinstance(event, AnalysisRunStatusEventData):
78
+ if event.payload.node_id in ep_map:
79
+ short_id, name, _ = ep_map[event.payload.node_id]
80
+ ep_map[event.payload.node_id] = (short_id, name, event.payload.status)
79
81
 
80
82
  n_failures = sum(1 if status == "failed" else 0 for _, _, status in ep_map.values())
81
83
  if n_failures > 0:
@@ -126,8 +126,10 @@ def login() -> None:
126
126
  raise typer.Exit(1)
127
127
 
128
128
  raw = payload["token"]
129
+ output.info(f"TOKEN {raw}")
129
130
  bearer = raw if raw.startswith("cli_") else f"cli_{raw}"
130
131
  creds = Credentials.save(token=bearer)
132
+ output.info(f"CREDS {creds.model_dump_json()}")
131
133
 
132
134
  client = BevorInternalBusinessClient(creds=creds)
133
135
  user = client.me()
@@ -5,7 +5,7 @@ from typing import Optional
5
5
 
6
6
  import typer
7
7
  from bevor_sdk.exceptions import NotFoundError
8
- from bevor_sdk.helpers.source_fingerprint import zip_source_tree
8
+ from bevor_sdk.helpers.source_fingerprint import directory_files, fingerprint_source
9
9
  from bevor_sdk.types import ID
10
10
 
11
11
  from bevor_cli import output
@@ -39,14 +39,17 @@ def push_code(
39
39
  root = path or Path.cwd()
40
40
  try:
41
41
  with output.spinner("Packaging source tree..."):
42
- zip_bytes, n_files, content_hash = zip_source_tree(root)
42
+ root = root.resolve()
43
+ zip_bytes, n_files, _, fingerprint = fingerprint_source(directory_files(root), root.name)
44
+ if n_files == 0:
45
+ raise ValueError("no UTF-8 source files found after filters")
43
46
  except ValueError as exc:
44
47
  output.error(str(exc), hint="Make sure you're in the project root directory.")
45
48
  raise typer.Exit(1)
46
49
  size_kb = len(zip_bytes) // 1024
47
50
  output.info(f"Compressed {n_files} files → {size_kb} KB")
48
51
 
49
- if state.code_id and state.code_fingerprint == content_hash:
52
+ if state.code_id and state.code_fingerprint == fingerprint:
50
53
  # requests are project-scoped, so a code that still resolves belongs to the linked project.
51
54
  try:
52
55
  client.codes.get(ID(state.code_id))
@@ -4,7 +4,7 @@ from pathlib import Path
4
4
  from typing import Optional
5
5
 
6
6
  import typer
7
- from bevor_sdk.helpers.source_fingerprint import zip_source_tree
7
+ from bevor_sdk.helpers.source_fingerprint import directory_files, fingerprint_source
8
8
  from bevor_sdk.types import ID
9
9
  from rich.table import Table
10
10
 
@@ -47,7 +47,7 @@ def view_code(
47
47
  return
48
48
 
49
49
  root = Path.cwd()
50
- _, _, content_hash = zip_source_tree(root)
50
+ _, _, _, fingerprint = fingerprint_source(directory_files(root), root.name)
51
51
 
52
52
  table = Table(show_header=False, box=None, padding=(0, 1))
53
53
  table.add_column(style="bold")
@@ -57,7 +57,7 @@ def view_code(
57
57
  table.add_row("Status", code.status)
58
58
  table.add_row("Version method", code.version_method)
59
59
  table.add_row("Fingerprint", code.version_fingerprint)
60
- table.add_row("In sync (cwd)", str(content_hash == code.version_fingerprint))
60
+ table.add_row("In sync (cwd)", str(fingerprint == code.version_fingerprint))
61
61
  table.add_row("Created", str(code.created_at.date()))
62
62
 
63
63
  if code.network:
@@ -31,6 +31,7 @@ class Credentials(BaseModel):
31
31
 
32
32
  @classmethod
33
33
  def save(cls, token: str) -> "Credentials":
34
+ print(_CREDENTIALS_PATH, token)
34
35
  _CREDENTIALS_PATH.parent.mkdir(parents=True, exist_ok=True)
35
36
  _CREDENTIALS_PATH.write_text(
36
37
  json.dumps(
@@ -16,11 +16,6 @@ _CONFIG_DIR = ".bevor"
16
16
  _CONFIG_FILE = "config.json"
17
17
 
18
18
 
19
- def _state_path(cwd: Path | None = None) -> Path:
20
- base = cwd or Path.cwd()
21
- return base / _CONFIG_DIR / _CONFIG_FILE
22
-
23
-
24
19
  class State(BaseModel):
25
20
  workspace_id: Optional[str] = None
26
21
  project_id: Optional[str] = None
@@ -28,9 +23,14 @@ class State(BaseModel):
28
23
  code_fingerprint: Optional[str] = None
29
24
  analysis_id: Optional[str] = None
30
25
 
26
+ @staticmethod
27
+ def _path(cls, cwd: Path | None = None) -> Path:
28
+ base = cwd or Path.cwd()
29
+ return base / _CONFIG_DIR / _CONFIG_FILE
30
+
31
31
  @classmethod
32
32
  def load(cls, cwd: Path | None = None) -> "State":
33
- path = _state_path(cwd)
33
+ path = cls._path(cwd)
34
34
  if not path.exists():
35
35
  return cls()
36
36
  try:
@@ -40,7 +40,7 @@ class State(BaseModel):
40
40
  return cls()
41
41
 
42
42
  def save(self, cwd: Path | None = None) -> None:
43
- path = _state_path(cwd)
43
+ path = self._path(cwd)
44
44
  path.parent.mkdir(parents=True, exist_ok=True)
45
45
  path.write_text(self.model_dump_json(indent=2))
46
46
 
@@ -96,7 +96,9 @@ class State(BaseModel):
96
96
  if fallback:
97
97
  return ID(fallback)
98
98
 
99
- output.error("Code Configuration required", hint="Run `bevor codes push` or `bevor codes select`.")
99
+ output.error(
100
+ "Code Configuration required", hint="Run `bevor codes push` or `bevor codes select`."
101
+ )
100
102
  raise typer.Exit(1)
101
103
 
102
104
  def validate_analysis(self, priority: str | None = None, fallback: str | None = None) -> ID:
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "bevor-cli"
3
- version = "0.1.1"
3
+ version = "0.1.2"
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.1.1",
7
+ "bevor-sdk==0.1.2",
8
8
  "typer~=0.26",
9
9
  "httpx~=0.28",
10
10
  "pydantic~=2.12",
File without changes
File without changes
File without changes
File without changes
File without changes