structurizr / cli

A command line utility for Structurizr.
https://docs.structurizr.com/cli
Apache License 2.0
492 stars 75 forks source link

"dsl" not a supported output format, contradicting docs #115

Closed tiilikainen closed 1 year ago

tiilikainen commented 1 year ago

Description

The export readme lists "dsl" as a valid output format:

dsl: extracts the DSL that was used to create a JSON workspace

However, running the export command with the dsl format type produces an error.

Was this feature planned and then not implemented, or implemented and then removed?

Steps to reproduce

  1. Install structurizr-cli via Homebrew
  2. Run structurizr-cli with parameters detailed below
  3. View error output

Screenshot

No response

Code sample

$ structurizr-cli export -w workspace.json -f dsl
Exporting workspace from workspace.json
 - loading workspace from JSON
 - no views defined; creating default views
 - unknown export format: dsl
 - unknown export format: dsl
 - finished

Configuration

$ structurizr-cli help
structurizr-cli: 1.30.0
structurizr-java: 1.24.0
structurizr-dsl: 1.30.0
structurizr-export: 1.14.0
structurizr-import: v1.4.1

Severity

Minor

Priority

Low

Resolution

I have no budget, please fix this for free

More information

No response

pcolby commented 1 year ago

This has been broken since v1.26.0 - ie works (work for me) on v1.25.0, but no later.

simonbrowndotje commented 1 year ago

tl;dr ... the DSL export feature was removed, and the docs were not updated fully.

The longer version of the story is that the Structurizr cloud service/on-premises installation used to support a browser-based modelling tool to author a workspace. This was discontinued a few years ago, with a recommendation to use the DSL instead. I built a feature that would convert a workspace into an equivalent DSL representation, to ease the migration, and this was available via the CLI. It was rudimentary, verbose, and didn't support any of the new features added after the workspace editor was discontinued ... which is why it was removed.

Newer DSL authored workspaces contain the DSL source that was used to create them, and the same export -format dsl command could be used to extract this DSL from the workspace. This doesn't work well once you start using any of the file based features (!include, !docs, etc), so was also removed.