Tina Docs
Introduction
Core Concepts
Querying Content
Editing
Customizing Tina
Going To Production
Media
Drafts
Guides
Further Reference

Available Commands

$ tinacms <command>
Commands:
dev [options] Builds Tina and starts the dev server
build [options] Build the CMS and autogenerated modules for usage with TinaCloud
init [options] Add TinaCloud to an existing project
audit [options] Audit your schema and the files to check for errors
search-index [options] Builds the TinaCMS search index and uploads it to TinaCloud
help [command] display help for command

Common options

Here are some common options that can be used in both tinacms dev and tiancms build

Basic Usage:

"tinacms dev"

To run this command, you must have a valid tina/config.{ts,tsx,js,jsx} file.

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

This command takes the arguments listed in the common options

NextJS Example:
tinacms dev -c \"next dev\"
Other SSG Frameworks Example
tinacms dev -c \"<Yor Dev Command>\"

"tinacms build"

This command compiles and validates the schema and generates the client and types. It will also ensure your content has finished indexing.

Options

This command takes all the common options as well as a few others:

Examples:

Building for production with TinaCloud for data fetching

tinacms build && next build

Building for production with a SSG

tinacms build && <Your SSG build command>

Using the local client and local graphql server

tinacms build --local -c "next build"

This will

  • Start the local graphql server
  • Generate the local TinaCMS client that will query the local file system
  • Produce local image paths
  • build production SPA
  • run Next build

"npx @tinacms/cli@latest init"

The init command must be run inside of an existing project (E.g a NextJS project, Hugo, Jekyll, etc).
npx @tinacms/cli init

This will:

  • Install all required dependencies for Tina.
  • Define a basic content schema in the tina directory.
  • Create example content in the demo directory.
  • Edit the package.json to have the dev, build, and start scripts run the tina GraphQL API.
Options

"tinacms audit"

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

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

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

Options

"tinacms search-index"

This command builds the search-index using the content in your repository and uploads it to TinaCloud.