Available Commands

> yarn run tinacms

Usage: @tinacms/cli command [options]

  -V, --version             output the version number
  -h, --help                display help for command

  server:start [options]    Start Filesystem Graphql Server
  schema:compile [options]  Compile schema into static files for the server
  schema:types [options]    Generate a GraphQL query for your site's schema, (and optionally Typescript types)
  init [options]            Add Tina Cloud to an existing project
  audit [options]           Audit your schema and the files to check for errors
  help [command]            display help for command

Basic Usage:


The init command must be run inside of a Next.js project

npx @tinacms/cli init

This will,

  1. Install all of the dependencies you need
  2. Setup a basic content model in your schema.ts file
  3. Drop in a ready to go _app.js file
  4. Add an editable page at http://localhost:3000/demo/blog/helloWorld

tinacms server:start

To run this command, you must have a valid .tina/schema.ts file.

server:start will compile the schema into static files, generates typescript types for you to use in your project and starts a graphQL server on http://localhost:4001

This command also takes the following arguments

-c-c allows you to run a command as a child process. For example, you could run your next project alongside the graphQL server yarn tinacms server:start -c next dev.
--port <port>Specify a port to run the server on. (default 4001)
--noWatchDon't regenerate config on file changes. This option is good to add when building in CI or if you do not want to watch the file system for changes.
--noSDKDon't generate the generated client SDK. Read here for more details about the SDK

Advanced Usage:

tinacms schema:compile

schema:compile is used to compile and transpile the schema files into static file(s) ready to be used with the server. The compilation can be found in the .tina/__generated__/config directory.

tinacms schema:types

schema:types will generate a GraphQL query for your site's schema and typescript files. You will find the generated files in the .tina/__generated__/ directory.

tinacms audit (Experimental)

audit is used for checking for errors in your in your files. It currently does two things.

  1. Checks to see if the files have the correct extension
  2. Submits each file as a Graphql mutation and checks for Graphql errors

By default the mutation will not change the content of the files.

Takes the following options,

--cleanWhen this flag is used, it really submits the Graphql mutations to the file system. This means that it will clean out any fields that are not defined in your schema.ts. It is a good practice to do a git commit before doing this so one can undo changes easily.