Package: packagr-cli
Packagr CLIWhat is Packagr?Packagris a cloud hosted private repository for your private Python packages. The Packagr
CLI is a separate, open source project intended to support it by allowing you to perform most of Packagr's functionality
via the APIInstallationPackagr CLI can be installed via pip:pipinstallpackagr-cliIt can then be invoked via thepackagrcommand in any terminal window:packagr[command][args]CommandsConfigurepackagr configure <hash-id> <email> <password>You should call theconfigurecommand straight after you install Packagr CLI. This command will store your credentials
to a config file,packagr_conf.toml, that is referenced by many other of the Packagr CLI commands, and removes the
need for the Packagr CLI to contstantly prompt you for your password (as is the case withpip/twine)Parametershash-id: See belowemail: The email address you registered for Packagr withpassword: The password you registered for Packagr withWhere do I get my Packagr hash id?When you first sign up for aPackagraccount, you'll be assigned a unique repository url that
looks something like this:https://api.packagr.app/u893rj/The last part of this url is yourhash-idInitpackagr init <name> [--overwrite]In order to create a Package, Packagr needs a file calledpackagr.toml, which contains information about your package.
Thepackage initcommand creates this file for youThenameargument is optional - if not specified, the name will default to the name of the folder you invoke the call
from.Additionally, theinitcommand will also create a subfolder calledname, if one doesn't already exist. By default,
Packagr assumes that the code you want to package is stored in this folder. However, if you want to customize that, you
can easily do so by editing thepackagesparameter inpackagr.toml. It's also possible to modify any of the valuues
in the config file manually.Argumentsname(Optional): The name of your package--overwrite(Optional): If you try to runpackagr initin a folder where apackagr.tomlfile already exists, you
will be prompted to confirm that you want to overwrite the existing file. Passing this argument overrides the promptSetpackagr set <key> <value>Once yourpackagr.tomlfile has been created, you can use thesetcommand to set values within it. For example, if
you wanted to add a description to the config, you could enter the following command:packagrsetdescription"some information"You could equally just go into yourpackagr.tomlfile and add the linedescription = "some information"manually,
but the recommended way is to use the CLI - eventually, the CLI will validate the value ofkeyto ensure that it is
valid.If you enter a duplicate key, you will be prompted to confirm that you want to overwrite itArgumentskey: the setting keyvalue: the setting valueAddpackagr add <key> <value>Theaddcommand works in a similar way to thesetcommand, but it's purpose is to append data to arrays already
defined in the config. For example, if your config already looks like this:Authors=['Chris <chris@packagr.app>']Then you can update this value usingpackagr add Authors "some guy <me@example.com>"to change it to the following:Authors=["Chris <chris@packagr.app>","Some guy <me@example.com>",]Theaddcommand will also add a value to a key that doesn't exist.Argumentskey: the setting keyvalue: the setting valueInstallpackagr install <some-package>Theinstallcommand works in a similar way topip install- it installs a package using your current environment'spipinstallation. However, this command will also look for packages in your Packagr repository, as well as in the
public PyPI repository. Once a package is installed correctly, it will also be added to your config'sinstall_requiressectionArgumentspackages: a list of packages to install--ignore-errors: In case of multiple packages, passing this argument means that Packagr will continue attempting to
install the remaining packages on the list in the case that one failsUninstallpackagr uninstall <some-package>This command does the opposite ofinstall- it uninstalls a given package and removes it from the dependencies list.Argumentspackages: a list of packages to uninstall--ignore-errors: In case of multiple packages, passing this argument means that Packagr will continue attempting toBumppackagr bump <version> [--minor] [--major]Thebumpcommand increases the version number of your package. Used without arguments, e.g.packagr bump, it
increases the version number, e.g.1.0.0becomes1.0.0. Using the--minorargument increases the minor version
number, e.g.1.0.0 > 1.1.0and the--majorargument converts1.0.0to2.0.0. The--majorand--minorarguments can be used in conjuction with each other.Alternatively, you can usepackagr bump 4.5.6to set the version for a specific value. If you aren't usingsemver,
which means that thebumpcommand may not be able to parse the existing version number, then you can use this option
insteadArgumentsversion(optional): the version number to set. Not compatible with any other argument--minor(optional): Increase the minor version number--major(optional): Increase the major version numberPackagepackagr packageCreatessdistand/orwheelpackages based on your config file. Using the command without arguments will create a
package in both formats. Using--no-wheelorno-sdistwill prevent creation of specific formatsArguments--no-sdist: Don't build a tarball--no-wheel: Don't build a wheelUploadpackagr upload [--ignore-409]This command will push your package to Packagr. If you are uploading many packages at once, you may opt to use the--ignore-409argument, which will skip to the next package if encountering a 409 error (conflict for URL). In future,
Packagr CLI will have the ability to display detailed logs from Packagr, which offers a big advantage overtwine's
limited ability to handle error responsesCreate tokenpackagr create-token <package> <email> [--write-access]This command creates an access token for a given package and user. If the--write-accessflag is provided, then the
created token will have write access.Delete tokenpackagr token delete <package> <email>This command deletes an access token for a given package and user.Coming soonThe following commands will be added to future versions of Packagr CLI:packagr set-readme <readme-file>: passes the content of a readme file toDescriptionpackagr set-public <my-package>: Sets a package aspublicpackagr set-private <my-package>: Sets a package asprivate