-
Notifications
You must be signed in to change notification settings - Fork 24
New coapp command line interface
The CoApp command line client has a simple, yet flexible interface.
When redirecting or piping the results of a CoApp command, the tool will suppress cosmetic formatting and simply list the results of the given command (very useful for chaining the results of one execution into another).
CoApp [options] <command> <parameters>
Command | Short Command | Switch Shortcut | Description |
---|---|---|---|
list-package |
list |
-l |
lists packages |
get-packageinfo |
info |
-g |
shows extended package information |
install-package |
install |
-i |
installs a package |
remove-package |
remove * |
-r |
removes a package |
update-package |
update |
-u |
updates a package |
trim-packages |
trim |
-t |
trims unnecessary packages |
activate-package |
activate |
-a |
makes a specific package the 'current' |
block-package |
block |
-b |
marks a package as 'blocked' |
unblock-package |
unblock |
-B |
unblocks a package |
mark-package |
mark |
-m |
marks a package as 'required' |
unmark-package |
unmark |
-M |
unmarks a package as 'required' |
list-feed |
feeds |
-f |
lists the feeds known to the system |
add-feed |
add |
-A |
adds a feed to the system |
remove-feed |
remove * |
-R |
removes a feed from the system |
Note: the * indicates that the remove command will operate slightly differently depending on context (if you pass a feed to it, it will act as remove-feed
, otherwise it will act as remove-package
)
All commands are in the form verb-noun (similar to Windows PowerShell cmdlets) and can be followed by zero or more parameters.
Any commands that takes parameters after the command will accept a list of packages on the command line or via stdin
.
list-package <pkg-spec>...
Lists all packages that meet the criteria.
get-packageinfo <pkg-spec>...
Returns extended package information for all packages that meet the criteria.
install-package <pkg-spec>...
Installs all packages that meet the criteria.
Option | Description |
---|---|
--upgrade:fail |
Returns an error message if a the user attempts to install a package that isn't the most recent version. |
--upgrade:true |
Default Automatically upgrades packages to the most recent version that can be installed. |
--upgrade:false |
Forces the package manager to install the version specified. |
--force:true |
Forces the package manager to install the package even if the dependencies can not be resolved or installed. |
remove-package <pkg-spec>...
Removes all packages that meet the criteria.
update-package <pkg-spec>...
Updates all packages that meet the criteria to the latest version.
trim
Removes all unrequested and unnecessary packages.
activate-package <pkg-spec>...
Marks a given package as the 'active' one (likely, makes it the default in the path).
block-package <pkg-spec>...
Marks a package so that it can't be updated or removed .
unblock-package <pkg-spec>...
Marks a package so that it can be updated or removed.
mark-package <pkg-spec>...
Marks a package as 'user requested'--so that a trim
function will not remove it.
unmark-package <pkg-spec>...
Unmarks a package as 'user requested'--may be removed if the package isn't a dependency of another package
list-feed
Lists all the package feeds known
add-feed <feed-location>...
Adds a package feed to the system.
remove-feed <feed-location>...
Removes a package feed from the system.
<pkg-spec>...
Packages have a canonical name (in the form packagename-##.##.##.##-arch-publickeytoken
) which uniquely identifies it apart from other packages. Commands expecting a package name will always take the full canonical name or alternatively, the user can provide a partial name and CoApp will attempt to determine what the user is requesting.
Generally there are three types of inputs that can be specified for the package:
- a canonical package name (or partial canonical name)
If a wildcard *
is present in the given name, that will match against the rest of the name.
If there isn't a wildcard specfied, and the given value isn't a complete canonical name, the package manager will add a wildcard, in one of two ways:
- if the given name contains a dash (
-
), a*
will be appended to the end of the given name. - if the given name doesn't contain a dash (
-
), a-*
will be appended to the end of the given name.
Examples:
Matching an exact package:
firefox-1.2.3.4-x86-1234123412341234
Matching a given version from any publisher:
firefox-1.2.3.4-x86
firefox-1.2.3.4-x86*
firefox-1.2.3.4-x86-*
Matching a version (will attempt to get the platform that is currently running)
firefox-1.2.3.4-*
Match a partial version:
firefox-1.
firefox-1.*
Or just the package name:
firefox
firefox-*
Or, all packages starting with firefox
firefox*
- a local path (to either a package file or a package directory for use as a package feed ) Examples:
(single file examples)
c:\desktop\myprogram-1.0.0.0-any.msi
(package feed examples)
c:\users\garrett\downloads\packages
c:\users\garrett\downloads\packages\special\*.msi
c:\users\garrett\downloads\packages
- a URL (to either a remote package file, or a package atom feed for use as a package feed )
Single file examples:
http://coapp.org/repository/coapp.tools-1.2.3.4-any.msi
Package feed examples:
http://coapp.org/feed
http://www.somecompany.com/packages.xml
There are several options that can be used to filter the list of packages:
Option | Description |
---|---|
--name=<text> |
filters the list of packages by the given name. may contain Wildcard |
--min-version=<text> |
filters the list of packages by packages of at least the given version |
--max-version=<text> |
filters the list of packages by packages of at most the given version |
--arch=<value> |
filters the list of packages by the given architecture { x86, x64, any, all } |
--public-key-token=<text> |
filters the list of packages by the given public key token (this lets you choose packages by a particular publisher) |
--installed=<value> |
filters based on if the package is installed { true,false,all } |
--active=<value> |
filters based on if the package is the currently active version { true,false,all } |
--required=<value> |
filters based on if the package is required by the user (or as a dependency of a required package) { true,false,all } |
--blocked=<value> |
filters based on if the package is blocked { true,false,all } |
--latest=<value> |
filters to just the highest version { true,false,all } |
<feed-location>...
Generally there are two types of inputs that can be specified for package feeds:
- a local path (either a package directory, or a file mask for use as a package feed)
Examples:
c:\users\garrett\downloads\packages
c:\users\garrett\downloads\packages\special\*.msi
c:\users\garrett\downloads\packages
- a URL (a package atom feed for use as a package feed )
Examples:
http://coapp.org/feed
http://www.somecompany.com/packages.xml
Forces feeds to be rescanned to find updated package information:
--force-scan
c:\test> coapp list-package
(lists packages)
Will list everything known to the package manager. Probably a lot!
c:\test> coapp list-package firefox
(lists all the packages with the name `firefox`)
Will list everything known to the package manager. Probably a lot!
c:\test> coapp --installed=false --highest list-package firefox | coapp install-package
Finds the package named firefox
that has the highest version and pipes that to the tool to install it.