All Projects → contentful → Contentful Cli

contentful / Contentful Cli

Licence: mit
The official Contentful command line interface. Use Contentful features straight from the command line!

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Contentful Cli

Httpie
As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie
Stars: ✭ 53,052 (+26426%)
Mutual labels:  api, cli, json
Emuto
manipulate JSON files
Stars: ✭ 180 (-10%)
Mutual labels:  api, cli, json
Ponzu
Headless CMS with automatic JSON API. Featuring auto-HTTPS from Let's Encrypt, HTTP/2 Server Push, and flexible server framework written in Go.
Stars: ✭ 5,373 (+2586.5%)
Mutual labels:  api, cli, json
Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (-6%)
Mutual labels:  api, cli, json
Http Prompt
An interactive command-line HTTP and API testing client built on top of HTTPie featuring autocomplete, syntax highlighting, and more. https://twitter.com/httpie
Stars: ✭ 8,329 (+4064.5%)
Mutual labels:  api, cli, json
Smoke
💨 Simple yet powerful file-based mock server with recording abilities
Stars: ✭ 142 (-29%)
Mutual labels:  api, json
Jsonrpc
The jsonrpc package helps implement of JSON-RPC 2.0
Stars: ✭ 143 (-28.5%)
Mutual labels:  api, json
Mojo Webqq
【重要通知:WebQQ将在2019年1月1日停止服务,此项目目前已停止维护,感谢大家四年来的一路陪伴】使用Perl语言(不会没关系)编写的smartqq/webqq客户端框架(非GUI),可通过插件提供基于HTTP协议的api接口供其他语言或系统调用
Stars: ✭ 1,755 (+777.5%)
Mutual labels:  api, cli
Api Diff
A command line tool for diffing json rest APIs
Stars: ✭ 164 (-18%)
Mutual labels:  api, json
Oq
A performant, and portable jq wrapper to facilitate the consumption and output of formats other than JSON; using jq filters to transform the data.
Stars: ✭ 132 (-34%)
Mutual labels:  cli, json
World Cup.json
Free open public domain football data for the world cups in JSON incl. Russia 2018 and more - No API key required ;-)
Stars: ✭ 152 (-24%)
Mutual labels:  api, json
Live Stream Radio
24/7 live stream video radio station CLI / API 📹 📻
Stars: ✭ 175 (-12.5%)
Mutual labels:  cli, json
Loophole
Polar devices Python API and CLI.
Stars: ✭ 136 (-32%)
Mutual labels:  api, cli
Aping
angular module to get and display data by adding html-attributes
Stars: ✭ 135 (-32.5%)
Mutual labels:  api, json
Grafanajsondatasource
Grafana datasource to load JSON data over your arbitrary HTTP backend
Stars: ✭ 146 (-27%)
Mutual labels:  api, json
Jstp
Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
Stars: ✭ 132 (-34%)
Mutual labels:  api, json
Restinstance
Robot Framework library for RESTful JSON APIs
Stars: ✭ 157 (-21.5%)
Mutual labels:  api, json
Vcspull
🔄 synchronize projects via yaml/json manifest. built on libvcs
Stars: ✭ 187 (-6.5%)
Mutual labels:  cli, json
Jsonapi Utils
Build JSON API-compliant APIs on Rails with no (or less) learning curve.
Stars: ✭ 191 (-4.5%)
Mutual labels:  api, json
Sabisu Rails
Simple and powerful engine for exploring your Rails api application
Stars: ✭ 129 (-35.5%)
Mutual labels:  api, json

Contentful CLI

Contentful's command line interface tool. Use Contentful features straight from your CLI.

npm Build Status codecov

Contentful provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.

🚀 Features

  • Securely login and logout with our OAuth service.
  • Manage spaces - List, create, ...
  • Export your space to a JSON file.
  • Import your space from a JSON file.
  • Execute migration scripts written in the Contentful Migration DSL
  • Generate migration scripts for the Contentful Migration DSL from existing spaces.
  • Seed your space with example data.
  • Manage installation of extensions in a space.
  • Run a guide which introduces you to the Contentful basics.
  • Find all available commands in the docs section.
  • More to come soon! 🚀

☁️ Pre-requisites && Installation

Pre-requisites

  • Node LTS

Installation

Using npm:

npm install -g contentful-cli

Using yarn:

yarn global add contentful-cli

Please note that for the non standalone versions you need Node LTS to use the CLI.

✋ Usage

Use the --help parameter to display the help section for CLI tool or combined with a specific command to get the help section for that command.

contentful --help
# or
contentful space --help

Using the CLI tool with a proxy

You can save the proxy configuration in your .contentfulrc.json via:

contentful config add --proxy user:[email protected]:port

We also respect the http(s)_proxy environment variables:

https_proxy=user:[email protected]:port contentful

When multiple proxy configurations exists, precedence is taken in this form:

  1. http_proxy takes precedence over .contentfulrc.json
  2. https_proxy takes precedence over .contentfulrc.json
  3. https_proxy takes precedence over http_proxy

⛑ Troubleshooting

  • Unable to connect to Contentful through your Proxy? Try settings rawProxy: true in your .contentfulrc.json via:
contentful config add --raw-proxy

📚 Documentation

More detailed documentation for every command can be found in the docs section.

🛠 Development

After installing the dependencies, there is a trick to get your version of the CLI tool available globally on your system:

npm link

This may collide with your already globally installed Contentful CLI. Make sure to remove that one first.

🤖 Testing

Integration Tests

We are using talkback proxy to record and playback http requests in our integration tests. To run tests with the talkback proxy and recordings, simply run

npm run test:integration

For development, it might be easier to run the talkback proxy in one shell and run tests ad-hoc (or with a --watch flag) using jest commands in another shell. This flow might look like this:

npm run pretest:integration // ensure config is set up correctly for tests
npm run run-talkback-proxy // start proxy in one shell

// open another shell

jest test/integration/cmds/space/* --watch // run tests using jest in another shell

See jest documentation for more details about running tests and optional flags.

⚠️ Environment variables for integration tests must be set:

CLI_E2E_CMA_TOKEN = <cma_auth_token>
CLI_E2E_ORG_ID = <organization_id>

Updating Snapshots

You might need to update snapshots and it's challenging with the recordings.

Tip: run tests without recordings to update the snapshots.

jest test/integration/cmds/<path to the affected test file> --updateSnapshot

If running jest alone, not from an npm script, you'll need to make sure your local config is set up correctly for the tests.


npm run pretest:integration // this backs up your current config and puts in integration test config
./bin/contentful.js config list // check what's in there if you're curious
./bin/contentful.js config remove --proxy // remove proxy config since you're not using talkback recordings
./bin/contentful.js config remove --raw-proxy

npm run posttest:integration // after running your tests, this restores your config to how it was before

❓ Support

If you have a problem with this tool, please file an issue here on Github.

If you have other problems with Contentful not related to this library, you can contact Customer Support.

✍️ Contributing

See CONTRIBUTING.md

📜 License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].