Using the CLI

To initialize a new project:

  1. $
  1. edgedb project init

If an edgedb.toml file exists in the current directory, it will initialize a new project according to the settings defined in it.

Otherwise, a new project will be initialized and an edgedb.toml file and dbschema directory will be generated. For details on using projects, see the dedicated guide.

Once initialized, you can run the CLI commands below without additional connection options. If you don’t set up a project, you’ll need to use flags to specify the target instance for each command.

Explicitly create a new EdgeDB instance my_instance:

  1. $
  1. edgedb instance create my_instance

Create a database:

  1. $
  1. edgedb database create special_db
  1. OK: CREATE

Configure passwordless access (such as to a local development database):

  1. $
  2. >
  3. >
  4. >
  1. edgedb configure insert Auth \
  2. --comment 'passwordless access' \
  3. --priority 1 \
  4. --method Trust
  1. OK: CONFIGURE INSTANCE

Configure access that checks password (with a higher priority):

  1. $
  2. >
  3. >
  4. >
  1. edgedb configure insert Auth \
  2. --comment 'password is required' \
  3. --priority 0 \
  4. --method SCRAM
  1. OK: CONFIGURE INSTANCE

Connect to the default project database:

  1. $
  1. edgedb
  1. EdgeDB 1.0-beta.2+ga7130d5c7.cv202104290000 (repl 1.0.0-beta.2)
  2. Type \help for help, \quit to quit.
  3. edgedb>

Connect to some specific database:

  1. $
  1. edgedb -d special_db
  1. EdgeDB 1.0-beta.2+ga7130d5c7.cv202104290000 (repl 1.0.0-beta.2)
  2. Type \help for help, \quit to quit.
  3. special_db>