gibson-cli 0.1.0__py3-none-any.whl → 0.1.2__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.
command/Version.py ADDED
@@ -0,0 +1,8 @@
1
+ from conf.Version import Version as VersionConf
2
+ from .BaseCommand import BaseCommand
3
+
4
+
5
+ class Version(BaseCommand):
6
+ def execute(self):
7
+ self.conversation.type(VersionConf.num)
8
+ return True
command/auth/Login.py CHANGED
@@ -9,7 +9,10 @@ class Login(BaseCommand):
9
9
  token = cli.login()
10
10
 
11
11
  if token is None:
12
- self.conversation.type("Login failed, please try again.")
12
+ self.conversation.newline()
13
+ self.conversation.type(
14
+ "Login failed, please try again with `gibson auth login`."
15
+ )
13
16
  else:
14
17
  self.configuration.set_access_token(token)
15
18
  self.conversation.type(f"Welcome! You are now logged in.")
conf/Version.py CHANGED
@@ -1,2 +1,5 @@
1
+ from importlib import metadata
2
+
3
+
1
4
  class Version:
2
- NUM = "0.1.0"
5
+ num = metadata.version("gibson-cli")
core/CommandRouter.py CHANGED
@@ -28,6 +28,7 @@ from command.Show import Show
28
28
  from command.Test import Test
29
29
  from command.Tests import Tests
30
30
  from command.Tree import Tree
31
+ from command.Version import Version
31
32
  from command.WarGames import WarGames
32
33
  from .Configuration import Configuration
33
34
  from .Conversation import Conversation
@@ -242,6 +243,8 @@ class CommandRouter:
242
243
  command = Tree(self.configuration)
243
244
  elif sys.argv[1] in ["?", "q"]:
244
245
  command = Question(self.configuration)
246
+ elif sys.argv[1] in ["--version", "-v"]:
247
+ command = Version(self.configuration)
245
248
  else:
246
249
  command = WarGames(self.configuration)
247
250
 
core/Conversation.py CHANGED
@@ -132,7 +132,7 @@ class Conversation:
132
132
  def message_welcome(self):
133
133
  self.newline()
134
134
  print(pyfiglet.figlet_format("GibsonAI", font="big").rstrip(), end="")
135
- print(f" ...CLI v{Version.NUM}...")
135
+ print(f" ...CLI v{Version.num}...")
136
136
  self.newline()
137
137
  self.pause()
138
138
  self.type("Welcome!\n\n")
@@ -162,7 +162,7 @@ class Conversation:
162
162
  def new_project(self, configuration):
163
163
  self.newline()
164
164
  print(pyfiglet.figlet_format("GibsonAI", font="big").rstrip(), end="")
165
- print(f" ...CLI v{Version.NUM}...")
165
+ print(f" ...CLI v{Version.num}...")
166
166
  self.newline()
167
167
 
168
168
  if len(configuration.settings.keys()) <= 1:
@@ -1,9 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gibson-cli
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Gibson Command Line Interface
5
5
  Author-email: GibsonAI <noc@gibsonai.com>
6
6
  Project-URL: Homepage, https://gibsonai.com/
7
+ Project-URL: Documentation, https://docs.gibsonai.com/
8
+ Project-URL: Repository, https://github.com/gibsonai/cli
9
+ Project-URL: Issues, https://github.com/gibsonai/cli/issues
10
+ Project-URL: Changelog, https://github.com/gibsonai/cli/releases
7
11
  Classifier: Operating System :: OS Independent
8
12
  Classifier: Development Status :: 4 - Beta
9
13
  Classifier: Intended Audience :: Developers
@@ -11,9 +15,14 @@ Classifier: Programming Language :: Python :: 3.9
11
15
  Requires-Python: >=3.9
12
16
  Description-Content-Type: text/markdown
13
17
 
