Trouble with Sync In

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [ ] Bug report
  • [ ] Performance issue
  • [x] Documentation issue or request

https://docs.squidex.io/02-documentation/developer-guides/automation-tools#use-cases

My command to import all data excluding rules (as I want to do these last)
sq sync in backup -t schemas workflows app content

CLI Response.
Unrecognized command or argument 'workflows'

Help text provided by CLI showing workflows as an option.
.\sq.exe sync in --help Imports the app from a folder Usage: sq.exe sync in [options] [arguments] Arguments: folder <TEXT> The target folder to synchronize. Options: -t | --targets (Multiple) <TEXT> The targets to sync, e.g. schemas, workflows, app, rules. --nodelete Use this flag to prevent deletions.

Could you please improve this documentation.

  • Example usage with multiple targets (should they be comma separated? multiple -t ? etc)
  • List all available targets for the command ideally in a table with description pointing to section of CMS
  • Unclear which one of the listed targets imports content

I think its probably a regression and it should be workflow and im going to dig up my post from a year ago. [SOLVED] Sq sync in -t workflow can't associate schemas

I actually discussed that with my documentation guy yesterday.

I think it is multiple -t

Could you please provide me the two commands to import everything but rules and then rules?

It should be

sync in -t app -t assets -t assetFolders -t contents -t schemas -t workflows

and

sync in -t rules

Glad i asked. There is no mention of assets or asset folders :-1:

No, but there is a targets command

e.g.

sync targets

Where can I find that command in the documentation?

As I mentioned: The documentation will be improved, but the CLI exposes all commands. for example

.\sq.exe 

Required command was not provided

Usage: dotnet sq.dll [command]

Commands:

  apps     Manages apps.
  assets   Manages assets.
  backup   Manage backups.
  config   Manage configurations.
  content  Manage contents.
  info     Shows information about the CLI.
  log      Analyze request log.
  openlib  Openlibrary example.
  schemas  Manage schemas.
  sync     Synchronizes apps.
  twitter  Manage twitter.

Use "dotnet sq.dll [command] --help" for more information about a command.

Then you can dig in

.\sq.exe sync
Required command was not provided

Synchronizes apps.

Usage: dotnet sq.dll sync [command]

Commands:

  describe  Describe the synced folder.
  in        Imports the app from a folder.
  new       Creates a new folder with sample files how to create an app from json files.
  out       Exports the app to a folder.
  targets   List all targets.

Use "dotnet sq.dll sync [command] --help" for more information about a command.

And get the targets

.\sq.exe sync targets


(I just added the description, so the output will look differently)

 -------------------------------------------------------------------------------------------------------------------------------
 | Name         | Description                                                                                                  |
 -------------------------------------------------------------------------------------------------------------------------------
 | assetfolders | Synchronizes all asset folders, even if they do not contain assets.                                          |
 -------------------------------------------------------------------------------------------------------------------------------
 | assets       | Synchronizes all assets and creates asset folders if they do not exist yet.                                  |
 -------------------------------------------------------------------------------------------------------------------------------
 | schemas      | Synchronizes all schemas, but not the content.                                                               |
 -------------------------------------------------------------------------------------------------------------------------------
 | app          | Synchronize all app settings: clients, contributors, roles, languages and asset scripts. But not: workflows. |
 -------------------------------------------------------------------------------------------------------------------------------
 | contents     | Synchronizes all content items across all schemas.                                                           |
 -------------------------------------------------------------------------------------------------------------------------------
 | rules        | Synchronizes all rules, but not rule events.                                                                 |
 -------------------------------------------------------------------------------------------------------------------------------
 | workflows    | Synchronizes all workflows from the app settings.                                                            |
 -------------------------------------------------------------------------------------------------------------------------------

 Count: 7

Or you use --help for a single command:

.\sq.exe sync in --help

Imports the app from a folder.

Usage: dotnet sq.dll sync in [options] <folder>

Arguments:

  folder  <TEXT>
  The target folder to synchronize.

Options:

  --app                      <TEXT>
  The name of the app. If not provided then app configured in currentApp gets created.

  -t | --targets (Multiple)  <TEXT>
  The targets to sync, e.g. 'contents' or 'schemas'. Use 'sync targets' to view all targets.

  --language (Multiple)      <TEXT>
  The content language to synchronize.

  --content-action           <CONTENTACTION>
  Defines how to handle content.
  Allowed values: Upsert, UpsertPatch, Create, Update, Patch

  --delete
  Use this flag to also delete entities.

  --patch-content
  Make content updates as patch.

  --recreate
  Use this flag to also recreate entities.

  --skip-assets
  Use this flag to sync asset folders but not assets.

  --update-current-client
  Also update the client that is used during the sync process.

  --emulate
  Use this flag to not make any updates and to emulate the changes.

I have deployed the new version with the improved target description.

1 Like

out of curiosity when would you want to sync folders but not assets? Especially since the assets command syncs folders.

Thanks for the update. Hoping in a years time when i have to use it again the documentation is in sync with the CLI. I don’t have the CLI setup on my machine so I end up making changes in our pipeline and having to wait for the result.

Can i sneak in a feature request that the CLI doesn’t require a config to run? I would much rather set environment variables for ClientID and ClientSecret and have it run from that. We run it in CI to sync our schemas etc so we end up having to setup a new config every time we use the CLI in the pipeline

The targets to sync, e.g. ‘sync in -t contents -t schemas’. Use ‘sync targets’ to view all targets.

I think demonstrating the most complex case will make the simple case clearer of just -t contents or whatever

1 Like

Changed and deployed.