Tipe CLI
CLI for Tipe. Manage your content templates and projects.
Getting started
Install the CLI with npm
npm i @tipe/cli
with yarn
yarn add @tipe/cli
Create templates for your content
// tipe.js
module.exports = {
templates: {
home: {
name: 'Home',
fields: {
heroImage: {
name: 'Hero Image',
type: 'image'
},
heroTitle: {
name: 'Hero Title',
type: 'text'
}
}
}
}
}
Start the offline mock API
tipe serve
Query for mock content in your app with the SDK
npm i @tipe/js
yarn add @tipe/js
// app.js
const tipe = require('@tipe/js')({offline: true})
const getHomePageContent = () => tipe.document.list({template: 'home'})
Going to production
- Create an account on Tipe
- Push up your templates to your Tipe project
tipe push --config tipe.js --project your-project-id --apikey your-api-key
- Change SDK to use live API in Production
const tipe = require('@tipe/js')({
offline: process.env.NODE_ENV !== 'production',
project: YOUR_TIPE_PROJECT_ID,
key: YOUR_TIPE_API_KEY
})
Creating Templates
module.exports = {
templates: {
home: { // template id. Used in the API arguments and responses
disabled: false, // you can only disabled templates from the dashboard if you no longer need them
name: 'Home', // template name is used on the dashbard for content creators
fields: { // all templates must have fields
title: { // field id. Used in the API arguments and responses
disabled: false, // you can only disabled fields from the dashboard if you no longer need them
name: 'Title', // field name is used on the dashboard for content creators,
type: 'text' // the type of content
}
}
}
}
}
Field types
- text
- code
- markdown
- image
- button
- html
Issues
For problems directly related to the CLI, add an issue on GitHub.
For other issues, submit a support ticket.
Developing
yarn link
yarn install
The core plugins are located in ./src/commands
To cut a release, commit you messages using our commit guide