bevor-cli 0.2.1__tar.gz → 0.2.2rc1__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.
- bevor_cli-0.2.2rc1/PKG-INFO +44 -0
- bevor_cli-0.2.2rc1/README.md +27 -0
- bevor_cli-0.2.2rc1/bevor_cli/__init__.py +3 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/actions.py +2 -2
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/apps/analyses.py +3 -2
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/apps/findings.py +2 -3
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/apps/main.py +5 -6
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/callbacks/notify.py +3 -5
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/callbacks/version.py +3 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/client.py +1 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/chats/get.py +2 -2
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/chats/list.py +4 -4
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/chats/messages.py +5 -3
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/chats/resume.py +1 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/chats/session.py +15 -15
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/create.py +9 -10
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/delete.py +1 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/deselect.py +1 -1
- bevor_cli-0.2.2rc1/bevor_cli/commands/analyses/diffs.py +76 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/entrypoints.py +5 -5
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/fork.py +1 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/lineage.py +10 -10
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/list.py +5 -5
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/materialize.py +5 -5
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/merge.py +1 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/run.py +17 -7
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/select.py +1 -2
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/set_head.py +1 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/transitions.py +9 -5
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/view.py +4 -4
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/auth/login.py +3 -5
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/auth/logout.py +1 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/auth/whoami.py +3 -4
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/codes/list.py +4 -5
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/codes/push.py +29 -11
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/codes/select.py +2 -3
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/codes/view.py +3 -4
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/findings/acknowledge.py +1 -1
- bevor_cli-0.2.2rc1/bevor_cli/commands/findings/add.py +251 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/findings/delete.py +3 -3
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/findings/edit.py +4 -8
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/findings/get.py +3 -3
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/findings/import_findings.py +18 -11
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/findings/interactive.py +5 -5
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/findings/list.py +12 -9
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/findings/undo.py +2 -2
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/graph/call_chain.py +17 -9
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/graph/edges.py +5 -5
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/graph/interactive.py +20 -20
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/graph/renderer.py +2 -3
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/link/__init__.py +1 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/nodes/get.py +3 -4
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/nodes/list.py +3 -4
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/nodes/source.py +2 -3
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/projects/create.py +1 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/projects/list.py +4 -4
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/projects/select.py +3 -4
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/projects/view.py +3 -3
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/reflog/__init__.py +4 -4
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/sessions/list.py +3 -3
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/sessions/revoke.py +1 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/status/__init__.py +4 -6
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/sync/__init__.py +1 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/workspaces/list.py +4 -4
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/workspaces/select.py +3 -4
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/workspaces/view.py +3 -3
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/configuration/creds.py +1 -2
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/configuration/state.py +1 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/findings_yaml.py +118 -111
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/fingerprint.py +1 -1
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/main.py +1 -1
- bevor_cli-0.2.2rc1/bevor_cli/output.py +87 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/pyproject.toml +2 -2
- bevor_cli-0.2.1/PKG-INFO +0 -131
- bevor_cli-0.2.1/README.md +0 -114
- bevor_cli-0.2.1/bevor_cli/commands/findings/add.py +0 -246
- bevor_cli-0.2.1/bevor_cli/configuration/__init__.py +0 -0
- bevor_cli-0.2.1/bevor_cli/output.py +0 -93
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/.gitignore +0 -0
- {bevor_cli-0.2.1/bevor_cli → bevor_cli-0.2.2rc1/bevor_cli/annotations}/__init__.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/annotations/confirmations.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/annotations/literal_args.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/annotations/query.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/apps/chat.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/apps/codes.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/apps/nodes.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/apps/projects.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/apps/sessions.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/apps/workspaces.py +0 -0
- {bevor_cli-0.2.1/bevor_cli/annotations → bevor_cli-0.2.2rc1/bevor_cli/callbacks}/__init__.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/callbacks/upgrade.py +0 -0
- {bevor_cli-0.2.1/bevor_cli/callbacks → bevor_cli-0.2.2rc1/bevor_cli/commands}/__init__.py +0 -0
- {bevor_cli-0.2.1/bevor_cli/commands → bevor_cli-0.2.2rc1/bevor_cli/commands/analyses}/__init__.py +0 -0
- {bevor_cli-0.2.1/bevor_cli/commands/analyses → bevor_cli-0.2.2rc1/bevor_cli/commands/analyses/chats}/__init__.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/analyses/chats/new.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/auth/__init__.py +0 -0
- {bevor_cli-0.2.1/bevor_cli/commands/analyses/chats → bevor_cli-0.2.2rc1/bevor_cli/commands/codes}/__init__.py +0 -0
- {bevor_cli-0.2.1/bevor_cli/commands/codes → bevor_cli-0.2.2rc1/bevor_cli/commands/findings}/__init__.py +0 -0
- {bevor_cli-0.2.1/bevor_cli/commands/findings → bevor_cli-0.2.2rc1/bevor_cli/commands/graph}/__init__.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/link/helpers.py +0 -0
- {bevor_cli-0.2.1/bevor_cli/commands/graph → bevor_cli-0.2.2rc1/bevor_cli/commands/nodes}/__init__.py +0 -0
- {bevor_cli-0.2.1/bevor_cli/commands/nodes → bevor_cli-0.2.2rc1/bevor_cli/commands/projects}/__init__.py +0 -0
- {bevor_cli-0.2.1/bevor_cli/commands/projects → bevor_cli-0.2.2rc1/bevor_cli/commands/sessions}/__init__.py +0 -0
- {bevor_cli-0.2.1/bevor_cli/commands/sessions → bevor_cli-0.2.2rc1/bevor_cli/commands/workspaces}/__init__.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/commands/workspaces/pick.py +0 -0
- {bevor_cli-0.2.1/bevor_cli/commands/workspaces → bevor_cli-0.2.2rc1/bevor_cli/configuration}/__init__.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/configuration/logs.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/configuration/update.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/select.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/settings.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/bevor_cli/target.py +0 -0
- {bevor_cli-0.2.1 → bevor_cli-0.2.2rc1}/cli-hierarchy.py +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: bevor-cli
|
|
3
|
+
Version: 0.2.2rc1
|
|
4
|
+
Summary: Bevor CLI tool for security analysis and graph inspection
|
|
5
|
+
Classifier: Development Status :: 3 - Alpha
|
|
6
|
+
Requires-Python: >=3.13
|
|
7
|
+
Requires-Dist: bevor-sdk==0.2.2rc1
|
|
8
|
+
Requires-Dist: click~=8.1
|
|
9
|
+
Requires-Dist: httpx~=0.28
|
|
10
|
+
Requires-Dist: packaging~=26.2
|
|
11
|
+
Requires-Dist: pydantic~=2.12
|
|
12
|
+
Requires-Dist: pyyaml~=6.0
|
|
13
|
+
Requires-Dist: questionary~=2.0
|
|
14
|
+
Requires-Dist: rich~=15.0
|
|
15
|
+
Requires-Dist: typer<0.29,>=0.26
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# Bevor CLI
|
|
19
|
+
|
|
20
|
+
The official command-line interface for [Bevor](https://www.bevor.io/docs/cli-reference) — smart contract security analysis and code graph exploration.
|
|
21
|
+
|
|
22
|
+
Use `bevor` to upload codebases, run security analyses, explore the code graph interactively, and manage findings — all from your terminal. Supported languages can be found [Here](https://www.bevor.io/docs/languages).
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
curl -LsSf https://bevor.io/install.sh | bash
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Setup
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
bevor --help
|
|
38
|
+
|
|
39
|
+
bevor login
|
|
40
|
+
bevor link
|
|
41
|
+
#
|
|
42
|
+
bevor codes push
|
|
43
|
+
bevor analyses create
|
|
44
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Bevor CLI
|
|
2
|
+
|
|
3
|
+
The official command-line interface for [Bevor](https://www.bevor.io/docs/cli-reference) — smart contract security analysis and code graph exploration.
|
|
4
|
+
|
|
5
|
+
Use `bevor` to upload codebases, run security analyses, explore the code graph interactively, and manage findings — all from your terminal. Supported languages can be found [Here](https://www.bevor.io/docs/languages).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
curl -LsSf https://bevor.io/install.sh | bash
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bevor --help
|
|
21
|
+
|
|
22
|
+
bevor login
|
|
23
|
+
bevor link
|
|
24
|
+
#
|
|
25
|
+
bevor codes push
|
|
26
|
+
bevor analyses create
|
|
27
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from bevor_sdk.types.responses import ActionDetails, AnalysisActions
|
|
2
2
|
|
|
3
|
-
from bevor_cli.output import
|
|
3
|
+
from bevor_cli.output import output
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def action_commands(actions: AnalysisActions) -> list[tuple[str, ActionDetails]]:
|
|
@@ -18,4 +18,4 @@ def action_commands(actions: AnalysisActions) -> list[tuple[str, ActionDetails]]
|
|
|
18
18
|
|
|
19
19
|
def print_actions(actions: AnalysisActions, label_width: int, separator: str = "") -> None:
|
|
20
20
|
allowed = [label for label, details in action_commands(actions) if details.is_allowed]
|
|
21
|
-
|
|
21
|
+
output.print(f"{'Can run':<{label_width}}{separator} {', '.join(allowed) or '(nothing)'}")
|
|
@@ -5,6 +5,7 @@ from bevor_cli.commands.analyses.delete import (
|
|
|
5
5
|
delete_analysis_version,
|
|
6
6
|
)
|
|
7
7
|
from bevor_cli.commands.analyses.deselect import deselect_analysis
|
|
8
|
+
from bevor_cli.commands.analyses.diffs import list_diffs
|
|
8
9
|
from bevor_cli.commands.analyses.entrypoints import list_entrypoints
|
|
9
10
|
from bevor_cli.commands.analyses.fork import fork_analysis
|
|
10
11
|
from bevor_cli.commands.analyses.lineage import lineage_analysis
|
|
@@ -21,8 +22,7 @@ app = typer.Typer(
|
|
|
21
22
|
help=(
|
|
22
23
|
"Manage analyses.\n\n"
|
|
23
24
|
"An analysis is a history of versions, like a git repository. HEAD is the version commands "
|
|
24
|
-
"act on by default; pass --version to target another.
|
|
25
|
-
"sit on HEAD until you commit them, which creates a new version. After a code change, "
|
|
25
|
+
"act on by default; pass --version to target another. After a code change, "
|
|
26
26
|
"`bevor sync` pushes it and adds it as a new version."
|
|
27
27
|
),
|
|
28
28
|
no_args_is_help=True,
|
|
@@ -42,6 +42,7 @@ app.command("run")(run_analysis)
|
|
|
42
42
|
app.command("entrypoints")(list_entrypoints)
|
|
43
43
|
app.command("materialize")(materialize_analysis)
|
|
44
44
|
app.command("transitions")(list_transitions)
|
|
45
|
+
app.command("diffs")(list_diffs)
|
|
45
46
|
|
|
46
47
|
app.command("set-head")(set_analysis_head)
|
|
47
48
|
|
|
@@ -13,9 +13,8 @@ from bevor_cli.commands.findings.undo import undo_change
|
|
|
13
13
|
|
|
14
14
|
app = typer.Typer(
|
|
15
15
|
help=(
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"`bevor analyses commit` turns them into a new version."
|
|
16
|
+
"Review and search findings.\n\n"
|
|
17
|
+
"Add, import, edit, and delete changes on HEAD of the selected analysis; "
|
|
19
18
|
),
|
|
20
19
|
no_args_is_help=True,
|
|
21
20
|
)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import subprocess
|
|
2
2
|
|
|
3
3
|
import typer
|
|
4
|
-
from bevor_cli import output
|
|
5
4
|
from bevor_cli.apps import (
|
|
6
5
|
analyses,
|
|
7
6
|
chat,
|
|
@@ -23,7 +22,7 @@ from bevor_cli.commands.link import run_link
|
|
|
23
22
|
from bevor_cli.commands.reflog import run_reflog
|
|
24
23
|
from bevor_cli.commands.status import run_status
|
|
25
24
|
from bevor_cli.commands.sync import run_sync
|
|
26
|
-
from bevor_cli.output import
|
|
25
|
+
from bevor_cli.output import output
|
|
27
26
|
|
|
28
27
|
app = typer.Typer(
|
|
29
28
|
name="bevor",
|
|
@@ -54,14 +53,14 @@ def _root(
|
|
|
54
53
|
if ctx.invoked_subcommand != "upgrade" and _update_check_enabled(quiet):
|
|
55
54
|
ctx.call_on_close(_notify_if_outdated)
|
|
56
55
|
|
|
57
|
-
output.
|
|
56
|
+
output.quiet = quiet
|
|
58
57
|
|
|
59
58
|
|
|
60
59
|
@app.command("help")
|
|
61
60
|
def help_command(ctx: typer.Context) -> None:
|
|
62
61
|
"""Show root help text (alias for --help)."""
|
|
63
62
|
root_ctx = ctx.parent or ctx
|
|
64
|
-
|
|
63
|
+
output.info(root_ctx.get_help())
|
|
65
64
|
|
|
66
65
|
|
|
67
66
|
@app.command("upgrade")
|
|
@@ -70,10 +69,10 @@ def upgrade() -> None:
|
|
|
70
69
|
current = _current_version()
|
|
71
70
|
latest = _latest_version()
|
|
72
71
|
if current >= latest:
|
|
73
|
-
|
|
72
|
+
output.info(f"Already on the latest version ({current}).")
|
|
74
73
|
return
|
|
75
74
|
|
|
76
|
-
|
|
75
|
+
output.info(f"Upgrading {current} → {latest}")
|
|
77
76
|
result = subprocess.run(_upgrade_command())
|
|
78
77
|
raise typer.Exit(result.returncode)
|
|
79
78
|
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import sys
|
|
3
3
|
|
|
4
|
-
import typer
|
|
5
|
-
|
|
6
4
|
from bevor_cli.callbacks.version import _current_version
|
|
7
5
|
from bevor_cli.configuration.update import UpdateCheck
|
|
6
|
+
from bevor_cli.output import output
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
def _notify_if_outdated() -> None:
|
|
11
10
|
check = UpdateCheck.refresh()
|
|
12
11
|
if check and check.is_outdated:
|
|
13
|
-
|
|
12
|
+
output.hint(
|
|
14
13
|
f"\nA new version of bevor-cli is available: {_current_version()} → {check.latest}\n"
|
|
15
|
-
"Run `bevor upgrade` to update."
|
|
16
|
-
err=True,
|
|
14
|
+
"Run `bevor upgrade` to update."
|
|
17
15
|
)
|
|
18
16
|
|
|
19
17
|
|
|
@@ -5,6 +5,8 @@ import urllib.request
|
|
|
5
5
|
import typer
|
|
6
6
|
from packaging.version import Version
|
|
7
7
|
|
|
8
|
+
from bevor_cli.output import output
|
|
9
|
+
|
|
8
10
|
PACKAGE = "bevor-cli"
|
|
9
11
|
|
|
10
12
|
|
|
@@ -21,5 +23,5 @@ def _latest_version(timeout: float = 5) -> Version:
|
|
|
21
23
|
def _version_callback(value: bool) -> None:
|
|
22
24
|
if not value:
|
|
23
25
|
return
|
|
24
|
-
|
|
26
|
+
output.data(f"bevor-cli {_current_version()}")
|
|
25
27
|
raise typer.Exit()
|
|
@@ -10,9 +10,9 @@ from bevor_sdk import BevorClient
|
|
|
10
10
|
from bevor_sdk.exceptions import ERROR_REGISTRY, BevorErrorTypes
|
|
11
11
|
from httpx._types import QueryParamTypes, TimeoutTypes
|
|
12
12
|
|
|
13
|
-
from bevor_cli import output
|
|
14
13
|
from bevor_cli.callbacks.version import _current_version
|
|
15
14
|
from bevor_cli.configuration.creds import Credentials
|
|
15
|
+
from bevor_cli.output import output
|
|
16
16
|
from bevor_cli.settings import API_URL
|
|
17
17
|
|
|
18
18
|
|
|
@@ -8,7 +8,7 @@ from bevor_cli.annotations.confirmations import JSON_OUT
|
|
|
8
8
|
from bevor_cli.client import BevorInternalClient
|
|
9
9
|
from bevor_cli.configuration.creds import Credentials
|
|
10
10
|
from bevor_cli.configuration.state import State
|
|
11
|
-
from bevor_cli.output import
|
|
11
|
+
from bevor_cli.output import output
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def get_chat(chat_id: str = typer.Argument(..., help="Chat ID."), json_out: JSON_OUT = False) -> None:
|
|
@@ -25,7 +25,7 @@ def get_chat(chat_id: str = typer.Argument(..., help="Chat ID."), json_out: JSON
|
|
|
25
25
|
chat = client.chats.get(ID(chat_id))
|
|
26
26
|
|
|
27
27
|
if json_out:
|
|
28
|
-
|
|
28
|
+
output.json(chat.model_dump_json(indent=2))
|
|
29
29
|
return
|
|
30
30
|
|
|
31
31
|
table = Table(show_header=False, box=None, padding=(0, 1))
|
|
@@ -11,7 +11,7 @@ from bevor_cli.annotations.query import ORDER, ORDER_BY, PAGE, PAGE_SIZE
|
|
|
11
11
|
from bevor_cli.client import BevorInternalClient
|
|
12
12
|
from bevor_cli.configuration.creds import Credentials
|
|
13
13
|
from bevor_cli.configuration.state import State
|
|
14
|
-
from bevor_cli.output import
|
|
14
|
+
from bevor_cli.output import output
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
def list_chats(
|
|
@@ -47,11 +47,11 @@ def list_chats(
|
|
|
47
47
|
found = client.chats.list(params=query_params)
|
|
48
48
|
|
|
49
49
|
if json_out:
|
|
50
|
-
|
|
50
|
+
output.json(found.model_dump_json(indent=2))
|
|
51
51
|
return
|
|
52
52
|
|
|
53
53
|
if not found.results:
|
|
54
|
-
|
|
54
|
+
output.print("No chats found.")
|
|
55
55
|
return
|
|
56
56
|
|
|
57
57
|
table = Table("ID", "Title", "Code", "Version", "Created")
|
|
@@ -64,4 +64,4 @@ def list_chats(
|
|
|
64
64
|
str(c.created_at.date()),
|
|
65
65
|
)
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
output.print(table)
|
|
@@ -4,12 +4,13 @@ import json
|
|
|
4
4
|
|
|
5
5
|
import typer
|
|
6
6
|
from bevor_sdk.types.shared import ID
|
|
7
|
+
from rich.markup import escape
|
|
7
8
|
|
|
8
9
|
from bevor_cli.annotations.confirmations import JSON_OUT
|
|
9
10
|
from bevor_cli.client import BevorInternalClient
|
|
10
11
|
from bevor_cli.configuration.creds import Credentials
|
|
11
12
|
from bevor_cli.configuration.state import State
|
|
12
|
-
from bevor_cli.output import
|
|
13
|
+
from bevor_cli.output import output
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
def chat_messages(
|
|
@@ -30,10 +31,11 @@ def chat_messages(
|
|
|
30
31
|
messages = client.chats.messages(ID(chat_id))
|
|
31
32
|
|
|
32
33
|
if json_out:
|
|
33
|
-
|
|
34
|
+
output.json(json.dumps([m.model_dump(mode="json") for m in messages.results], indent=2))
|
|
34
35
|
return
|
|
35
36
|
|
|
36
37
|
for m in messages.results:
|
|
37
38
|
role = m.chat_role or ""
|
|
38
39
|
text = m.message or ""
|
|
39
|
-
|
|
40
|
+
# message text is user content; escape it so brackets in it are not read as markup
|
|
41
|
+
output.print(escape(f"[{str(role):>9}] {text[:120]}"))
|
|
@@ -4,7 +4,6 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import typer
|
|
6
6
|
|
|
7
|
-
from bevor_cli import output
|
|
8
7
|
from bevor_cli.client import BevorInternalClient
|
|
9
8
|
from bevor_cli.commands.analyses.chats.session import (
|
|
10
9
|
_ensure_thread_matches_analysis,
|
|
@@ -12,6 +11,7 @@ from bevor_cli.commands.analyses.chats.session import (
|
|
|
12
11
|
)
|
|
13
12
|
from bevor_cli.configuration.creds import Credentials
|
|
14
13
|
from bevor_cli.configuration.state import State
|
|
14
|
+
from bevor_cli.output import output
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
def chat_resume(
|
|
@@ -18,8 +18,8 @@ from rich.markdown import CodeBlock, Markdown
|
|
|
18
18
|
from rich.panel import Panel
|
|
19
19
|
from rich.text import Text
|
|
20
20
|
|
|
21
|
-
from bevor_cli import output
|
|
22
21
|
from bevor_cli.client import BevorInternalClient
|
|
22
|
+
from bevor_cli.output import output
|
|
23
23
|
|
|
24
24
|
_CHAT_STYLE = questionary.Style(
|
|
25
25
|
[
|
|
@@ -123,17 +123,17 @@ def _run_stream_turn(
|
|
|
123
123
|
nonlocal live_text_active, final_stream_text
|
|
124
124
|
stop_stream_live()
|
|
125
125
|
if quiet_plain_fallback and final_stream_text is not None:
|
|
126
|
-
output.
|
|
126
|
+
output.print(
|
|
127
127
|
Markdown(_stream_markdown_markup(final_stream_text)),
|
|
128
128
|
end="\n",
|
|
129
129
|
)
|
|
130
130
|
live_text_active = False
|
|
131
131
|
final_stream_text = None
|
|
132
132
|
|
|
133
|
-
output.
|
|
133
|
+
output.print("\n[bold cyan]Assistant[/bold cyan]")
|
|
134
134
|
sys.stdout.flush()
|
|
135
135
|
|
|
136
|
-
if not output.
|
|
136
|
+
if not output.quiet:
|
|
137
137
|
spinner_thread = threading.Thread(
|
|
138
138
|
target=_recv_spinner,
|
|
139
139
|
args=(spinner_stop,),
|
|
@@ -152,7 +152,7 @@ def _run_stream_turn(
|
|
|
152
152
|
raw = str(obj.content or "")
|
|
153
153
|
final_stream_text = raw
|
|
154
154
|
markup = _stream_markdown_markup(raw)
|
|
155
|
-
if output.
|
|
155
|
+
if output.quiet:
|
|
156
156
|
live_text_active = True
|
|
157
157
|
continue
|
|
158
158
|
md = _stream_markdown_renderable(markup)
|
|
@@ -174,14 +174,14 @@ def _run_stream_turn(
|
|
|
174
174
|
continue
|
|
175
175
|
|
|
176
176
|
if live_text_active:
|
|
177
|
-
flush_streamed_markdown(quiet_plain_fallback=output.
|
|
177
|
+
flush_streamed_markdown(quiet_plain_fallback=output.quiet)
|
|
178
178
|
|
|
179
179
|
if obj.event_type == "thinking":
|
|
180
|
-
output.
|
|
180
|
+
output.print(f"[dim italic]{obj.content or 'thinking…'}[/dim italic]")
|
|
181
181
|
continue
|
|
182
182
|
|
|
183
183
|
if obj.event_type == "tool-call":
|
|
184
|
-
output.
|
|
184
|
+
output.print(f"[dim]tool[/dim] [yellow]{obj.content}[/yellow]")
|
|
185
185
|
continue
|
|
186
186
|
|
|
187
187
|
if obj.event_type == "approval":
|
|
@@ -190,14 +190,14 @@ def _run_stream_turn(
|
|
|
190
190
|
break
|
|
191
191
|
|
|
192
192
|
if obj.event_type == "failure":
|
|
193
|
-
output.
|
|
193
|
+
output.print(f"[bold red]{obj.content or 'Request failed'}[/bold red]")
|
|
194
194
|
break
|
|
195
195
|
|
|
196
196
|
if obj.event_type == "reference":
|
|
197
197
|
continue
|
|
198
198
|
|
|
199
199
|
if live_text_active:
|
|
200
|
-
flush_streamed_markdown(quiet_plain_fallback=output.
|
|
200
|
+
flush_streamed_markdown(quiet_plain_fallback=output.quiet)
|
|
201
201
|
finally:
|
|
202
202
|
stop_recv_spinner()
|
|
203
203
|
|
|
@@ -210,7 +210,7 @@ def _session_banner(*, analysis_id: str | None, version_id: str | None, thread_i
|
|
|
210
210
|
context += f"[bold]Analysis[/bold] {analysis_id}\n"
|
|
211
211
|
if version_id:
|
|
212
212
|
context += f"[bold]Version[/bold] {version_id}\n"
|
|
213
|
-
output.
|
|
213
|
+
output.print(
|
|
214
214
|
Panel.fit(
|
|
215
215
|
f"{context}[bold]Thread[/bold] {thread_id}\n\n"
|
|
216
216
|
"[dim]/quit · /exit · Ctrl+D · requires synced code (`bevor codes push`)[/dim]",
|
|
@@ -241,7 +241,7 @@ def _open_streaming_session(
|
|
|
241
241
|
try:
|
|
242
242
|
_interactive_loop(security, thread_id=thread_id)
|
|
243
243
|
except KeyboardInterrupt:
|
|
244
|
-
output.
|
|
244
|
+
output.print("\n[dim]Interrupted.[/dim]")
|
|
245
245
|
|
|
246
246
|
|
|
247
247
|
def _interactive_loop(client: BevorInternalClient, *, thread_id: str) -> None:
|
|
@@ -256,7 +256,7 @@ def _interactive_loop(client: BevorInternalClient, *, thread_id: str) -> None:
|
|
|
256
256
|
).ask()
|
|
257
257
|
|
|
258
258
|
if user_line is None:
|
|
259
|
-
output.
|
|
259
|
+
output.print("[dim]Goodbye.[/dim]")
|
|
260
260
|
break
|
|
261
261
|
|
|
262
262
|
text = user_line.strip()
|
|
@@ -264,7 +264,7 @@ def _interactive_loop(client: BevorInternalClient, *, thread_id: str) -> None:
|
|
|
264
264
|
continue
|
|
265
265
|
low = text.lower()
|
|
266
266
|
if low in ("/quit", "/exit", ":q", "exit", "quit"):
|
|
267
|
-
output.
|
|
267
|
+
output.print("[dim]Goodbye.[/dim]")
|
|
268
268
|
break
|
|
269
269
|
|
|
270
270
|
approval_id: str | None = None
|
|
@@ -291,5 +291,5 @@ def _interactive_loop(client: BevorInternalClient, *, thread_id: str) -> None:
|
|
|
291
291
|
continue
|
|
292
292
|
|
|
293
293
|
for row in refs:
|
|
294
|
-
output.
|
|
294
|
+
output.print(row)
|
|
295
295
|
break
|
|
@@ -7,13 +7,12 @@ from bevor_sdk.types.requests import AnalysisCreateChildBody, AnalysisCreateRoot
|
|
|
7
7
|
from bevor_sdk.types.responses import AnalysisCollisionResult, AnalysisCreatedResult
|
|
8
8
|
from rich.prompt import Confirm
|
|
9
9
|
|
|
10
|
-
from bevor_cli import output
|
|
11
10
|
from bevor_cli.annotations.confirmations import FORCE, JSON_OUT, YES
|
|
12
11
|
from bevor_cli.client import BevorInternalClient
|
|
13
12
|
from bevor_cli.configuration.creds import Credentials
|
|
14
13
|
from bevor_cli.configuration.state import State
|
|
15
14
|
from bevor_cli.fingerprint import require_code_in_sync
|
|
16
|
-
from bevor_cli.output import
|
|
15
|
+
from bevor_cli.output import output
|
|
17
16
|
from bevor_cli.target import resolve_target
|
|
18
17
|
|
|
19
18
|
Collision = Literal["surface", "force", "merge"]
|
|
@@ -74,7 +73,7 @@ def create_from_pushed_code(
|
|
|
74
73
|
state.save()
|
|
75
74
|
|
|
76
75
|
if json_out:
|
|
77
|
-
|
|
76
|
+
output.json(created.analysis.model_dump_json(indent=2))
|
|
78
77
|
elif start:
|
|
79
78
|
output.success(
|
|
80
79
|
f"Started analysis {created.analysis.id} and selected it. "
|
|
@@ -88,7 +87,7 @@ def create_from_pushed_code(
|
|
|
88
87
|
|
|
89
88
|
if isinstance(created, AnalysisCollisionResult):
|
|
90
89
|
if json_out:
|
|
91
|
-
|
|
90
|
+
output.json(created.model_dump_json(indent=2))
|
|
92
91
|
return
|
|
93
92
|
|
|
94
93
|
print_collision(created)
|
|
@@ -106,18 +105,18 @@ def print_collision(collision: AnalysisCollisionResult) -> None:
|
|
|
106
105
|
else f"bevor analyses view --version {candidate.id}"
|
|
107
106
|
)
|
|
108
107
|
|
|
109
|
-
|
|
108
|
+
output.print(
|
|
110
109
|
f"\n [bold]{meta.name}[/bold] ({owner}, {candidate.created_at.date()})"
|
|
111
110
|
f"\n analysis {meta.id} version {candidate.id}{head}"
|
|
112
111
|
)
|
|
113
|
-
|
|
112
|
+
output.print(f" view: {view}")
|
|
114
113
|
if candidate.on_collision == "fork":
|
|
115
|
-
|
|
114
|
+
output.print(f" fork: bevor analyses fork --version {candidate.id}")
|
|
116
115
|
elif candidate.on_collision == "merge":
|
|
117
|
-
|
|
116
|
+
output.print(f" merge: bevor analyses merge --from-version {candidate.id}")
|
|
118
117
|
else:
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
output.print(f" select: bevor analyses select {meta.id}")
|
|
119
|
+
output.print("\nTo create a new one anyway, pass --collision force.")
|
|
121
120
|
|
|
122
121
|
|
|
123
122
|
def create_analysis(
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import typer
|
|
4
4
|
from bevor_sdk.types.shared import ID
|
|
5
5
|
|
|
6
|
-
from bevor_cli import output
|
|
7
6
|
from bevor_cli.client import BevorInternalClient
|
|
8
7
|
from bevor_cli.configuration.creds import Credentials
|
|
9
8
|
from bevor_cli.configuration.state import State
|
|
9
|
+
from bevor_cli.output import output
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def delete_analysis_full() -> None:
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"""``bevor analyses transitions``."""
|
|
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, FindingDiff
|
|
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 output
|
|
17
|
+
from bevor_cli.target import resolve_target
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _snapshot(item: FindingDiff) -> FindingBare:
|
|
21
|
+
to_render = item.after_finding or item.before_finding
|
|
22
|
+
assert to_render
|
|
23
|
+
return to_render
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def list_diffs(
|
|
27
|
+
version: Optional[str] = typer.Option(
|
|
28
|
+
None,
|
|
29
|
+
"--version",
|
|
30
|
+
help="Use this version instead of HEAD.",
|
|
31
|
+
),
|
|
32
|
+
json_out: JSON_OUT = False,
|
|
33
|
+
) -> None:
|
|
34
|
+
"""
|
|
35
|
+
Get the complete set of changes to findings between this version's current
|
|
36
|
+
state and its parent version's current state, including additions, deletions,
|
|
37
|
+
and modifications. Includes changes not captured by recorded transitions.
|
|
38
|
+
Uses HEAD when no version is given (or ``--version``).
|
|
39
|
+
"""
|
|
40
|
+
creds = Credentials.load()
|
|
41
|
+
creds.require_token()
|
|
42
|
+
|
|
43
|
+
state = State.load()
|
|
44
|
+
workspace_id = state.validate_workspace()
|
|
45
|
+
|
|
46
|
+
client = BevorInternalClient(
|
|
47
|
+
creds=creds, workspace_id=workspace_id, project_id=state.validate_project()
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
opts = VersionIdentifierParam()
|
|
51
|
+
analysis_id, version_id = resolve_target(client, state, version)
|
|
52
|
+
if version_id:
|
|
53
|
+
opts["version_id"] = version_id
|
|
54
|
+
|
|
55
|
+
result = client.analyses.diffs(analysis_id=analysis_id, params=opts)
|
|
56
|
+
|
|
57
|
+
if json_out:
|
|
58
|
+
output.json(result.model_dump_json(indent=2))
|
|
59
|
+
return
|
|
60
|
+
|
|
61
|
+
if not result.results:
|
|
62
|
+
output.print("No diffs.")
|
|
63
|
+
return
|
|
64
|
+
|
|
65
|
+
table = Table("Kind", "Type", "Level", "Name", "Finding Id")
|
|
66
|
+
for item in result.results:
|
|
67
|
+
snapshot = _snapshot(item)
|
|
68
|
+
table.add_row(
|
|
69
|
+
item.kind,
|
|
70
|
+
snapshot.type,
|
|
71
|
+
Text(snapshot.level, style=LEVEL_COLORS[snapshot.level]),
|
|
72
|
+
snapshot.name,
|
|
73
|
+
snapshot.id,
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
output.print(table)
|
|
@@ -10,7 +10,7 @@ from bevor_cli.annotations.confirmations import JSON_OUT
|
|
|
10
10
|
from bevor_cli.client import BevorInternalClient
|
|
11
11
|
from bevor_cli.configuration.creds import Credentials
|
|
12
12
|
from bevor_cli.configuration.state import State
|
|
13
|
-
from bevor_cli.output import
|
|
13
|
+
from bevor_cli.output import output
|
|
14
14
|
from bevor_cli.target import resolve_target
|
|
15
15
|
|
|
16
16
|
|
|
@@ -41,14 +41,14 @@ def list_entrypoints(
|
|
|
41
41
|
page = client.analyses.entrypoints(analysis_id, opts)
|
|
42
42
|
|
|
43
43
|
if json_out:
|
|
44
|
-
|
|
44
|
+
output.json(json.dumps(page.model_dump(mode="json"), indent=2))
|
|
45
45
|
return
|
|
46
46
|
|
|
47
47
|
if not page.results:
|
|
48
|
-
|
|
48
|
+
output.print("No entrypoints.")
|
|
49
49
|
return
|
|
50
50
|
|
|
51
51
|
for s in page.results:
|
|
52
|
-
|
|
53
|
-
f"{s.
|
|
52
|
+
output.print(
|
|
53
|
+
f"{s.entrypoint.short_id} {s.entrypoint.name} ({s.entrypoint.file_path}) [{s.pipeline_status}]"
|
|
54
54
|
)
|
|
@@ -5,10 +5,10 @@ from typing import Optional
|
|
|
5
5
|
import typer
|
|
6
6
|
from bevor_sdk.types.requests import VersionIdentifierBody
|
|
7
7
|
|
|
8
|
-
from bevor_cli import output
|
|
9
8
|
from bevor_cli.client import BevorInternalClient
|
|
10
9
|
from bevor_cli.configuration.creds import Credentials
|
|
11
10
|
from bevor_cli.configuration.state import State
|
|
11
|
+
from bevor_cli.output import output
|
|
12
12
|
from bevor_cli.target import resolve_target
|
|
13
13
|
|
|
14
14
|
|