$ tinacms <command>Commands:dev [options] Builds Tina and starts the dev serverbuild [options] Build the CMS and autogenerated modules for usage with TinaCloudinit [options] Add TinaCloud to an existing projectaudit [options] Audit your schema and the files to check for errorssearch-index [options] Builds the TinaCMS search index and uploads it to TinaCloudhelp [command] display help for command
Here are some common options that can be used in both tinacms dev
and tiancms build
Argument | Description |
-c | -c allows you to optionally run a command as a child process. For example, you could run your Next.js project alongside the graphQL server yarn tinacms dev -c next dev . |
--port <port> | Specify a port to run the server on. (default 4001) |
--datalayer-port <port> | Specify a port to run the local level server. (default 9000) |
--noWatch | Don'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. |
--noSDK | Don't generate the generated client SDK. Read here for more details about the SDK. |
-v ,--verbose | increase verbosity of logged output (default: false) |
--rootPath | Specify the root directory to run the CLI from (defaults to current working directory) |
--noTelemetry | don't report anonymous telemetry |
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
tinacms dev -c \"next dev\"
tinacms dev -c \"<Yor Dev Command>\"
This command compiles and validates the schema and generates the client and types. It will also ensure your content has finished indexing.
This command takes all the common options as well as a few others:
Argument | Description |
--tina-graphql-version | Specify the version of @tinacms/graphql that the backend will use. (Only needed in advanced cases) |
--local | Will start the local Graphql server and generate the local client. This is useful for static builds but will not work with SSR |
--skip-cloud-checks | Skip the TinaCloud checks (dangerous and not recommended) |
--skip-search-indexing | Skip the search indexing |
--no-client-build-cache | Disables automatic caching of queries by local client |
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
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:
tina
directory.package.json
to have the dev
, build
, and start
scripts run the tina GraphQL API.Argument | Description |
--noTelemetry | Disables Open Source Telemetry |
The audit
command is used for checking for errors in your in your files. It currently does two things.
By default the mutation will not change the content of the files.
Argument | Description |
--clean | When this flag is used, it submits actual Graphql mutations to the file system. This means that it will clean out any fields that are not defined in your schema. It is a good practice to do a git commit before doing this so unintended changes can be easily undone. |
-v ,--verbose | increase verbosity of logged output (default: false) |
This command builds the search-index using the content in your repository and uploads it to TinaCloud.
Product
Resources
© TinaCMS 2019–2024