Skip to main content

@takeshape/cli

The TakeShape CLI tsg aids in local development of TakeShape projects that use the TakeShape SSG, Ship. The CLI handles local authentication to the TS API.

@takeshape/cli is compatible with MacOS and Linux / Unix operating systems, and Windows 10 with Windows Subsystem for Linux.

Install

NPM

npm install -g @takeshape/cli

Usage

takeshape <command>

Commands

login

link

unlink

build

watch

schema

types

status

import

export

validate

Options

--token, -t TakeShape API auth token

--cliLogin, -l Log in using CLI (do not open browser)

--site, -s TakeShape static site id

--file, -f path to tsg.yml

--output, -o build output path

--endpoint, -e endpoint

--version, -v tsg version number

--cache -c use file cache (default false)

--watchContent, -W rebuild on content change (watch only)

Environment variables

TS_EXPERIMENTAL_PAGE_SIZE

NODE_ENV

TS_SITE_ID

TS_SITE_NAME

TS_API_KEY

import Options

--schema import a takeshape schema JSON file to the currently linked projectuse either --schema or --project not both, must be combined with --from

--project import a takeshape project from given directory, zip or url use either --project or --schema not both, must be combined with --from

--from specifies the file, directory, zip or url to import

--to either "new-project" or "current-project". Default is "new-project".

--name for use with --project specifies a new name for the imported project

export Options

--schema export a takeshape schema JSON file use either --schema or --project not both, must be combined with --to

--project export a takeshape project zip use either --project or --schema not both, must be combined with --to

--withoutData when using --project skip exporting the data

--to specifies the directory to write the exported data to

types Options

--to specifies the file to write the generated type definitions to, overwriting an existing file if it exists

validate Options

--path path to the schema file to validate, or the directory it is in (default "./schema.json")

Examples

$ takeshape build --file path/to/tsg.yml
$ takeshape schema && takeshape types --to /src/types/takeshape.d.ts