Working with the command line
The command line program "tcpkg" enables the management of TwinCAT components (workloads) or individual packages.
- The TwinCAT Package Manager must be installed. The "tcpkg" command is then available on the system.
- The command line program "tcpkg" can be executed in a Powershell or a classic command line. Administration rights are required for most actions.
- The command integrates a help system. With "tcpkg -h" the top-level help can be called up; with "tcpkg list -h", for example, detailed help for the "list" command can be called up.
- Visual Studio/XAE Shell may need to be closed for the installation.
Commands for the command line
This list is a choice to give an overview of the most important commands.
Queries
- List of all available packages incl. workloads
tcpkg list
- List of all versions of all available packages
tcpkg list -a [NameOfPackage]
- List of all available workloads
tcpkg list -t workload
- List of all configured feeds
tcpkg source list
- List of all available packages from a specific feed
tcpkg list -n [NameOfSource]
- List of all installed packages
tcpkg list -i
- List of all installed packages that can be upgraded
tcpkg list -o
- Display information about a package
tcpkg show [NameOfPackage]
- List of the dependencies of a package
tcpkg resolve [NameOfPackage]
Working with packages: Installing, upgrading, and uninstalling
- Installing a package or workload with dependencies
tcpkg install [NameOfPackage]
- Installing a package or workload in a given version
tcpkg install [NameOfPackage]=[VersionOfPackage]
Example:tcpkg install TwinCAT.XAE.PLC=3.6.16
- Installing a Visual Studio integration package (after the configuration has been changed, see below)
tcpkg install [vs2017.ext|vs2019.ext|vs2022.ext|tcxaeshell.ext|tcxaeshell64.ext]
- Upgrade a package
tcpkg upgrade [NameOfPackage]
- Upgrade all installed packages
tcpkg upgrade all
- Uninstalling a package
tcpkg uninstall [NameOfPackage]
- Uninstalling a package with dependencies
tcpkg uninstall [NameOfPackage] --include-dependencies
Configuration
- Add a feed
tcpkg source add -n=[NameOfSource] -s=[LinkToSource] --priority=[UniqueValue, highest is 1] -u=[UserName] [--password-stdin]
Information: LinksToSource for normal cases: https://public.tcpkg.beckhoff-cloud.com/api/v1/feeds/[testing/stable]
UserName for Beckhoff feeds: myBeckhoff account email address
Password is requested interactively, but can also be read (from TcPkg CLI 2.1.96) by STDIN using–password-stdin
(Powershell example:Get-Content pwd.txt | tcpkg source add … --password-stdin
) - Changing a feed
tcpkg source edit [NameOfSource] --priority=[NewUniqueValue]
- Switching a feed on or off without deleting it
tcpkg source edit [NameOfSource] --enabled true / false
- Setting the Visual Studio integrations:
tcpkg config set -n [useVS2017|useVS2019|useVS2022|useTcXaeShell|useTcXaeShell64]
Information: After a change, the corresponding integration must be executed:
For example:tcpkg install vs2022.ext
- Removing the Visual Studio integrations
tcpkg config unset -n [useVS2017|useVS2019|useVS2022|useTcXaeShell|useTcXaeShell64]
Information: The corresponding integration must be executed after a change:
For example:tcpkg uninstall vs2022.ext