Because of the way doco evolved (first as a command scripting tool, then a configuration scripting tool), there's not a terribly clear distinction in the docs or examples, but there is actually a major difference between the two. Configuration scripting (declarations) determine the content of the docker-compose configuration, including defining jq functions or adding jq filters to do so. Once the config is generated, such declarations don't have much value. Likewise, there are APIs that only make sense to use in commands.
Phase 1
Phase 2
(It may be that the aliasing feature could be considered in terms of aliases and tags: tag-service foo -- bar baz would mean, "if foo ever exists, add it to group bar", while alias-service foo doco.exec-default would mean "if foo ever exists, set group doco.exec-default equal to it.)
Because of the way doco evolved (first as a command scripting tool, then a configuration scripting tool), there's not a terribly clear distinction in the docs or examples, but there is actually a major difference between the two. Configuration scripting (declarations) determine the content of the docker-compose configuration, including defining jq functions or adding jq filters to do so. Once the config is generated, such declarations don't have much value. Likewise, there are APIs that only make sense to use in commands.
Phase 1
GROUP --all :=all-services at end of loaddocofunction during config loading, enable it afterPhase 2
if-service foo target --default set foo(It may be that the aliasing feature could be considered in terms of aliases and tags:
tag-service foo -- bar bazwould mean, "iffooever exists, add it to groupbar", whilealias-service foo doco.exec-defaultwould mean "iffooever exists, set groupdoco.exec-defaultequal to it.)