gibson-cli 0.1.2__py3-none-any.whl → 0.1.3__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 (111) hide show
  1. {api → gibson/api}/Cli.py +6 -6
  2. {bin → gibson/bin}/gibson.py +2 -2
  3. {command → gibson/command}/Api.py +5 -6
  4. {command → gibson/command}/Base.py +4 -5
  5. {command → gibson/command}/BaseCommand.py +2 -2
  6. {command → gibson/command}/Build.py +2 -3
  7. {command → gibson/command}/Code.py +12 -11
  8. {command → gibson/command}/Conf.py +1 -1
  9. {command → gibson/command}/Dev.py +2 -3
  10. {command → gibson/command}/Import.py +4 -5
  11. {command → gibson/command}/List.py +2 -3
  12. {command → gibson/command}/Merge.py +2 -3
  13. {command → gibson/command}/Model.py +4 -5
  14. {command → gibson/command}/Models.py +4 -5
  15. {command → gibson/command}/Modify.py +2 -3
  16. {command → gibson/command}/Module.py +2 -3
  17. {command → gibson/command}/New.py +2 -3
  18. {command → gibson/command}/OpenApi.py +2 -3
  19. {command → gibson/command}/Question.py +2 -3
  20. {command → gibson/command}/Remove.py +3 -4
  21. {command → gibson/command}/Rename.py +3 -4
  22. {command → gibson/command}/Rewrite.py +3 -3
  23. {command → gibson/command}/Schema.py +4 -5
  24. {command → gibson/command}/Schemas.py +4 -5
  25. {command → gibson/command}/Test.py +4 -5
  26. {command → gibson/command}/Tests.py +4 -5
  27. {command → gibson/command}/Version.py +2 -2
  28. {command → gibson/command}/WarGames.py +2 -3
  29. {command → gibson/command}/auth/Auth.py +3 -3
  30. {command → gibson/command}/auth/Login.py +5 -6
  31. {command → gibson/command}/auth/Logout.py +1 -1
  32. {command → gibson/command}/tests/test_command_BaseCommand.py +2 -2
  33. {command → gibson/command}/tests/test_command_Conf.py +2 -2
  34. {conf → gibson/conf}/Dev.py +4 -4
  35. {conf → gibson/conf}/tests/test_conf_Dependencies.py +1 -1
  36. {conf → gibson/conf}/tests/test_conf_Platform.py +1 -1
  37. {core → gibson/core}/CommandRouter.py +34 -34
  38. gibson/core/Completions.py +35 -0
  39. {core → gibson/core}/Configuration.py +14 -11
  40. {core → gibson/core}/Conversation.py +8 -5
  41. {core → gibson/core}/Env.py +2 -2
  42. {core → gibson/core}/Memory.py +1 -1
  43. gibson/data/bash-completion.tmpl +96 -0
  44. {db → gibson/db}/tests/test_db_TableExceptions.py +1 -1
  45. {dev → gibson/dev}/Dev.py +2 -11
  46. {display → gibson/display}/tests/test_display_Header.py +1 -1
  47. {display → gibson/display}/tests/test_display_WorkspaceFooter.py +1 -1
  48. {display → gibson/display}/tests/test_display_WorkspaceHeader.py +1 -1
  49. {lang → gibson/lang}/Python.py +1 -1
  50. {lang → gibson/lang}/tests/test_lang_Python.py +1 -1
  51. {services → gibson/services}/auth/Server.py +11 -6
  52. {services → gibson/services}/code/context/schema/EntityKeys.py +3 -3
  53. {services → gibson/services}/code/context/schema/Manager.py +2 -2
  54. {services → gibson/services}/code/context/schema/tests/test_code_context_schema_DataDictionary.py +1 -1
  55. {services → gibson/services}/code/context/schema/tests/test_code_context_schema_EntityKeys.py +4 -4
  56. {services → gibson/services}/code/context/schema/tests/test_code_context_schema_Manager.py +2 -2
  57. {services → gibson/services}/code/customization/Authenticator.py +2 -2
  58. {services → gibson/services}/code/customization/BaseCustomization.py +1 -1
  59. {services → gibson/services}/code/customization/CustomizationManager.py +2 -2
  60. {services → gibson/services}/code/customization/tests/test_code_customization_Authenticator.py +2 -2
  61. {services → gibson/services}/code/customization/tests/test_code_customization_BaseCustomization.py +2 -2
  62. {structure → gibson/structure}/Entity.py +2 -2
  63. {structure → gibson/structure}/keys/ForeignKey.py +1 -1
  64. {structure → gibson/structure}/keys/Index.py +1 -1
  65. {structure → gibson/structure}/keys/tests/test_ForeignKey.py +2 -2
  66. {structure → gibson/structure}/keys/tests/test_Index.py +1 -1
  67. {structure → gibson/structure}/keys/tests/test_IndexAttribute.py +1 -1
  68. {structure → gibson/structure}/testing.py +1 -1
  69. {structure → gibson/structure}/tests/test_Entity.py +5 -5
  70. gibson/tests/test_Env.py +14 -0
  71. gibson/tests/test_Memory.py +89 -0
  72. gibson/tests/test_utils.py +20 -0
  73. {gibson_cli-0.1.2.dist-info → gibson_cli-0.1.3.dist-info}/METADATA +1 -1
  74. gibson_cli-0.1.3.dist-info/RECORD +108 -0
  75. {gibson_cli-0.1.2.dist-info → gibson_cli-0.1.3.dist-info}/WHEEL +1 -1
  76. gibson_cli-0.1.3.dist-info/entry_points.txt +2 -0
  77. gibson_cli-0.1.3.dist-info/top_level.txt +1 -0
  78. gibson_cli-0.1.2.dist-info/RECORD +0 -103
  79. gibson_cli-0.1.2.dist-info/entry_points.txt +0 -2
  80. gibson_cli-0.1.2.dist-info/top_level.txt +0 -12
  81. {api → gibson/api}/BaseApi.py +0 -0
  82. {command → gibson/command}/Count.py +0 -0
  83. {command → gibson/command}/Forget.py +0 -0
  84. {command → gibson/command}/Show.py +0 -0
  85. {command → gibson/command}/Tree.py +0 -0
  86. {conf → gibson/conf}/Api.py +0 -0
  87. {conf → gibson/conf}/Code.py +0 -0
  88. {conf → gibson/conf}/Custom.py +0 -0
  89. {conf → gibson/conf}/Datastore.py +0 -0
  90. {conf → gibson/conf}/Dependencies.py +0 -0
  91. {conf → gibson/conf}/Frameworks.py +0 -0
  92. {conf → gibson/conf}/Modeler.py +0 -0
  93. {conf → gibson/conf}/Paths.py +0 -0
  94. {conf → gibson/conf}/Platform.py +0 -0
  95. {conf → gibson/conf}/Project.py +0 -0
  96. {conf → gibson/conf}/Version.py +0 -0
  97. {conf → gibson/conf}/dev/Api.py +0 -0
  98. {conf → gibson/conf}/dev/Base.py +0 -0
  99. {conf → gibson/conf}/dev/Model.py +0 -0
  100. {conf → gibson/conf}/dev/Schema.py +0 -0
  101. {core → gibson/core}/TimeKeeper.py +0 -0
  102. {core → gibson/core}/utils.py +0 -0
  103. {data → gibson/data}/default-ref-table.tmpl +0 -0
  104. {data → gibson/data}/default-table.tmpl +0 -0
  105. {db → gibson/db}/TableExceptions.py +0 -0
  106. {display → gibson/display}/Header.py +0 -0
  107. {display → gibson/display}/WorkspaceFooter.py +0 -0
  108. {display → gibson/display}/WorkspaceHeader.py +0 -0
  109. {services → gibson/services}/code/context/schema/DataDictionary.py +0 -0
  110. {structure → gibson/structure}/constraints/ReferenceConstraint.py +0 -0
  111. {structure → gibson/structure}/keys/IndexAttribute.py +0 -0
