tidy-cli
v0.1.8
Published
Tidy CMS command line tools
Downloads
12
Readme
tidy-cli (beta)
TidyCMS command line utility to programmatically create and update Tidy sites.
Note: This package is beta stage, please send address your questions and feedback to [email protected]
Prerequisites for tidy-cli
- Tidy account and team
- Create your account and team at https://start.tidycms.com
- If you already have an account and you use FaceBook or Google+ to sign in then you need to set the password to your account.
- Preferrably create a CLI-user with specific email and password for cli usage.
- Node JS + NPM - https://nodejs.org/en/download/
Installation
$ npm install -g tidy-cli
Usage
$ tidy-cli --help
Usage: cli [options] [command]
Commands:
login Log in to Tidy
teams [options] List teams your account has access
sites [options] List sites for team
create-sites [options] Create one or multiple sites to team from json file
Options:
-h, --help output usage information
-V, --version output the version number
-q, --quiet do not output to console
-u, --user [email] Tidy account email address (optional)
-p, --pass [password] Account password (optional)
Help for different commands can be accessed by:
$ cli [command] --help
Authentication
tidy-cli supports 3 different methods of authentication
Interactive
$ tidy-cli login
Inline
$ tidy-cli [command] --user [email protected] --pass my-fantastic-password
Credentials file
Create a file that contains email + password in JSON and chmod the file to 0600 For Windows the permissions step can be skipped, just create the file.
$ vi ~/.tidycms
--
{
"email": "[email protected]",
"password": "my-fantastic-password"
}
--
$ chmod 0600 ~/.tidycms
// check that auth credentials work by listing your tidy teams
$ tidy-cli teams
Creating site (quick start)
// 1. Download an example of tidy compatible create site JSON:
$ tidy-cli create-sites --example --output ./create-site.json
// 2. The example JSON file already has the 'team' field set to your default team and the 'from' field contains the slug of the Valet demo-site. If your team already has some sites, you can use one of this sites as a template.
// 3. Send your create-site.json to Tidy and receive a response of newly created site
$ tidy-cli create-sites --file ./create-site.json --output ./my-new-site.json
Newly created site will be available at https://start.tidycms.site/dashboard
Creating multiple sites (advanced case)
// 1. Download the full example of tidy compatible create site JSON
$ tidy-cli create-sites --example-full --output ./create-sites-example.json
// 2. Modify ./create-sites-example.json according to your project:
* Set the value to the 'team' field. It supposed to be the team slug, and the CLI user needs to be the member of this team;
* Set the values for the 'from' field for each site. This field should contain the slug of the site to be used as a template of the newly created site.
Note the CLI user needs the permissions for this template site: the template site can be in the same team, or shared, or the CLI user can accept the invite to this site;
* For each page the template name should be provided in the 'template' field of create site JSON. The templates should exist and belong to the site you use in the 'from' field;
* Please make sure the page slugs are unique for the site.
Consider generating your own ./create-sites.json with the same schema automatically. Whis way you can get the most of tidy-cli and use it as a website mass-production tool.
// 3. Send your create-sites.json to Tidy and receive a response of newly created sites
$ tidy-cli create-sites --file ./create-sites.json --output ./my-new-sites.json
Newly created sites will be available at https://start.tidycms.site/dashboard