Commandline interface (CLI)
Twinpack provides several commands to manage and configure packages for your projects and PLCs via the commandline rather than the IDE - This is very useful for CI/CD. Note that all commands by default will not use Beckhoff's Automation Interface and instead manipulate files directly. Installing and uninstalling packages on the system is not possible with only file manipulations, instead you have to manually install the downloaded packages via 'RepTool'. However, it is also possible to pass a --headed argument to make twinpack perform the actions with the Automation Interface instead, which enables installing and uninstalling as well if needed.
Below is a brief summary of the available commands, along with example usage. For more detailed information, you can always use the --help option with any command.
The command-line interface is available for Windows and is additionally compiled with .NET. This allows to run the (headless) interface with GNU/Linux. In the latter case, make sure you have installed the dotnet runtime for your operating system (e.g. sudo apt install -y dotnet-sdk-8.0) and replace the command twinpack.exe with dotnet twinpack.dll.
config
Configures or modifies the package source repositories used by Twinpack. The configuration is saved in "%APPDATA%\Zeugwerk\Twinpack\sourceRepositories.json", login information is stored in the Windows Credentials Manager.
Example Usage:
twinpack.exe config --source https://my-packages.com --type "Beckhoff Repository"
twinpack.exe config --purge --source "https://my-packages.com" --type "NuGet Repository" --username "MyUsername" --password "MyPassword"
twinpack.exe config --reset
search
Searches packages in all configured package sources
Example Usage:
twinpack.exe search
twinpack.exe search MySearchTerm
list
Lists packages configured in the .Zeugwerk/config.json file or the first solution found in the current directory.
Example Usage:
twinpack.exe list --plc MainPLC
twinpack.exe list MySearchTerm
download
Downloads package(s) from the configured sources to your system, the download folder is ".Zeugwerk/libraries".
Example Usage:
twinpack.exe download --package PackageName
twinpack.exe download --package PackageName --version 2.3.4
set-version
Sets the version of the PLC(s). If a PLC is part of a larger framework, the command can also be used to update all packages, which are part of the same framework.
Example Usage:
twinpack.exe set-version 1.1.0
twinpack.exe set-version 1.1.0 --plc MyPlc
twinpack.exe set-version 1.1.0 --plc MyPlc --sync-framework-packages
add
Adds package(s) to a specified project and PLC using the configured sources. The command downloads, installs and adds the packages to the PLC's references—including dependencies if requested.
Example Usage:
twinpack.exe add --project MyProject --plc MainPLC --package PackageName
twinpack.exe add --project MyProject --plc MainPLC --package PackageName --version 1.0.0
remove
Removes package(s) from a specified project and PLC.
Example Usage:
twinpack.exe remove --project MyProject --plc MainPLC --package PackageName
twinpack.exe remove --project MyProject --plc MainPLC
help
For detailed information about each command and its available options, you can use the --help argument:
Example Usage:
twinpack.exe <command> --help