gibson-cli 0.7.4__py3-none-any.whl → 0.7.6__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.
Files changed (46) hide show
  1. bin/gibson +26 -0
  2. gibson/api/BaseApi.py +1 -1
  3. gibson/api/Cli.py +1 -1
  4. gibson/command/Build.py +6 -6
  5. gibson/command/Conf.py +1 -2
  6. gibson/command/Count.py +1 -1
  7. gibson/command/Dev.py +5 -8
  8. gibson/command/Forget.py +1 -1
  9. gibson/command/Help.py +112 -47
  10. gibson/command/Modify.py +2 -4
  11. gibson/command/Question.py +2 -4
  12. gibson/command/Remove.py +2 -2
  13. gibson/command/Show.py +3 -5
  14. gibson/command/Version.py +1 -1
  15. gibson/command/auth/Auth.py +3 -3
  16. gibson/command/code/Code.py +10 -10
  17. gibson/command/code/Entity.py +67 -33
  18. gibson/command/code/Model.py +2 -4
  19. gibson/command/code/Schema.py +9 -8
  20. gibson/command/code/Test.py +1 -3
  21. gibson/command/importer/Import.py +8 -8
  22. gibson/command/importer/OpenApi.py +1 -1
  23. gibson/command/list/Entities.py +25 -37
  24. gibson/command/list/List.py +3 -3
  25. gibson/command/list/Projects.py +23 -13
  26. gibson/command/new/Module.py +2 -2
  27. gibson/command/new/New.py +4 -4
  28. gibson/command/rename/Rename.py +1 -1
  29. gibson/command/rewrite/Rewrite.py +1 -1
  30. gibson/core/Colors.py +34 -7
  31. gibson/core/CommandRouter.py +0 -1
  32. gibson/core/Configuration.py +8 -3
  33. gibson/core/Conversation.py +17 -24
  34. gibson/core/Diff.py +34 -0
  35. gibson/core/Memory.py +1 -0
  36. gibson/core/Spinner.py +8 -3
  37. gibson/display/Header.py +3 -1
  38. gibson/display/WorkspaceHeader.py +2 -2
  39. gibson/display/tests/test_display_Header.py +2 -2
  40. gibson/display/tests/test_display_WorkspaceHeader.py +1 -1
  41. {gibson_cli-0.7.4.dist-info → gibson_cli-0.7.6.dist-info}/METADATA +16 -7
  42. {gibson_cli-0.7.4.dist-info → gibson_cli-0.7.6.dist-info}/RECORD +45 -44
  43. {gibson_cli-0.7.4.dist-info → gibson_cli-0.7.6.dist-info}/WHEEL +1 -1
  44. gibson/command/WarGames.py +0 -34
  45. {gibson_cli-0.7.4.dist-info → gibson_cli-0.7.6.dist-info}/entry_points.txt +0 -0
  46. {gibson_cli-0.7.4.dist-info → gibson_cli-0.7.6.dist-info}/top_level.txt +0 -0
bin/gibson ADDED
@@ -0,0 +1,26 @@
1
+ #!/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9
2
+ # -*- coding: utf-8 -*-
3
+
4
+ # This file is identical to what pip creates when you install an executable package, but it adds a dev mode banner.
5
+ # To easily switch between dev mode and installed mode, add the following functions to your .zshrc or .bashrc:
6
+ #
7
+ # cli_dev_on() {
8
+ # export PATH="$HOME/src/gibson/cli/bin:$PATH"
9
+ # export PYTHONPATH="$HOME/src/gibson/cli:$PYTHONPATH"
10
+ # }
11
+ #
12
+ # cli_dev_off() {
13
+ # export PATH=${PATH#$HOME/src/gibson/cli/bin:}
14
+ # export PYTHONPATH=${PYTHONPATH#:$HOME/src/gibson/cli:}
15
+ # }
16
+
17
+ import re
18
+ import sys
19
+
20
+ from gibson.bin.gibson import main
21
+ from gibson.display.Header import Header
22
+
23
+ if __name__ == "__main__":
24
+ print(f"{Header().render('dev mode')}\n")
25
+ sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
26
+ sys.exit(main())
gibson/api/BaseApi.py CHANGED
@@ -86,7 +86,7 @@ class BaseApi:
86
86
  def __raise_for_status(self, r):