@@ -1,10 +1,10 @@
1
1
  import os
2
2
  import requests
3
3
 
4
- from services.auth.Server import Server as AuthServer
5
- from core.Configuration import Configuration
6
- from lang.Python import Python
7
- from core.Memory import Memory
4
+ from gibson.services.auth.Server import Server as AuthServer
5
+ from gibson.core.Configuration import Configuration
6
+ from gibson.lang.Python import Python
7
+ from gibson.core.Memory import Memory
8
8
 
9
9
  from .BaseApi import BaseApi
10
10
 
@@ -134,8 +134,8 @@ class Cli(BaseApi):
134
134
  return r.json()
135
135
 
136
136
  def login(self):
137
- token = AuthServer(self.get_app_domain()).get_token()
138
- return token
137
+ access_token, refresh_token = AuthServer(self.get_app_domain()).get_tokens()
138
+ return access_token, refresh_token
139
139
 
140
140
  def modeler_entity_modify(
141
141
  self, modeler_version, project_description, entity: dict, modifications: str
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
 
3
- from core.CommandRouter import CommandRouter
4
- from core.Configuration import Configuration
3
+ from gibson.core.CommandRouter import CommandRouter
4
+ from gibson.core.Configuration import Configuration
5
5
 
6
6
 
7
7
  def main():
@@ -1,9 +1,8 @@
1
- from api.Cli import Cli
2
- from dev.Dev import Dev
3
- from services.code.customization.Authenticator import Authenticator
4
- from core.TimeKeeper import TimeKeeper
5
-
6
- from .BaseCommand import BaseCommand
1
+ from gibson.api.Cli import Cli
2
+ from gibson.command.BaseCommand import BaseCommand
3
+ from gibson.core.TimeKeeper import TimeKeeper
4
+ from gibson.dev.Dev import Dev
5
+ from gibson.services.code.customization.Authenticator import Authenticator
7
6
 
8
7
 
9
8
  class Api(BaseCommand):
@@ -1,8 +1,7 @@
1
- from api.Cli import Cli
2
- from dev.Dev import Dev
3
- from core.TimeKeeper import TimeKeeper
4
-
5
- from .BaseCommand import BaseCommand
1
+ from gibson.api.Cli import Cli
2
+ from gibson.command.BaseCommand import BaseCommand
3
+ from gibson.core.TimeKeeper import TimeKeeper
4
+ from gibson.dev.Dev import Dev
6
5
 
7
6
 
8
7
  class Base(BaseCommand):
@@ -1,5 +1,5 @@
1
- from core.Configuration import Configuration
2
- from core.Memory import Memory
1
+ from gibson.core.Configuration import Configuration
2
+ from gibson.core.Memory import Memory
3
3
 
4
4
 
5
5
  class BaseCommand:
@@ -3,9 +3,8 @@ import sys
3
3
  from sqlalchemy import create_engine
4
4
  from sqlalchemy.orm import sessionmaker
5
5
 
6
- from db.TableExceptions import TableExceptions
7
-
8
- from .BaseCommand import BaseCommand
6
+ from gibson.command.BaseCommand import BaseCommand
7
+ from gibson.db.TableExceptions import TableExceptions
9
8
 
10
9
 
11
10
  class Build(BaseCommand):
@@ -3,17 +3,18 @@ import re
3
3
  import sys
4
4
  from string import Template
5
5
 
6
- from api.Cli import Cli
7
- from core.Configuration import Configuration
8
- from display.Header import Header
9
- from display.WorkspaceFooter import WorkspaceFooter
10
- from display.WorkspaceHeader import WorkspaceHeader
11
- from services.code.context.schema.Manager import Manager as CodeContextSchemaManager
12
- from structure.Entity import Entity
13
-
14
- from .BaseCommand import BaseCommand
15
- from .Merge import Merge
16
- from .Rewrite import Rewrite
6
+ from gibson.api.Cli import Cli
7
+ from gibson.command.BaseCommand import BaseCommand
8
+ from gibson.command.Merge import Merge
9
+ from gibson.command.Rewrite import Rewrite
10
+ from gibson.core.Configuration import Configuration
11
+ from gibson.display.Header import Header
12
+ from gibson.display.WorkspaceFooter import WorkspaceFooter
13
+ from gibson.display.WorkspaceHeader import WorkspaceHeader
14
+ from gibson.services.code.context.schema.Manager import (
15
+ Manager as CodeContextSchemaManager,
16
+ )
17
+ from gibson.structure.Entity import Entity
17
18
 
18
19
 
19
20
  class Code(BaseCommand):
@@ -1,6 +1,6 @@
1
1
  import sys
2
2
 
3
- from .BaseCommand import BaseCommand
3
+ from gibson.command.BaseCommand import BaseCommand
4
4
 
5
5
 
6
6
  class Conf(BaseCommand):
@@ -1,9 +1,8 @@
1
1
  import os
2
2
  import sys
3
3
 
4
- from lang.Python import Python
5
-
6
- from .BaseCommand import BaseCommand
4
+ from gibson.command.BaseCommand import BaseCommand
5
+ from gibson.lang.Python import Python
7
6
 
8
7
 
9
8
  class Dev(BaseCommand):
@@ -3,11 +3,10 @@ import sys
3
3
  from sqlalchemy import create_engine
4
4
  from sqlalchemy.orm import sessionmaker
5
5
 
6
- from api.Cli import Cli
7
- from db.TableExceptions import TableExceptions
8
-
9
- from .BaseCommand import BaseCommand
10
- from .Rewrite import Rewrite
6
+ from gibson.api.Cli import Cli
7
+ from gibson.command.BaseCommand import BaseCommand
8
+ from gibson.command.Rewrite import Rewrite
9
+ from gibson.db.TableExceptions import TableExceptions
11
10
 
12
11
 
13
12
  class Import(BaseCommand):
@@ -1,8 +1,7 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
-
5
- from .BaseCommand import BaseCommand
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
6
5
 
7
6
 
8
7
  class List(BaseCommand):
@@ -1,8 +1,7 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
-
5
- from .BaseCommand import BaseCommand
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
6
5
 
7
6
 
8
7
  class Merge(BaseCommand):
@@ -1,10 +1,9 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
- from dev.Dev import Dev
5
- from core.TimeKeeper import TimeKeeper
6
-
7
- from .BaseCommand import BaseCommand
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
5
+ from gibson.core.TimeKeeper import TimeKeeper
6
+ from gibson.dev.Dev import Dev
8
7
 
9
8
 
10
9
  class Model(BaseCommand):
@@ -1,8 +1,7 @@
1
- from api.Cli import Cli
2
- from dev.Dev import Dev
3
- from core.TimeKeeper import TimeKeeper
4
-
5
- from .BaseCommand import BaseCommand
1
+ from gibson.api.Cli import Cli
2
+ from gibson.command.BaseCommand import BaseCommand
3
+ from gibson.core.TimeKeeper import TimeKeeper
4
+ from gibson.dev.Dev import Dev
6
5
 
7
6
 
8
7
  class Models(BaseCommand):
@@ -1,8 +1,7 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
-
5
- from .BaseCommand import BaseCommand
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
6
5
 
7
6
 
8
7
  class Modify(BaseCommand):
@@ -1,9 +1,8 @@
1
1
  import re
2
2
  import sys
3
3
 
4
- from api.Cli import Cli
5
-
6
- from .BaseCommand import BaseCommand
4
+ from gibson.api.Cli import Cli
5
+ from gibson.command.BaseCommand import BaseCommand
7
6
 
8
7
 
9
8
  class Module(BaseCommand):
@@ -2,9 +2,8 @@ import os
2
2
  import re
3
3
  import sys
4
4
 
5
- from api.Cli import Cli
6
-
7
- from .BaseCommand import BaseCommand
5
+ from gibson.api.Cli import Cli
6
+ from gibson.command.BaseCommand import BaseCommand
8
7
 
9
8
 
10
9
  class New(BaseCommand):
@@ -2,9 +2,8 @@ import json
2
2
  import re
3
3
  import sys
4
4
 
5
- from api.Cli import Cli
6
-
7
- from .BaseCommand import BaseCommand
5
+ from gibson.api.Cli import Cli
6
+ from gibson.command.BaseCommand import BaseCommand
8
7
 
9
8
 
10
9
  class OpenApi(BaseCommand):
@@ -1,9 +1,8 @@
1
1
  import os
2
2
  import sys
3
3
 
4
- from api.Cli import Cli
5
-
6
- from .BaseCommand import BaseCommand
4
+ from gibson.api.Cli import Cli
5
+ from gibson.command.BaseCommand import BaseCommand
7
6
 
8
7
 
9
8
  class Question(BaseCommand):
@@ -1,9 +1,8 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
-
5
- from .BaseCommand import BaseCommand
6
- from .Rewrite import Rewrite
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
5
+ from gibson.command.Rewrite import Rewrite
7
6
 
8
7
 
9
8
  class Remove(BaseCommand):
@@ -1,9 +1,8 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
-
5
- from .BaseCommand import BaseCommand
6
- from .Rewrite import Rewrite
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
5
+ from gibson.command.Rewrite import Rewrite
7
6
 
8
7
 
9
8
  class Rename(BaseCommand):
@@ -1,9 +1,9 @@
1
1
  import os
2
2
  import shutil
3
3
 
4
- from core.Configuration import Configuration
5
- from services.code.customization.CustomizationManager import CustomizationManager
6
- from core.TimeKeeper import TimeKeeper
4
+ from gibson.core.Configuration import Configuration
5
+ from gibson.core.TimeKeeper import TimeKeeper
6
+ from gibson.services.code.customization.CustomizationManager import CustomizationManager
7
7
 
8
8
  from .Api import Api
9
9
  from .Base import Base
@@ -1,10 +1,9 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
- from dev.Dev import Dev
5
- from core.TimeKeeper import TimeKeeper
6
-
7
- from .BaseCommand import BaseCommand
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
5
+ from gibson.core.TimeKeeper import TimeKeeper
6
+ from gibson.dev.Dev import Dev
8
7
 
9
8
 
10
9
  class Schema(BaseCommand):
@@ -1,8 +1,7 @@
1
- from api.Cli import Cli
2
- from dev.Dev import Dev
3
- from core.TimeKeeper import TimeKeeper
4
-
5
- from .BaseCommand import BaseCommand
1
+ from gibson.api.Cli import Cli
2
+ from gibson.dev.Dev import Dev
3
+ from gibson.command.BaseCommand import BaseCommand
4
+ from gibson.core.TimeKeeper import TimeKeeper
6
5
 
7
6
 
8
7
  class Schemas(BaseCommand):
@@ -1,10 +1,9 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
- from dev.Dev import Dev
5
- from core.TimeKeeper import TimeKeeper
6
-
7
- from .BaseCommand import BaseCommand
3
+ from gibson.api.Cli import Cli
4
+ from gibson.dev.Dev import Dev
5
+ from gibson.command.BaseCommand import BaseCommand
6
+ from gibson.core.TimeKeeper import TimeKeeper
8
7
 
9
8
 
10
9
  class Test(BaseCommand):
@@ -1,8 +1,7 @@
1
- from api.Cli import Cli
2
- from dev.Dev import Dev
3
- from core.TimeKeeper import TimeKeeper
4
-
5
- from .BaseCommand import BaseCommand
1
+ from gibson.api.Cli import Cli
2
+ from gibson.dev.Dev import Dev
3
+ from gibson.command.BaseCommand import BaseCommand
4
+ from gibson.core.TimeKeeper import TimeKeeper
6
5
 
7
6
 
8
7
  class Tests(BaseCommand):
@@ -1,5 +1,5 @@
1
- from conf.Version import Version as VersionConf
2
- from .BaseCommand import BaseCommand
1
+ from gibson.command.BaseCommand import BaseCommand
2
+ from gibson.conf.Version import Version as VersionConf
3
3
 
4
4
 
5
5
  class Version(BaseCommand):
@@ -1,9 +1,8 @@
1
1
  import hashlib
2
2
  import sys
3
3
 
4
- from core.Conversation import Conversation
5
-
6
- from .BaseCommand import BaseCommand
4
+ from gibson.command.BaseCommand import BaseCommand
5
+ from gibson.core.Conversation import Conversation
7
6
 
8
7
 
9
8
  class WarGames(BaseCommand):
@@ -1,8 +1,8 @@
1
1
  import sys
2
2
 
3
- from ..BaseCommand import BaseCommand
4
- from .Login import Login
5
- from .Logout import Logout
3
+ from gibson.command.auth.Login import Login
4
+ from gibson.command.auth.Logout import Logout
5
+ from gibson.command.BaseCommand import BaseCommand
6
6
 
7
7
 
8
8
  class Auth(BaseCommand):
@@ -1,20 +1,19 @@
1
- from api.Cli import Cli
2
-
3
- from ..BaseCommand import BaseCommand
1
+ from gibson.api.Cli import Cli
2
+ from gibson.command.BaseCommand import BaseCommand
4
3
 
5
4
 
6
5
  class Login(BaseCommand):
7
6
  def execute(self):
8
7
  cli = Cli(self.configuration)
9
- token = cli.login()
8
+ access_token, refresh_token = cli.login()
10
9
 
11
- if token is None:
10
+ if access_token is None or refresh_token is None:
12
11
  self.conversation.newline()
13
12
  self.conversation.type(
14
13
  "Login failed, please try again with `gibson auth login`."
15
14
  )
16
15
  else:
17
- self.configuration.set_access_token(token)
16
+ self.configuration.set_auth_tokens(access_token, refresh_token)
18
17
  self.conversation.type(f"Welcome! You are now logged in.")
19
18
 
20
19
  self.conversation.newline()
@@ -1,4 +1,4 @@
1
- from ..BaseCommand import BaseCommand
1
+ from gibson.command.BaseCommand import BaseCommand
2
2
 
3
3
 
4
4
  class Logout(BaseCommand):
@@ -1,5 +1,5 @@
1
- from command.BaseCommand import BaseCommand
2
- from core.Configuration import Configuration
1
+ from gibson.command.BaseCommand import BaseCommand
2
+ from gibson.core.Configuration import Configuration
3
3
 
4
4
 
5
5
  def test_customization_management():
@@ -1,5 +1,5 @@
1
- from command.Conf import Conf
2
- from core.Configuration import Configuration
1
+ from gibson.command.Conf import Conf
2
+ from gibson.core.Configuration import Configuration
3
3
 
4
4
 
5
5
  def test_get_configuration_keys():
@@ -1,9 +1,9 @@
1
1
  import os
2
2
 
3
- from conf.dev.Api import Api
4
- from conf.dev.Base import Base
5
- from conf.dev.Model import Model
6
- from conf.dev.Schema import Schema
3
+ from gibson.conf.dev.Api import Api
4
+ from gibson.conf.dev.Base import Base
5
+ from gibson.conf.dev.Model import Model
6
+ from gibson.conf.dev.Schema import Schema
7
7
 
8
8
 
9
9
  class Dev:
@@ -1,4 +1,4 @@
1
- from conf.Dependencies import Dependencies
1
+ from gibson.conf.Dependencies import Dependencies
2
2
 
3
3
 
4
4
  def test_compute():
@@ -1,6 +1,6 @@
1
1
  import platform
2
2
 
3
- from conf.Platform import Platform
3
+ from gibson.conf.Platform import Platform
4
4
 
5
5
 
6
6
  def test_system():
@@ -1,39 +1,39 @@
1
1
  import sys
2
2
 
3
- from command.Api import Api
4
- from command.auth.Auth import Auth
5
- from command.Base import Base
6
- from command.Build import Build
7
- from command.Code import Code
8
- from command.Conf import Conf
9
- from command.Count import Count
10
- from command.Dev import Dev
11
- from command.Forget import Forget
12
- from command.Import import Import
13
- from command.List import List
14
- from command.Merge import Merge
15
- from command.Model import Model
16
- from command.Models import Models
17
- from command.Modify import Modify
18
- from command.Module import Module
19
- from command.New import New
20
- from command.OpenApi import OpenApi
21
- from command.Question import Question
22
- from command.Remove import Remove
23
- from command.Rename import Rename
24
- from command.Rewrite import Rewrite
25
- from command.Schema import Schema
26
- from command.Schemas import Schemas
27
- from command.Show import Show
28
- from command.Test import Test
29
- from command.Tests import Tests
30
- from command.Tree import Tree
31
- from command.Version import Version
32
- from command.WarGames import WarGames
33
- from .Configuration import Configuration
34
- from .Conversation import Conversation
35
- from .Env import Env
36
- from .Memory import Memory
3
+ from gibson.command.Api import Api
4
+ from gibson.command.auth.Auth import Auth
5
+ from gibson.command.Base import Base
6
+ from gibson.command.Build import Build
7
+ from gibson.command.Code import Code
8
+ from gibson.command.Conf import Conf
9
+ from gibson.command.Count import Count
10
+ from gibson.command.Dev import Dev
11
+ from gibson.command.Forget import Forget
12
+ from gibson.command.Import import Import
13
+ from gibson.command.List import List
14
+ from gibson.command.Merge import Merge
15
+ from gibson.command.Model import Model
16
+ from gibson.command.Models import Models
17
+ from gibson.command.Modify import Modify
18
+ from gibson.command.Module import Module
19
+ from gibson.command.New import New
20
+ from gibson.command.OpenApi import OpenApi
21
+ from gibson.command.Question import Question
22
+ from gibson.command.Remove import Remove
23
+ from gibson.command.Rename import Rename
24
+ from gibson.command.Rewrite import Rewrite
25
+ from gibson.command.Schema import Schema
26
+ from gibson.command.Schemas import Schemas
27
+ from gibson.command.Show import Show
28
+ from gibson.command.Test import Test
29
+ from gibson.command.Tests import Tests
30
+ from gibson.command.Tree import Tree
31
+ from gibson.command.Version import Version
32
+ from gibson.command.WarGames import WarGames
33
+ from gibson.core.Configuration import Configuration
34
+ from gibson.core.Conversation import Conversation
35
+ from gibson.core.Env import Env
36
+ from gibson.core.Memory import Memory
37
37
 
38
38
 
39
39
  class CommandRouter:
@@ -0,0 +1,35 @@
1
+ import os
2
+
3
+
4
+ class Completions:
5
+ def __init__(self):
6
+ self.user_home = os.environ.get("HOME")
7
+ self.gibson_config = ".gibsonai"
8
+
9
+ def install(self):
10
+ completions_location = f"$HOME/{self.gibson_config}/bash_completion"
11
+ installation = f"""\n[ -s "{completions_location}" ] && \\. "{completions_location}" # Load gibson auto completion\n"""
12
+
13
+ with open(f"{self.user_home}/.bashrc", "r+") as f:
14
+ if completions_location not in f.read():
15
+ f.write(installation)
16
+
17
+ with open(f"{self.user_home}/.zshrc", "r+") as f:
18
+ if completions_location not in f.read():
19
+ f.write(installation)
20
+
21
+ return self
22
+
23
+ def write(self):
24
+ try:
25
+ file = os.path.dirname(__file__) + f"/../data/bash-completion.tmpl"
26
+ with open(file, "r") as f:
27
+ contents = f.read()
28
+ except FileNotFoundError:
29
+ return self
30
+
31
+ completions = f"{self.user_home}/{self.gibson_config}/bash_completion"
32
+ with open(completions, "w") as f:
33
+ f.write(contents)
34
+
35
+ return self