This reference documents every command available in the Saruni command-line interface. The CLI helps you develop, test and deploy your application right from the terminal.
Saruni commands start with
yarn saruni but
yarn sr is available as an alias for convenience.
dev command launches development servers that boot up local instances of Serverless functions, our Prisma client and the Next.js project powering the frontend.
yarn saruni dev
db) commands handle common actions related to our datastore.
db init command creates a Prisma project by creating a schema file.
yarn saruni db init
db seed command creates entities defined in
api/src/db/seed within our datastore.
yarn saruni db seed
db migrate commands create and apply migration scripts to our datastore.
db migrate save command saves a new migration to the
api/prisma/migrations directory and updates the
_Migration table of the datastore.
yarn saruni db migrate save
db migrate up command executes migrations that have not been run against our datastore.
yarn saruni migrate up
gen commands are helpers that take the work out of common web development workflows.
gen graphql (or
gen gql) command generates code from our GraphQL schema and operations based on the documents found in
web/src/graphql. For example, if we added a
getUser query in our web package, we can expect
useGetUser() hooks to be available as an import from the
yarn saruni gen graphql
gen emails command compiles email templates found in the
yarn saruni gen emails