Skip to content
apigent init

apigent init

Create a .apigent/ directory so collections and environments can live in your repository, next to the code that uses them.

Synopsis

apigent init [--project-dir <path>]

apigent init writes .apigent/ (with .apigent/.gitignore, which keeps local collection.key files out of git). After that, apigent walks up parent directories to find .apigent/; in CI, point at it with APIGENT_PROJECT_DIR or the global --project-dir flag.

.apigent/
  collections/
    users-api/
      collection.json
      list-users.json
      collection.key   # local only, gitignored
  environments/
    staging.json

Flags

FlagShortDefaultDescription
--project-dircurrent directoryProject root for .apigent file storage

Examples

Start a project in the current repo

apigent init

Move an existing collection into the project and commit it

apigent collection migrate "payments-api"
git add .apigent
git commit -m "add payments API collection"

Initialize another directory

apigent init --project-dir ./services/billing

Related commands