Skip to content

Repository files navigation

Stargazers MIT License Discord

Kontent.ai CLI

Command-line interface for Kontent.ai.

Warning

Under active development. The command surface is incomplete and may change between releases. More commands are added incrementally. Breaking changes may occur.

Important

Looking for the previous CLI? The content-migration and environment backup/restore commands from earlier @kontent-ai/cli versions are deprecated. That functionality now lives in @kontent-ai/data-ops.

Prerequisites

Installation

Run without installing:

npx @kontent-ai/cli@latest <command>

Or install globally to get the kontent command:

npm install -g @kontent-ai/cli
kontent <command>

Using @latest ensures you run the newest version.

Authentication

Most commands require you to be signed in.

kontent login
kontent logout

Commands

Run kontent --help for the full, always-current list. Each command supports --help for its own options.

Command Description
kontent login Authenticate with Kontent.ai via Auth0 device flow
kontent logout Clear stored authentication tokens
kontent mapi <endpoint> Send an authenticated request to the Management API
kontent project sample bootstrap Clone a sample app for an environment and wire its .env

Global options

  • --logLevel, -ll — detail level: none, standard (default), verbose
  • --verbose — shortcut for --logLevel verbose
  • --configFile — path to a JSON file with CLI parameters
  • --help, -h / --version, -v

Everything the log level governs goes to stderr, and none silences errors along with progress — a failed command is then visible only through its exit code. What a command was asked to produce goes to stdout and is never gated by the log level.

Environment variables

Environment variables are read individually where they apply — they are not mapped onto option names, so an unrelated KONTENT_* variable in your shell never reaches the parser.

  • KONTENT_MAPI_KEY — Management API key for kontent mapi, used when --mapiKey is absent
  • DO_NOT_TRACK, KONTENT_DO_NOT_TRACK, KONTENT_TELEMETRY_DEBUG — see TELEMETRY.md

Telemetry

The CLI collects anonymous usage data. See TELEMETRY.md for details and opt-out.

Contributing

Contributions are welcome. See CONTRIBUTING.md for details.

License

Distributed under the MIT License. See LICENSE.md.

About

Kontent.ai command line interface

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

16 watching

Forks

Releases

Used by

Contributors

Languages