Key Terms

  • Dev Mode
    Turn dev mode on to have GibsonAI write code for you as you execute commands.

  • Entity / Entities
    Synonymous with a table name or data structure.

  • Memory

    • stored: long-term memory
    • last: memory of the most recent action taken
  • Merge
    Merge the entities in the last memory into the stored memory.


Memory Concepts

GibsonAI CLI maintains two types of memory:

  • Stored (long term)
    Contains your stable database schema. When you import a datastore or API project, the schema and all entities go here.

  • Last (short term)
    Holds new or modified entities from recent CLI commands. Preferred first when performing coding tasks.

Example Flow

gibson modify user I want to add nickname

Creates a new user table with a nickname column in last memory.

gibson code models

Writes code based on what’s in last memory.

To discard last changes:

gibson forget last

To make changes permanent:

gibson merge

To rebuild the datastore with all stored entities:

gibson build datastore

build will drop all existing tables and recreate the database from scratch.


Configuration Files and Caches

All files are located at:

$HOME/.gibsonai
  • Update configuration:

    gibson conf
  • Clear caches:

    gibson forget

API Key Configuration

gibson conf api::key [API key]

Datastore Configuration

Currently supported: MySQL

gibson conf datastore::uri mysql+pymysql://[user]:[password]@[host]/[database name]

Turning On Dev Mode

We suggest keeping dev mode enabled to let GibsonAI write code automatically.

gibson dev on

You’ll be prompted to set paths for:

  • base: base-level code
  • model: SQLAlchemy models
  • schema: Pydantic schemas

Importing Your Datastore

gibson import mysql

Also available:

gibson import pg_dump /path/to/pg_dump.sql
gibson import openapi /path/to/openapi.json

Configuring a Custom BaseModel

Example:

gibson conf code::custom::model::class MyBaseModel
gibson conf code::custom::path project.model.MyBaseModel

Code Generation Commands

  • Write base code:

    gibson code base
  • Single model:

    gibson code model [entity name]
  • Single schema:

    gibson code schema [entity name]
  • All models:

    gibson code models
  • All schemas:

    gibson code schemas

Adding a New Module Using AI

gibson module [module name]
gibson code models
gibson merge

Note: GibsonAI does not yet build the tables into your datastore.


Modifying Software Using AI

gibson modify [entity name] [natural language request]

Example:

gibson modify my_table I want to add a new column called name and remove all of the columns related to email

Then:

gibson code models
gibson merge

Note: Changes are not built into your datastore automatically.


Forgetting Things from Memory

  • Forget stored:

    gibson forget stored
  • Forget last:

    gibson forget last
  • Forget all:

    gibson forget all

Build Datastore from Stored Memory

gibson build

Show Stored Entity

gibson show [entity name]