Archi Forum

Discussion Boards => General Archi Discussion => Topic started by: Manj75 on August 11, 2021, 15:39:12 PM

Title: ACLI beginners questions
Post by: Manj75 on August 11, 2021, 15:39:12 PM
I have just started to explore usage of the ACLI to create windows batch script to carry out some scheduled activities.

Use Case: Remote repo contains the Enterprise Architecture model and I want to run daily a script that automates:

Questions on ACLI usage:


I hoping for the use case described above I can use

archi -application com.archimatetool.commandline.app -consoleLog -nosplash --modelrepository.cloneModel <url> --modelrepository.userName <userName> --modelrepository.passFile <password file> --html.createReport <path>

It would be good to have some example usage of --modelrepository

Are there any examples community ACLI scripts to look at - it would be good to see the power of ACLI used by others.
Title: Re: ACLI beginners questions
Post by: Phil Beauvoir on August 12, 2021, 08:24:13 AM
1. If I were to create an empty model using --createEmptyModel does this just a create a temporal current model in the run of the command and disposed when the archi command run exits, i.e. are all options in context to the given archi cmd execution?

Yes, this becomes the "current model". If you don't save it, it is discarded.


2. What are providers? Are these just categories under-the-hood but are covered by the listed options?

They're plug-ins that support some ACLI action(s). Each provider has a priority as explained in the wiki https://github.com/archimatetool/archi/wiki/Archi-Command-Line-Interface


3. Will --modelrepository.cloneModel <url> do the same as 'Import Remote Model to Workspace' in that it creates a local repo from the URL remote and not the same as a GIT clone?

It doesn't import it to the workspace but clones the repo to the specified folder given in the argument --modelrepository.loadModel. This is then loaded as the "current model".


4. Is the pass file used in -modelrepository.passFile <password file> plain text and only the password in the file no other notation?

Plain text of the password only. A file is used to avoid putting the password in the history of the terminal app.


It would be good to have some example usage of --modelrepository

It's basically this:

Archi -consoleLog -nosplash -application com.archimatetool.commandline.app
--modelrepository.cloneModel "<url of repo>"
--modelrepository.loadModel "<path to folder to clone to>"
--modelrepository.userName "<userName>"
--modelrepository.passFile "<pathtoPasswordFile>"


And you can also add:

-html.createReport <path>

Title: Re: ACLI beginners questions
Post by: Manj75 on August 12, 2021, 14:34:40 PM
Worked like a charm :)

There is no option in ACLI to carry out a repository commit and publish, which would be useful.

As --modelrepository cloneModel is creating a local git repo it should be possible to carry out the operations with commands such as:

--modelrepository commitModel <url>
--modelrepository publishModel <url>

<url> specified if needed as the cloneModel will create a .git so it should already know the url.


Commit model only if there are changes to the Current Model and publish will carry out a commit first then publish to the remote repo.

If this is not currently supported are there plans to support it and will it be in v4.9?
Title: Re: ACLI beginners questions
Post by: Phil Beauvoir on August 12, 2021, 14:42:33 PM
> If this is not currently supported are there plans to support it and will it be in v4.9?

This is discussed here - https://github.com/archimatetool/archi-modelrepository-plugin/issues/121

It would be part of coArchi 2, not Archi itself.
Title: Re: ACLI beginners questions
Post by: Manj75 on August 12, 2021, 15:16:08 PM
Looking at the GitHub issue it was tagged as an enhancement in Nov 2020 - is there any update to when coArchi 2 will be released?

Great news though, Archi is really becoming a mature powerful platform.