chatsbom 0.2.5__py3-none-any.whl → 0.2.7__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.
chatsbom/__main__.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import typer
2
2
 
3
+ from chatsbom.__version__ import __version__
3
4
  from chatsbom.commands import chat
4
5
  from chatsbom.commands import collect
5
6
  from chatsbom.commands import convert
@@ -8,13 +9,35 @@ from chatsbom.commands import index
8
9
  from chatsbom.commands import query
9
10
  from chatsbom.commands import status
10
11
 
12
+
13
+ def version_callback(value: bool):
14
+ """Print version and exit."""
15
+ if value:
16
+ typer.echo(f"ChatSBOM version {__version__}")
17
+ raise typer.Exit()
18
+
19
+
11
20
  app = typer.Typer(
12
21
  help='ChatSBOM - Talk to your Supply Chain. Chat with SBOMs.',
13
22
  no_args_is_help=True,
14
23
  add_completion=False,
15
24
  )
16
25
 
17
- # Commands ordered by typical workflow
26
+
27
+ @app.callback()
28
+ def main(
29
+ version: bool = typer.Option(
30
+ None,
31
+ '--version',
32
+ '-v',
33
+ help='Show version and exit',
34
+ callback=version_callback,
35
+ is_eager=True,
36
+ ),
37
+ ):
38
+ """ChatSBOM - Talk to your Supply Chain. Chat with SBOMs."""
39
+
40
+
18
41
  app.command(name='collect')(collect.main)
19
42
  app.command(name='download')(download.main)
20
43
  app.command(name='convert')(convert.main)
@@ -0,0 +1,19 @@
1
+ """Version information for ChatSBOM."""
2
+ from importlib.metadata import PackageNotFoundError
3
+ from importlib.metadata import version
4
+
5
+
6
+ def get_version() -> str:
7
+ """
8
+ Get version from installed package metadata.
9
+
10
+ Returns:
11
+ Version string (e.g., "0.2.6")
12
+ """
13
+ try:
14
+ return version('chatsbom')
15
+ except PackageNotFoundError:
16
+ return '0.0.0-dev'
17
+
18
+
19
+ __version__ = get_version()
chatsbom/commands/chat.py CHANGED
@@ -66,6 +66,11 @@ class ClickHouseConfig:
66
66
  'CLICKHOUSE_PASSWORD', 'guest',
67
67
  ),
68
68
  )
69
+ database: str = field(
70
+ default_factory=lambda: os.getenv(
71
+ 'CLICKHOUSE_DATABASE', 'chatsbom',
72
+ ),
73
+ )
69
74
 
70
75
  def to_env(self) -> dict[str, str]:
71
76
  return {
@@ -73,6 +78,7 @@ class ClickHouseConfig:
73
78
  'CLICKHOUSE_PORT': self.port,
74
79
  'CLICKHOUSE_USER': self.user,
75
80
  'CLICKHOUSE_PASSWORD': self.password,
81
+ 'CLICKHOUSE_DATABASE': self.database,
76
82
  'CLICKHOUSE_ROLE': '',
77
83
  'CLICKHOUSE_SECURE': 'false',
78
84
  'CLICKHOUSE_VERIFY': 'false',
@@ -265,6 +271,7 @@ def main(
265
271
  port: str = typer.Option('8123', envvar='CLICKHOUSE_PORT'),
266
272
  user: str = typer.Option('guest', envvar='CLICKHOUSE_USER'),
267
273
  password: str = typer.Option('guest', envvar='CLICKHOUSE_PASSWORD'),
274
+ database: str = typer.Option('chatsbom', envvar='CLICKHOUSE_DATABASE'),
268
275
  ):
269
276
  """Start an AI conversation about your SBOM data."""
270
277
  from rich.console import Console
@@ -291,7 +298,7 @@ def main(
291
298
  from chatsbom.core.clickhouse import check_clickhouse_connection
292
299
  check_clickhouse_connection(
293
300
  host=host, port=int(port), user=user, password=password,
294
- database='chatsbom', console=console, require_database=True,
301
+ database=database, console=console, require_database=True,
295
302
  )
296
303
 
297
- ChatSBOMApp(ClickHouseConfig(host, port, user, password)).run()
304
+ ChatSBOMApp(ClickHouseConfig(host, port, user, password, database)).run()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chatsbom
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: ChatSBOM - Talk to your Supply Chain. Chat with SBOMs.
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: claude-agent-sdk>=0.1.0
@@ -1,7 +1,8 @@
1
1
  chatsbom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- chatsbom/__main__.py,sha256=l85yHKwKPYJNIa9b1pRD_DlQVeZOofOOoPn2qR5cKjU,772
2
+ chatsbom/__main__.py,sha256=QVs4sO1YUqJt642_Gw4wyiDBwQ5YeL4I9v_xEDkTPdM,1228
3
+ chatsbom/__version__.py,sha256=JodF7HbCCwUPFhWltShEeNCAWHPTwRcPvSm7qWfMTCQ,411
3
4
  chatsbom/commands/__init__.py,sha256=vOL_QwoyFQhEIfs-rf0LVieAjStfkqlhqkjaZ_1p7gQ,15
4
- chatsbom/commands/chat.py,sha256=ns9DFTjGJwVD_m6K2m0Flg-LQSmmhAMKjnkzPPfBYYg,10968
5
+ chatsbom/commands/chat.py,sha256=_X0bgXKIKTLAR-UKry0guCeRtnh08Bou5io5sTnYHBc,11236
5
6
  chatsbom/commands/collect.py,sha256=ApweQztO889o4X4lBrxlIwdYorDUSiE01M4-XMO0HUM,16536
6
7
  chatsbom/commands/convert.py,sha256=etc6s_tT4VAvjOCZs8dnHppbTYEeAHI6kHJikkUWD64,8249
7
8
  chatsbom/commands/download.py,sha256=I9TwEXO1zrh9-DwvUUMh4iZ1W5ZCXbtE4jcJiK2KqnY,10218
@@ -18,7 +19,7 @@ chatsbom/core/validation.py,sha256=v4boiht4hK73nuZNYpzLTkZKsNSoFPMUDIX-8sP2E9g,3
18
19
  chatsbom/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
20
  chatsbom/models/framework.py,sha256=Whlsbnn64YwftMifMEMVvhsWADC9uupBV4QN1i1BoNQ,2833
20
21
  chatsbom/models/language.py,sha256=RgbBQZfG630uNZ7w-BtB1LZ5B5Q_nEExGrwUadfpRqE,3601
21
- chatsbom-0.2.5.dist-info/METADATA,sha256=tQ22i_CxWaEONk3OrdqVdlAAcfLbU8DDuEFOrcVPjwA,4115
22
- chatsbom-0.2.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
23
- chatsbom-0.2.5.dist-info/entry_points.txt,sha256=906Ig6u2FwWk3ftNi4mth03N1NRgP4-B2p9kpppcqWA,51
24
- chatsbom-0.2.5.dist-info/RECORD,,
22
+ chatsbom-0.2.7.dist-info/METADATA,sha256=--56Qd-BYDIvcJIvbypG5jGM8Hch2Zd0XcnRn6LDaCY,4115
23
+ chatsbom-0.2.7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
24
+ chatsbom-0.2.7.dist-info/entry_points.txt,sha256=906Ig6u2FwWk3ftNi4mth03N1NRgP4-B2p9kpppcqWA,51
25
+ chatsbom-0.2.7.dist-info/RECORD,,