With the Keel CLI you can run your project locally, run tests, validate your schema, and scaffold out new functions. For instructions on how to install the Keel CLI and get your development environment setup see the Local Environment docs.
From your Keel project directory, use
keel run to start a development server for your project.
This command will:
- Set up the database including running any migrations
- Validate your schema
- Setup your functions
- Start a development server
- Watch for any changes to your schema or function files
While the development server is running you can access a GraphiQL playground for your API at
If you want to reset your database you can pass the
--reset flag to the
$ keel run --reset
--reset will delete all your data in your local database.
Keel supports writing tests with the Vitest (opens in a new tab) framework. The
keel test command runs your tests with a sandboxed database and a development server, so you can write tests against your APIs.
You can learn more about how to write tests in Keel here
You can validate your Keel project using
keel validate which report any schema or function errors.
@teamkeel/sdk package that you use in your functions is generated from your schema files. When running a development server with
keel run this package will be re-generated automatically but if you want to manually re-generate it you can use
generate command will also scaffold out any missing function files for you.