In this document, we will cover the various commands available in Tyk Sync.

Dump Command

AspectDetails
Commandtyk-sync dump
Usagetyk-sync dump -d DASHBOARD_URL [-s SECRET] [-t PATH]
Flags-d, --dashboard DASHBOARD_URL: Tyk Dashboard URL (required)
-h, --help: Help for the dump command
-t, --target PATH: Target directory for output files (optional)
-s, --secret SECRET: API secret for Dashboard access (optional)
--apis IDS: Specific API IDs to dump
--oas-apis IDS: Specific OAS API IDs to dump
--policies IDS: Specific policy IDs to dump
--templates IDS: Specific template IDs to dump
Exampletyk-sync dump --dashboard http://tyk-dashboard:3000 --secret your-secret
Exampletyk-sync dump --dashboard http://tyk-dashboard:3000 --secret your-secret --target /path/to/backup --apis c2ltcGxlLWdyYXBoLWRldi90eWthcGktc2NoZW1h,baa5d2b65f1b45385dac3aeb658fa04c

Examples Command

AspectDetails
Commandtyk-sync examples
Usagetyk-sync examples [flags]
tyk-sync examples [command]
Subcommandspublish: Publish a specific example
show: Show details of a specific example
Flags-h, --help: Help for examples command
Exampletyk-sync examples

Examples Show Command

AspectDetails
Commandtyk-sync examples show
Usagetyk-sync examples show [flags]
Flags-h, --help: Help for show command
-l, --location string: Location of the example
Exampletyk-sync examples show --location="udg/vat-checker"

Examples Publish Command

AspectDetails
Commandtyk-sync examples publish
Usagetyk-sync examples publish [flags]
Flags-b, --branch string: Branch to use (default “refs/heads/main”)
-d, --dashboard string: Dashboard target URL
-g, --gateway string: Gateway target URL
-h, --help: Help for publish command
-k, --key string: Key file location for auth
-l, --location string: Location of the example
-s, --secret string: API secret
--test: Use test publisher, output to stdio
Exampletyk-sync examples publish -d="http://localhost:3000" -s="b2d420ca5302442b6f20100f76de7d83" -l="udg/vat-checker"

Publish Command

AspectDetails
Commandtyk-sync publish
Usagetyk-sync publish {-d DASHBOARD_URL | -g GATEWAY_URL} [-s SECRET] [-b BRANCH] [-k SSHKEY] [-o ORG_ID] REPOSITORY_URL

tyk-sync publish {-d DASHBOARD_URL | -g GATEWAY_URL} [-s SECRET] [-o ORG_ID] -p PATH
Flags-b, --branch BRANCH: Git branch (default “refs/heads/master”)
-d, --dashboard DASHBOARD_URL: Dashboard URL
-g, --gateway GATEWAY_URL: Gateway URL
-h, --help: Help for publish command
-k, --key SSHKEY: SSH key file location
-p, --path PATH: Source file directory
-s, --secret SECRET: API secret
--no-delete: Skip deletion of resources during synchronisation
--test: Use test publisher
--allow-duplicate-listenpaths: Allow duplicate listen paths
--apis IDS: Specific API IDs to publish
--oas-apis IDS: Specific OAS API IDs to publish
--policies IDS: Specific policy IDs to publish
--templates IDS: Specific template IDs to publish
Exampletyk-sync publish -d http://tyk-dashboard:3000 -s your-secret -p /app/data --apis 726e705e6afc432742867e1bd898cb23
Exampletyk-sync publish -d http://tyk-dashboard:3000 -s your-secret -b develop https://github.com/your-repo/your-apis

Sync Command

AspectDetails
Commandtyk-sync sync
Usagetyk-sync sync {-d DASHBOARD_URL | -g GATEWAY_URL} [-s SECRET] [-b BRANCH] [-k SSHKEY] [-o ORG_ID] REPOSITORY_URL

tyk-sync sync {-d DASHBOARD_URL | -g GATEWAY_URL} [-s SECRET] [-o ORG_ID] -p PATH
Flags-b, --branch BRANCH: Git branch (default “refs/heads/master”)
-d, --dashboard DASHBOARD_URL: Dashboard URL
-g, --gateway GATEWAY_URL: Gateway URL
-h, --help: Help for sync command
-k, --key SSHKEY: SSH key file location
-o, --org ORG_ID: Override organization ID
-p, --path PATH: Source file directory
-s, --secret SECRET: API secret
--test: Use test publisher
--apis IDS: Specific API IDs to sync (to be deprecated)
--policies IDS: Specific policy IDs to sync (to be deprecated)
Exampletyk-sync sync -d http://tyk-dashboard:3000 -s your-secret https://github.com/your-repo/your-apis
Exampletyk-sync sync -d http://tyk-dashboard:3000 -s your-secret -p /path/to/your/apis

Update Command

AspectDetails
Commandtyk-sync update
Usagetyk-sync update {-d DASHBOARD_URL | -g GATEWAY_URL} [-s SECRET] [-b BRANCH] [-k SSHKEY] [-o ORG_ID] REPOSITORY_URL

tyk-sync update {-d DASHBOARD_URL | -g GATEWAY_URL} [-s SECRET] [-o ORG_ID] -p PATH
Flags-b, --branch BRANCH: Git branch (default “refs/heads/master”)
-d, --dashboard DASHBOARD_URL: Dashboard URL
-g, --gateway GATEWAY_URL: Gateway URL
-h, --help: Help for update command
-k, --key SSHKEY: SSH key file location
-p, --path PATH: Source file directory
-s, --secret SECRET: API secret
--test: Use test publisher
--apis IDS: Specific API IDs to update
--oas-apis IDS: Specific OAS API IDs to update
--policies IDS: Specific policy IDs to update
--templates IDS: Specific template IDs to update
Exampletyk-sync update -d http://tyk-dashboard:3000 -s your-secret -p /app/data --apis 726e705e6afc432742867e1bd898cb23
Exampletyk-sync update -d http://tyk-dashboard:3000 -s your-secret -b develop https://github.com/your-repo/your-apis