Docs/CLI Reference/Usage Examples

GibsonAI CLI Usage Examples

Use the GibsonAI CLI to manage GibsonAI directly from the terminal

Building a Project End-to-End Using AI

  1. Go to app.gibsonai.com

  2. Chat with GibsonAI and create a new project.

  3. Once complete, GibsonAI will email you the API key.

  4. Configure the API key:

    gibson conf api::key [API key]
  5. Import your project:

    gibson import api

✨ Magic, right?


Integrating a Model into Your Code

GibsonAI creates base-level SQLAlchemy models. To integrate them just do this:

from my_project.gibsonai.model.Module import ModuleBase

class MyModule(ModuleBase):
    pass

When you need to add custom business logic to the model, just modify your version of the model:

from my_project.gibsonai.model.Module import ModuleBase

class MyModule(ModuleBase):
    def my_custom_business_logic(self):
        return 1 + 1

We strongly suggest you do not refer to the base level SQLAlchemy models directly. By sub-classing you won't have to refactor your code if you decide to add custom code.


Integrating a Schema into Your Code

Currently, refer to the base-level schema directly.


Migrating Your Software from PHP to Python

  1. Configure your datastore:

    gibson conf datastore::uri mysql+pymysql://[user]:[password]@[host]/[database name]
  2. Turn on Dev Mode:

    gibson dev on
  3. Import your MySQL schema:

    gibson import mysql

Well done! 70% of your code is written automatically. Customize the rest!


Asking GibsonAI Questions With Context

Use natural language queries:

gibson q [natural language request]

You can reference:

  • Files: file://[full path]
  • Python modules: py://[import]
  • SQL entities: sql://[entity name]

Examples

gibson q format file:///Users/me/file.py for PEP8
gibson q code review py://user.modules.User
gibson q add nickname to sql://user

Using sql:// enables GibsonAI to:

  • Create new entities
  • Store them in last memory
  • Let you generate models/schemas instantly
gibson code model user

Need help?

Join our Discord Server to ask questions or see what others are doing with GibsonAI.

Last updated on

Was this page helpful?