87
87
  if r.status_code == 401:
88
88
  self.configuration.conversation.type(
89
- f"\nYou need to log in to continue. Please run {Colors.command('gibson')} {Colors.subcommand('auth')} {Colors.argument('login')} and then try again.\n"
89
+ f"\nYou need to log in to continue. Please run {Colors.command(self.configuration.command, 'auth', args='login')} and then try again.\n"
90
90
  )
91
91
  exit(1)
92
92
 
gibson/api/Cli.py CHANGED
@@ -11,7 +11,7 @@ class Cli(BaseApi):
11
11
  self.configuration = configuration
12
12
  self.configuration.require_login()
13
13
  self.configuration.require_project()
14
- self.configuration.require_project_key()
14
+ self.configuration.require_project_key_or_id()
15
15
 
16
16
  def code_api(self):
17
17
  return self.post(
gibson/command/Build.py CHANGED
@@ -39,13 +39,13 @@ class Build(BaseCommand):
39
39
 
40
40
  for table in tables:
41
41
  if table not in table_exceptions:
42
- self.conversation.type(f" {table[0]}\n", delay=0.002)
42
+ self.conversation.type(f" {table[0]}\n")
43
43
  session.execute(f"drop table if exists {table[0]}")
44
44
 
45
45
  self.conversation.type(" building entities\n")
46
46
 
47
47
  for entity in self.memory.entities:
48
- self.conversation.type(f" {entity['name']}\n", delay=0.002)
48
+ self.conversation.type(f" {entity['name']}\n")
49
49
  session.execute(entity["definition"])
50
50
  finally:
51
51
  session.execute("set foreign_key_checks = 1")
@@ -61,7 +61,7 @@ class Build(BaseCommand):
61
61
  session.execute(
62
62
  """select table_name
63
63
  from information_schema.tables
64
- where table_schema = :table_schema""",
64
+ where table_schema = :table_schema and table_type = 'BASE TABLE'""",
65
65
  {"table_schema": schema},
66
66
  )
67
67
  )
@@ -70,7 +70,7 @@ class Build(BaseCommand):
70
70
  self.conversation.type(" dropping existing entities\n")
71
71
 
72
72
  for table in tables:
73
- self.conversation.type(f" {table[0]}\n", delay=0.002)
73
+ self.conversation.type(f" {table[0]}\n")
74
74
  session.execute(f"drop table if exists {schema}.{table[0]} cascade")
75
75
  session.commit()
76
76
 
@@ -88,7 +88,7 @@ class Build(BaseCommand):
88
88
  session.execute(definition)
89
89
  session.commit()
90
90
 
91
- self.conversation.type(f' {name.split(".")[-1]}\n', delay=0.002)
91
+ self.conversation.type(f' {name.split(".")[-1]}\n')
92
92
 
93
93
  remove.append(name)
94
94
  except sqlalchemy.exc.ProgrammingError:
@@ -124,7 +124,7 @@ class Build(BaseCommand):
124
124
  else ""
125
125
  )
126
126
  self.conversation.type(
127
- f"usage: {Colors.command(self.configuration.command)} {Colors.subcommand('build')} {Colors.argument('datastore')} {Colors.hint('build the datastore')} {datastore_uri}\n"
127
+ f"usage: {Colors.command(self.configuration.command, 'build', args='datastore', hint='build the datastore')} {datastore_uri}\n"
128
128
  )
129
129
  self.conversation.newline()
130
130
  exit(1)
gibson/command/Conf.py CHANGED
@@ -61,13 +61,12 @@ class Conf(BaseCommand):
61
61
  def usage(self):
62
62
  self.configuration.display_project()
63
63
  self.conversation.type(
64
- f"usage: {Colors.command(self.configuration.command)} {Colors.subcommand('conf')} {Colors.argument('[key]')} {Colors.input('[value]')} {Colors.hint('set a configuration value')}\n"
64
+ f"usage: {Colors.command(self.configuration.command, 'conf', args='[key]', inputs='[value]', hint='set a configuration value')}\n"
65
65
  )
66
66
  self.conversation.newline()
67
67
 
68
68
  if self.configuration.project:
69
69
  self.conversation.type(f" where {Colors.argument('[key]')} is one of:\n")
70
- self.conversation.set_delay(0.004)
71
70
 
72
71
  for key in self.get_configuration_keys():
73
72
  self.conversation.type(f" {key}\n")
gibson/command/Count.py CHANGED
@@ -31,7 +31,7 @@ class Count(BaseCommand):
31
31
  def usage(self):
32
32
  self.configuration.display_project()
33
33
  self.conversation.type(
34
- f"usage: {Colors.command(self.configuration.command)} {Colors.subcommand('count')} {Colors.arguments(['last', 'stored'])} {Colors.hint('display the number of entities')}\n"
34
+ f"usage: {Colors.command(self.configuration.command, 'count', args=['last', 'stored'], hint='display the number of entities')}\n"
35
35
  )
36
36
  self.conversation.newline()
37
37
  exit(1)
gibson/command/Dev.py CHANGED
@@ -72,16 +72,13 @@ class Dev(BaseCommand):
72
72
  except FileExistsError:
73
73
  pass
74
74
 
75
- self.conversation.type(
76
- "\n https://api.yourdomain.com/v1/-/sneakers GET\n", delay=0.002
77
- )
78
- self.conversation.type(" ^ ^\n", delay=0.002)
79
- self.conversation.type(" | |\n", delay=0.002)
80
- self.conversation.type(" version _| |\n", delay=0.002)
75
+ self.conversation.type("\n https://api.yourdomain.com/v1/-/sneakers GET\n")
76
+ self.conversation.type(" ^ ^\n")
77
+ self.conversation.type(" | |\n")
78
+ self.conversation.type(" version _| |\n")
81
79
  self.conversation.type(
82
80
  " |_ prefix (to isolate GibsonAI "
83
81
  + "API routes)\n\n",
84
- delay=0.002,
85
82
  )
86
83
  self.conversation.type(
87
84
  " It is OK if you are not sure about these. Just leave the defaults\n"
@@ -119,7 +116,7 @@ class Dev(BaseCommand):
119
116
  def usage(self):
120
117
  self.configuration.display_project()
121
118
  self.conversation.type(
122
- f"usage: {Colors.command(self.configuration.command)} {Colors.subcommand('dev')} {Colors.arguments(['off', 'on'])} {Colors.hint('turn dev mode on or off')}\n"
119
+ f"usage: {Colors.command(self.configuration.command, 'dev', args=['off', 'on'], hint='turn dev mode on or off')}\n"
123
120
  )
124
121
  self.conversation.newline()
125
122
  exit(1)
gibson/command/Forget.py CHANGED
@@ -27,7 +27,7 @@ class Forget(BaseCommand):
27
27
  def usage(self):
28
28
  self.configuration.display_project()
29
29
  self.conversation.type(
30
- f"usage: {Colors.command(self.configuration.command)} {Colors.subcommand('forget')} {Colors.arguments(['all', 'last', 'stored'])} {Colors.hint('delete entities from memory')}\n"
30
+ f"usage: {Colors.command(self.configuration.command, 'forget', args=['all', 'last', 'stored'], hint='delete entities from memory')}\n"
31
31
  )
32
32
  self.conversation.newline()
33
33
  exit(1)
gibson/command/Help.py CHANGED
@@ -1,3 +1,8 @@
1
+ from rich import box
2
+ from rich.console import Console
3
+ from rich.table import Table
4
+ from rich.text import Text
5
+
1
6
  import gibson.core.Colors as Colors
2
7
  from gibson.command.BaseCommand import BaseCommand
3
8
  from gibson.core.Memory import Memory
@@ -5,107 +10,167 @@ from gibson.core.Memory import Memory
5
10
 
6
11
  class Help(BaseCommand):
7
12
  def execute(self):
8
- dev_off = ""
9
- dev_on = ""
13
+ dev_mode_text = []
10
14
 
11
15
  if self.configuration.project is not None:
12
- dev_off = "*" if self.configuration.project.dev.active is False else ""
13
- dev_on = "*" if self.configuration.project.dev.active is True else ""
16
+ dev_mode = "on" if self.configuration.project.dev.active is True else "off"
17
+ dev_color = (
18
+ "green" if self.configuration.project.dev.active is True else "red"
19
+ )
20
+ dev_mode_text = [
21
+ "\n\ndev mode is turned ",
22
+ (dev_mode, f"bold {dev_color}"),
23
+ ]
14
24
 
15
25
  subcommands = {
16
26
  "auth": {
17
- "description": "login | logout",
27
+ "description": "authenticate with the gibson cli",
28
+ "subcommands": ["login", "logout"],
18
29
  "memory": None,
19
30
  },
20
31
  "build": {
21
32
  "description": "create the entities in the datastore",
33
+ "subcommands": ["datastore"],
22
34
  "memory": "stored",
23
35
  },
24
- "code": {"description": "pair program with gibson", "memory": None},
25
- "conf": {"description": "set a configuration variable", "memory": None},
36
+ "code": {
37
+ "description": "pair program with gibson",
38
+ "subcommands": ["api", "base", "entity", "models", "schemas", "tests"],
39
+ "memory": None,
40
+ },
41
+ "conf": {
42
+ "description": "set a configuration variable",
43
+ "subcommands": None,
44
+ "memory": None,
45
+ },
26
46
  "count": {
27
47
  "description": "show the number of entities stored",
28
- "memory": "last | stored",
48
+ "subcommands": ["last", "stored"],
49
+ "memory": "based on user selection",
29
50
  },
30
51
  "dev": {
31
- "description": f"mode off{dev_off} | on{dev_on}",
52
+ "description": Text.assemble(
53
+ "gibson will automatically write code for you",
54
+ *dev_mode_text,
55
+ ),
56
+ "subcommands": ["on", "off"],
32
57
  "memory": None,
33
58
  },
34
59
  "forget": {
35
- "description": "delete memory",
36
- "memory": "all | last | stored",
60
+ "description": f"delete entities from memory",
61
+ "subcommands": ["all", "last", "stored"],
62
+ "memory": "based on user selection",
37
63
  },
38
- "help": {"description": "for help", "memory": None},
64
+ "help": {"description": "for help", "subcommands": None, "memory": None},
39
65
  "import": {
40
- "description": "import entities from a data source",
66
+ "description": "import entities from a datasource",
67
+ "subcommands": ["api", "mysql", "pg_dump", "openapi"],
41
68
  "memory": "stored",
42
69
  },
43
70
  "list": {
44
- "description": "show the names of entities in your project",
71
+ "description": "see a list of your entities or projects",
72
+ "subcommands": ["entities", "projects"],
45
73
  "memory": None,
46
74
  },
47
75
  "merge": {
48
- "description": "move last changes into project",
76
+ "description": "merge last memory (recent changes) into stored project memory",
77
+ "subcommands": None,
49
78
  "memory": "last -> stored",
50
79
  },
51
80
  "modify": {
52
81
  "description": "change an entity using natural language",
82
+ "subcommands": None,
53
83
  "memory": "last > stored",
54
84
  },
55
- "new": {"description": "create something new", "memory": None},
85
+ "new": {
86
+ "description": "create something new",
87
+ "subcommands": ["project", "module", "entity"],
88
+ "memory": None,
89
+ },
56
90
  "remove": {
57
91
  "description": "remove an entity from the project",
92
+ "subcommands": None,
58
93
  "memory": "last > stored",
59
94
  },
60
95
  "rename": {
61
96
  "description": "rename an entity",
97
+ "subcommands": ["entity"],
62
98
  "memory": "last > stored",
63
99
  },
64
100
  "rewrite": {
65
101
  "description": "rewrite all code",
102
+ "subcommands": None,
66
103
  "memory": "stored",
67
104
  },
68
- "show": {"description": "display an entity", "memory": "last > stored"},
69
- "tree": {"description": "illustrate the project layout", "memory": None},
70
- "q": {"description": "ask Gibson a question", "memory": None},
105
+ "show": {
106
+ "description": "display an entity",
107
+ "subcommands": None,
108
+ "memory": "last > stored",
109
+ },
110
+ "tree": {
111
+ "description": "illustrate the project layout in a tree view",
112
+ "subcommands": None,
113
+ "memory": None,
114
+ },
115
+ "q": {
116
+ "description": "ask gibson a question using natural language",
117
+ "subcommands": None,
118
+ "memory": None,
119
+ },
71
120
  }
72
121
 
73
- self.conversation.set_delay(0.001)
74
122
  self.configuration.display_project()
75
- self.conversation.type(
76
- f"usage: {Colors.command(self.configuration.command)} {Colors.subcommand('[command]')}\n\n"
77
- )
78
- self.conversation.type(" command description" + " " * 40 + "memory\n")
79
- self.conversation.type(" ------- -----------" + " " * 40 + "------\n")
80
123
 
81
- for subcommand, config in subcommands.items():
82
- memory = ""
83
- if config["memory"] is not None:
84
- memory = f"[{config['memory']}]"
124
+ console = Console()
85
125
 
86
- spaces = 61 - (8 + 2 + len(config["description"]))
126
+ help = Table(
127
+ title=Text.assemble(
128
+ "usage: ",
129
+ (self.configuration.command, "green bold"),
130
+ (" [command]", "yellow bold"),
131
+ (" [subcommand]", "magenta bold"),
132
+ ),
133
+ header_style="bold",
134
+ box=box.ROUNDED,
135
+ expand=True,
136
+ leading=1,
137
+ )
138
+ help.add_column("command", style="yellow bold", header_style="yellow bold")
139
+ help.add_column("description")
140
+ help.add_column("subcommands", header_style="magenta")
141
+ help.add_column("memory affected", style="grey50", header_style="grey50")
87
142
 
88
- self.conversation.type(
89
- f"{Colors.subcommand(subcommand.rjust(8))}"
90
- + f" {config['description']}"
91
- + " " * spaces
92
- + f"{Colors.hint(memory)}\n"
143
+ for subcommand, config in subcommands.items():
144
+ help.add_row(
145
+ subcommand,
146
+ config["description"],
147
+ (
148
+ Text(" | ").join(
149
+ Text(x, style="magenta") for x in config["subcommands"]
150
+ )
151
+ if config["subcommands"]
152
+ else ""
153
+ ),
154
+ config["memory"] or "",
93
155
  )
94
156
 
157
+ console.print(help)
158
+
95
159
  self.conversation.newline()
96
160
 
97
- if self.configuration.project is not None:
98
- self.conversation.type("memory:\n\n")
161
+ if self.configuration.project:
99
162
  stats = Memory(self.configuration).stats()
100
- self.conversation.type(
101
- f"{str(stats['entities']['num']).rjust(8)}"
102
- + f" {stats['entities']['word']}"
103
- + " " * (43 if stats["entities"]["word"] == "entities" else 45)
104
- + "[stored]\n"
163
+ memory = Table(
164
+ title="Memory",
165
+ show_header=True,
166
+ header_style="bold",
167
+ box=box.ROUNDED,
168
+ expand=True,
105
169
  )
106
- self.conversation.type(
107
- f"{str(stats['last']['num']).rjust(8)}"
108
- + f" {stats['last']['word']}"
109
- + " " * (43 if stats["last"]["word"] == "entities" else 45)
110
- + "[last]\n\n"
170
+ memory.add_column("stored", style="green", header_style="green")
171
+ memory.add_column("last", style="yellow", header_style="yellow")
172
+ memory.add_row(
173
+ f"{stats['entities']['num']} {stats['entities']['word']}",
174
+ f"{stats['last']['num']} {stats['last']['word']}",
111
175
  )
176
+ console.print(memory)
gibson/command/Modify.py CHANGED
@@ -13,9 +13,7 @@ class Modify(BaseCommand):
13
13
  self.configuration.require_project()
14
14
  entity = self.memory.recall_entity(sys.argv[2])
15
15
  if entity is None:
16
- self.conversation.not_sure_no_entity(
17
- self.configuration.project.name, sys.argv[2]
18
- )
16
+ self.conversation.not_sure_no_entity(self.configuration, sys.argv[2])
19
17
  exit(1)
20
18
 
21
19
  cli = Cli(self.configuration)
@@ -34,7 +32,7 @@ class Modify(BaseCommand):
34
32
  def usage(self):
35
33
  self.configuration.display_project()
36
34
  self.conversation.type(
37
- f"usage: {Colors.command(self.configuration.command)} {Colors.subcommand('modify')} {Colors.argument('[entity name]')} {Colors.input('[instructions]')} {Colors.hint('modify an entity with natural language instructions')}\n"
35
+ f"usage: {Colors.command(self.configuration.command, 'modify', inputs=['[entity name]', '[instructions]'], hint='modify an entity with natural language instructions')}\n"
38
36
  )
39
37
  self.conversation.newline()
40
38
  exit(1)
@@ -57,9 +57,7 @@ class Question(BaseCommand):
57
57
 
58
58
  entity = self.memory.recall_entity(name)
59
59
  if entity is None:
60
- self.conversation.not_sure_no_entity(
61
- self.configuration.project.name, name
62
- )
60
+ self.conversation.not_sure_no_entity(self.configuration, name)
63
61
  exit(1)
64
62
 
65
63
  has_sql = True
@@ -93,7 +91,7 @@ class Question(BaseCommand):
93
91
  def usage(self):
94
92
  self.configuration.display_project()
95
93
  self.conversation.type(
96
- f"usage: {Colors.command(self.configuration.command)} {Colors.subcommand('q')} {Colors.input('[instructions]')} {Colors.hint('ask a question or tell Gibson to do something using natural language')}\n"
94
+ f"usage: {Colors.command(self.configuration.command, 'q', inputs='[instructions]', hint='ask a question or tell Gibson to do something using natural language')}\n"
97
95
  )
98
96
  self.conversation.type(
99
97
  f" use {Colors.argument(self.TOKEN_FILE+'[path]')} to import a file from the filesystem\n"
gibson/command/Remove.py CHANGED
@@ -50,7 +50,7 @@ class Remove(BaseCommand):
50
50
 
51
51
  if not found:
52
52
  self.conversation.type(
53
- f'Nothing removed, did not find entity named "{sys.argv[2]}".\n'
53
+ f"Nothing removed, no entity named {Colors.entity(sys.argv[2])}.\n"
54
54
  )
55
55
  self.conversation.newline()
56
56
  return self
@@ -76,7 +76,7 @@ class Remove(BaseCommand):
76
76
  def usage(self):
77
77
  self.configuration.display_project()
78
78
  self.conversation.type(
79
- f"usage: {Colors.command(self.configuration.command)} {Colors.subcommand('remove')} {Colors.input('[entity name]')} {Colors.hint('remove an entity from the project')}\n"
79
+ f"usage: {Colors.command(self.configuration.command, 'remove', inputs='[entity name]', hint='remove an entity from the project')}\n"
80
80
  )
81
81
  self.conversation.newline()
82
82
  exit(1)
gibson/command/Show.py CHANGED
@@ -16,9 +16,7 @@ class Show(BaseCommand):
16
16
  self.configuration.require_project()
17
17
  entity = self.memory.recall_entity(sys.argv[2])
18
18
  if entity is None:
19
- self.conversation.not_sure_no_entity(
20
- self.configuration.project.name, sys.argv[2]
21
- )
19
+ self.conversation.not_sure_no_entity(self.configuration, sys.argv[2])
22
20
  exit(1)
23
21
 
24
22
  entities = [entity]
@@ -32,10 +30,10 @@ class Show(BaseCommand):
32
30
  def usage(self):
33
31
  self.configuration.display_project()
34
32
  self.conversation.type(
35
- f"usage: {Colors.command(self.configuration.command)} {Colors.subcommand('show')} {Colors.hint('display the entire schema')}\n"
33
+ f"usage: {Colors.command(self.configuration.command, 'show', hint='display the entire schema')}\n"
36
34
  )
37
35
  self.conversation.type(
38
- f" {Colors.command(self.configuration.command)} {Colors.subcommand('show')} {Colors.argument('[entity name]')} {Colors.hint('display the schema for an entity')}\n"
36
+ f" {Colors.command(self.configuration.command, 'show', inputs='[entity name]', hint='display the schema for an entity')}\n"
39
37
  )
40
38
  self.conversation.newline()
41
39
  exit(1)
gibson/command/Version.py CHANGED
@@ -21,7 +21,7 @@ class Version(BaseCommand):
21
21
  f"You are currently using version: {Colors.violet(VersionConf.num)}\n"
22
22
  )
23
23
  self.conversation.type(
24
- f"Please update to the latest version by running: {Colors.command('pip3')} {Colors.subcommand('install')} {Colors.option('--upgrade')} gibson-cli\n"
24
+ f"Please update to the latest version by running: {Colors.command('pip3', 'install', args='--upgrade', inputs='gibson-cli')}\n"
25
25
  )
26
26
  else:
27
27
  self.conversation.type(
@@ -20,13 +20,13 @@ class Auth(BaseCommand):
20
20
  def usage(self):
21
21
  self.configuration.display_project()
22
22
  self.conversation.type(
23
- f"usage: {Colors.command(self.configuration.command)} {Colors.subcommand('auth')} {Colors.arguments(['login', 'logout'])}\n"
23
+ f"usage: {Colors.command(self.configuration.command, 'auth', args=['login', 'logout'])}\n"
24
24
  )
25
25
  self.conversation.type(
26
- f" {Colors.command(self.configuration.command)} {Colors.subcommand('auth')} {Colors.argument('login')} {Colors.hint('login to Gibson')}\n"
26
+ f" {Colors.command(self.configuration.command, 'auth', args='login', hint='login to Gibson')}\n"
27
27
  )
28
28
  self.conversation.type(
29
- f" {Colors.command(self.configuration.command)} {Colors.subcommand('auth')} {Colors.argument('logout')} {Colors.hint('logout of Gibson')}\n"
29
+ f" {Colors.command(self.configuration.command, 'auth', args='logout', hint='logout of Gibson')}\n"
30
30
  )
31
31
  self.conversation.newline()
32
32
  exit(1)
@@ -39,34 +39,34 @@ class Code(BaseCommand):
39
39
  def usage(self):
40
40
  self.configuration.display_project()
41
41
  self.conversation.type(
42
- f"usage: {Colors.command(self.configuration.command)} {Colors.subcommand('code')} {Colors.arguments(['api', 'base', 'entity', 'models', 'schemas', 'tests'])} {Colors.input('[entity name]')} {Colors.hint('write code')}\n"
42
+ f"usage: {Colors.command(self.configuration.command, 'code', args=['api', 'base', 'entity', 'models', 'schemas', 'tests'], inputs='[entity name]', hint='write code')}\n"
43
43
  )
44
44
  self.conversation.type(
45
- f" {Colors.command(self.configuration.command)} {Colors.subcommand('code')} {Colors.argument('api')} {Colors.hint('generate the API code')}\n"
45
+ f" {Colors.command(self.configuration.command, 'code', args='api', hint='generate the API code')}\n"
46
46
  )
47
47
  self.conversation.type(
48
- f" {Colors.command(self.configuration.command)} {Colors.subcommand('code')} {Colors.argument('base')} {Colors.hint('generate the base code')}\n"
48
+ f" {Colors.command(self.configuration.command, 'code', args='base', hint='generate the base code')}\n"
49
49
  )
50
50
  self.conversation.type(
51
- f" {Colors.command(self.configuration.command)} {Colors.subcommand('code')} {Colors.argument('entity')} {Colors.input('[entity name]')} {Colors.hint('create or update an entity using the AI pair programmer')}\n"
51
+ f" {Colors.command(self.configuration.command, 'code', args='entity', inputs='[entity name]', hint='create or update an entity using the AI pair programmer')}\n"
52
52
  )
53
53
  self.conversation.type(
54
- f" {Colors.command(self.configuration.command)} {Colors.subcommand('code')} {Colors.argument('models')} {Colors.hint('generate the models for all entities')}\n"
54
+ f" {Colors.command(self.configuration.command, 'code', args='models', hint='generate the models for all entities')}\n"
55
55
  )
56
56
  self.conversation.type(
57
- f" {Colors.command(self.configuration.command)} {Colors.subcommand('code')} {Colors.argument('models')} {Colors.input('[entity name]')} {Colors.hint('generate the model(s) for a single entity')}\n"
57
+ f" {Colors.command(self.configuration.command, 'code', args='models', inputs='[entity name]', hint='generate the model(s) for a single entity')}\n"
58
58
  )
59
59
  self.conversation.type(
60
- f" {Colors.command(self.configuration.command)} {Colors.subcommand('code')} {Colors.argument('schemas')} {Colors.hint('generate the schemas for all entities')}\n"
60
+ f" {Colors.command(self.configuration.command, 'code', args='schemas', hint='generate the schemas for all entities')}\n"
61
61
  )
62
62
  self.conversation.type(
63
- f" {Colors.command(self.configuration.command)} {Colors.subcommand('code')} {Colors.argument('schemas')} {Colors.input('[entity name]')} {Colors.hint('generate the schema(s) for a single entity')}\n"
63
+ f" {Colors.command(self.configuration.command, 'code', args='schemas', inputs='[entity name]', hint='generate the schema(s) for a single entity')}\n"
64
64
  )
65
65
  self.conversation.type(
66
- f" {Colors.command(self.configuration.command)} {Colors.subcommand('code')} {Colors.argument('tests')} {Colors.hint('generate the unit tests for all entities')}\n"
66
+ f" {Colors.command(self.configuration.command, 'code', args='tests', hint='generate the unit tests for all entities')}\n"
67
67
  )
68
68
  self.conversation.type(
69
- f" {Colors.command(self.configuration.command)} {Colors.subcommand('code')} {Colors.argument('tests')} {Colors.input('[entity name]')} {Colors.hint('generate the unit tests for a single entity')}\n"
69
+ f" {Colors.command(self.configuration.command, 'code', args='tests', inputs='[entity name]', hint='generate the unit tests for a single entity')}\n"
70
70
  )
71
71
  self.conversation.newline()
72
72
  exit(1)