18
+
19
+ [![GibsonAI](https://github.com/user-attachments/assets/26bc1002-f878-4995-a6c5-eb8d5eb69c28)](https://gibsonai.com/)
20
+
14
21
  # Gibson CLI
15
22
 
16
- v.0.1.0
23
+ [![PyPI - Version](https://img.shields.io/pypi/v/gibson-cli)](https://pypi.org/project/gibson-cli/)
24
+ ![Python 3.9+](https://img.shields.io/badge/Python-3.9%2B-blue)
25
+ [![Docs](https://img.shields.io/badge/Docs-https://docs.gibsonai.com-green)](https://docs.gibsonai.com)
17
26
 
18
27
  ## Prerequisites
19
28
 
@@ -23,10 +32,9 @@ Portions of the Gibson backend code are written by Gibson. So far, versus a hum
23
32
 
24
33
  ## Installation
25
34
 
26
- - Clone this repository somewhere in your environment
27
- - Modify your `PYTHONPATH` to include a reference to the top level directory here
28
- - `pip3 install -r requirements.txt`
29
- - Add the `bin/` directory to your `PATH`
35
+ ```sh
36
+ pip3 install gibson-cli
37
+ ```
30
38
 
31
39
  ## Key Terms
32
40
 
@@ -304,3 +312,8 @@ At the moment, just refer to the base-level schema directly.
304
312
  - e.g. `gibson ? add nickname to sql://user`
305
313
  - `gibson model`
306
314
  - Important note, `gibson ?` may cause your shell to incorrectly interpret the question mark. If it does, you can use `gibson q` instead (just replace the question mark with the letter `q`).
315
+
316
+ ## Contributing
317
+
318
+ - Clone this repository somewhere in your file system
319
+ - `pip3 install [path to this repository]`
@@ -29,9 +29,10 @@ command/Show.py,sha256=oNGKeNfEo6Qz1n4rJIRjlLuHWHWs5lB0TWE8Vn3hE2U,1190
29
29
  command/Test.py,sha256=2zfxSTm-lwvzERTZNgD99z-AtOWb4RdAN1B93aa-UEk,1194
30
30
  command/Tests.py,sha256=1l8iJs2W6fJDKMPL9Qdx7Qzm2I3azg_esthrZihK-S4,897
31
31
  command/Tree.py,sha256=JWvUimeHWY5-6vEh6axTkhAdI-dVTxbKSjx_4isAAx8,3041
32
+ command/Version.py,sha256=15rhAl3nfMOXmCAc8Tbh9URlj2R9dAXBrPRAEzzypgg,206
32
33
  command/WarGames.py,sha256=vgMXSddUEU_PwDKyI7K0j-FN7uPs5jznfRj-CWh78FI,1280
33
34
  command/auth/Auth.py,sha256=taUwmwAsJWN19oKmjgVGhPA_A8vj6vQLmNUVkuiqfjg,666
34
- command/auth/Login.py,sha256=C3ZzV-Pp1C4RtAhpJ3IkJIwfgRY8pcUQmZRyMLT5hpU,454
35
+ command/auth/Login.py,sha256=oEdvzXYgO1RGYXMiJWpGWQpMqVEv0reDSyyEInVtt8o,549
35
36
  command/auth/Logout.py,sha256=kxyHEGUXp4Ql6VS9R0eQfZqRDf8yhAslZNXExwh1gjY,199
36
37
  command/tests/test_command_BaseCommand.py,sha256=BCeceiGl6ljjxkPiHMKzzrzjK1BUPWTHu9fTwGIETJI,350
37
38
  command/tests/test_command_Conf.py,sha256=4tgWLoIYNuv-bmCAFFy2Kl9nau5KtCwKJMKwMCfL8ow,569
@@ -46,16 +47,16 @@ conf/Modeler.py,sha256=RayW3VFD_2nCFXZepfEcCXTUX2tWd7WtOjHULNVCai8,67
46
47
  conf/Paths.py,sha256=NHJ_YLzmTIUUVLvtZornRdl1xPSluSmpFlMNsnqonxA,192
47
48
  conf/Platform.py,sha256=ai7bLab2Ak_zWiANJH78Pj3YjTlTCQ1EEtkFaVDijOc,307
48
49
  conf/Project.py,sha256=2lc_rr7giu1aGA4Ue4sU3Ey8-_yB2orLM1cw8f9zcdo,440
49
- conf/Version.py,sha256=S_mJGw2v6jONwOHFgzEGwVDr-Ng4M4a3Z6CPrF38TzM,33
50
+ conf/Version.py,sha256=a1VNbiIj5E7m-PmH_pWBVFNf8Iu8zACSJ_qPNdtI9b0,89
50
51
  conf/dev/Api.py,sha256=EKZwy-3h7NxLdP6AYtwyTpJhD1kdQN6gVLuWw4_2KC8,158
51
52
  conf/dev/Base.py,sha256=HisA87syPa5sJFjfjyxWRkLIKuVM5CtAkwW3f2zJx5Y,72
52
53
  conf/dev/Model.py,sha256=HbHRX3VDxR7hXlzuxkKw4Bf7FH6XMfQ96k9BeIUoBf4,73
53
54
  conf/dev/Schema.py,sha256=kOSlX1jEyVb82xd8TO8jEAimLcaefIFJr6d2JYvyTqg,74
54
55
  conf/tests/test_conf_Dependencies.py,sha256=zmUFIANwpmFSMeEV5CllJstaqSSOBh9-Vgk-nETdlx0,109
55
56
  conf/tests/test_conf_Platform.py,sha256=amq1YqxHOXimIP6eIoSg-hAKZ8S68cDAXRdNEaTkdfw,131
56
- core/CommandRouter.py,sha256=fIzXKcGciMDHuXLkb6tp_N6sKs5SoqduCt-F1FE2U_c,9169
57
+ core/CommandRouter.py,sha256=3YbjTMnuHtTP3p7XZvmqGxTI0Yi1ytLnJfpVqWX2wPk,9304
57
58
  core/Configuration.py,sha256=Rw8g0W11BK1TW7WdWef6tIB4YVLuRGiUtn-VjL8OFu0,13881
58
- core/Conversation.py,sha256=l9-8laUpHMtg14o4hzEho_CAX4Ahh2niVKUF3-0milI,8106
59
+ core/Conversation.py,sha256=y9-RrMjC-DfAUXLGGjXWsi8PxpEP4_LaGrRoHQN0I7Y,8106
59
60
  core/Env.py,sha256=ulL7y1xqlz6Mrg_hVUM3NzSumDCI2B1Zjfz9StT2Ju0,413
60
61
  core/Memory.py,sha256=A7YtZFZwHqYpTFODsms8r_RNFNj3l-HKmaD8DhKH6So,3910
61
62
  core/TimeKeeper.py,sha256=0mzs04wizjGEJbiQFWZyi4ja4XgeJaDqc0JzPCHp9po,250
@@ -73,7 +74,7 @@ display/tests/test_display_WorkspaceFooter.py,sha256=fDxXdwDmQLIRWYIBHbh32gfy2eW
73
74
  display/tests/test_display_WorkspaceHeader.py,sha256=Mhloli8KkyVFqv3-Ci4CDggXjrdJ5xebyZmw4foxsuE,309
74
75
  lang/Python.py,sha256=qplU7xoplAIwWTTUSP1RcG3eMhHNUcbyJxCh1yZsXP8,1672
75
76
  lang/tests/test_lang_Python.py,sha256=nulN-VSftAG2BM9HGFUP2RGUHebJAOCWIVPLbHY96Uk,1961
76
- services/auth/Server.py,sha256=s5qNHxhY-ySSGa2RaK4zZIS3K908ulihx35d2F2Xg2k,1973
77
+ services/auth/Server.py,sha256=IAkp4Z6Zpyr1o2WttRwDJ6cPrRuKCuCux46riQzZnuc,1661
77
78
  services/code/context/schema/DataDictionary.py,sha256=zWLzxOzW8iMHxfXPEwnnbruEAtFa8j1UpghNd4AHzfA,369
78
79
  services/code/context/schema/EntityKeys.py,sha256=c8psaGfKseGN9V84xTjotgoLNs41sshbgX9K6ToFXHI,1548
79
80
  services/code/context/schema/Manager.py,sha256=rzj4eTfLn2NDJVop4VWqedNZ6oN0ST1hXqK54UwHe5A,892
@@ -95,8 +96,8 @@ structure/keys/tests/test_ForeignKey.py,sha256=rcNEgHpYjg5fYsbSHa1zd_N09NFRRyimD
95
96
  structure/keys/tests/test_Index.py,sha256=0ZFHEnU5DJBtxG2TCavVD13Rq6aloUXPFM1bspWhbXg,2163
96
97
  structure/keys/tests/test_IndexAttribute.py,sha256=_v3aKmL06cgXuV3xLXJMdp-8oPxHStj7qymtF3HtGrQ,381
97
98
  structure/tests/test_Entity.py,sha256=MYog9b_IV3gbfYx9_hPmCgX3JNPz0t6cXQ-LU1WobjE,3117
98
- gibson_cli-0.1.0.dist-info/METADATA,sha256=OMPI6DftiUJ_LO30DLGRDp9-d9nwswwLVQb9Lr77x2I,10886
99
- gibson_cli-0.1.0.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
100
- gibson_cli-0.1.0.dist-info/entry_points.txt,sha256=VAGCYo_zQgGI5bYR4Ql4rHhl5Zt7iA-Irt1v4iriLvQ,43
101
- gibson_cli-0.1.0.dist-info/top_level.txt,sha256=e26JAjLAeXm2tl9nuW9OxrRvzkIXNYlXnHo-Yf5ZtnE,70
102
- gibson_cli-0.1.0.dist-info/RECORD,,
99
+ gibson_cli-0.1.2.dist-info/METADATA,sha256=sl47VC64ftoMAgdqc0M7VD_47o8_mzowFpemMZ8WRuU,11437
100
+ gibson_cli-0.1.2.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
101
+ gibson_cli-0.1.2.dist-info/entry_points.txt,sha256=VAGCYo_zQgGI5bYR4Ql4rHhl5Zt7iA-Irt1v4iriLvQ,43
102
+ gibson_cli-0.1.2.dist-info/top_level.txt,sha256=e26JAjLAeXm2tl9nuW9OxrRvzkIXNYlXnHo-Yf5ZtnE,70
103
+ gibson_cli-0.1.2.dist-info/RECORD,,
services/auth/Server.py CHANGED
@@ -1,5 +1,4 @@
1
1
  import webbrowser
2
-
3
2
  import time
4
3
  from http.server import HTTPServer, BaseHTTPRequestHandler
5
4
  from threading import Thread
@@ -15,29 +14,17 @@ class Handler(BaseHTTPRequestHandler):
15
14
  token = params.get("token", [""])[0]
16
15
 
17
16
  if token:
18
- self.respond(200, "OK")
19
17
  self.server.token = token
20
- else:
21
- self.respond(400, "Bad Request")
22
18
 
19
+ self.send_response(302)
20
+ self.send_header("Location", f"{self.server.app_domain}/chat")
21
+ self.end_headers()
23
22
  self.server._stop()
24
23
 
25
24
  # Suppress logging
26
25
  def log_message(self, format, *args):
27
26
  pass
28
27
 
29
- # Format the response
30
- def respond(self, code, message):
31
- self.send_response(code)
32
- self.send_header("Content-type", "text")
33
- self.send_header("Access-Control-Allow-Origin", "*")
34
- self.send_header(
35
- "Access-Control-Allow-Headers",
36
- "Origin, X-Requested-With, Content-Type, Accept",
37
- )
38
- self.end_headers()
39
- self.wfile.write(message.encode("utf8"))
40
-
41
28
 
42
29
  # Temporary HTTP server to handle the login process
43
30
  class Server(HTTPServer):
@@ -57,8 +44,11 @@ class Server(HTTPServer):
57
44
  self._start()
58
45
  self._open_browser()
59
46
 
60
- while self.thread is not None:
61
- time.sleep(1)
47
+ try:
48
+ while self.thread is not None:
49
+ time.sleep(1)
50
+ except KeyboardInterrupt:
51
+ self._stop()
62
52
 
63
53
  return self.token
64
54