nexuscli.cli package

Submodules

nexuscli.cli.root_commands module

Handles base/root commands (as opposed to subcommands)

nexuscli.cli.root_commands.cmd_del(*args, **kwargs)

Alias for cmd_delete()

nexuscli.cli.root_commands.cmd_delete(nexus_client, options)

Performs nexus3 delete

nexuscli.cli.root_commands.cmd_dl(*args, **kwargs)

Alias for cmd_download()

nexuscli.cli.root_commands.cmd_download(nexus_client, args)

Performs nexus3 download

nexuscli.cli.root_commands.cmd_list(nexus_client, args)

Performs nexus3 list

nexuscli.cli.root_commands.cmd_login(_, __)

Performs nexus3 login

nexuscli.cli.root_commands.cmd_ls(*args, **kwargs)

Alias for cmd_list()

nexuscli.cli.root_commands.cmd_up(*args, **kwargs)

Alias for cmd_upload()

nexuscli.cli.root_commands.cmd_upload(nexus_client, args)

Performs nexus3 upload

nexuscli.cli.subcommand_cleanup_policy module

Usage:
nexus3 cleanup_policy create <policy_name> [–format=<format>]
[–downloaded=<days>] [–updated=<days>]

nexus3 cleanup_policy list

Options:
--format=<format>
 Accepted: all or a repository format [default: all]
--downloaded=<days>
 Cleanup criteria; last downloaded in this many days.
--updated=<days>
 Cleanup criteria; last updated in this many days.
Commands:
cleanup_policy create Create or update the cleanup policy <policy_name> cleanup_policy list List all existing cleanup policies.
nexuscli.cli.subcommand_cleanup_policy.cmd_create(nexus_client, args)

Performs nexus3 cleanup_policy create

nexuscli.cli.subcommand_cleanup_policy.cmd_list(nexus_client, _)

Performs nexus3 cleanup_policy list

nexuscli.cli.subcommand_cleanup_policy.main(argv=None)

Entrypoint for nexus3 cleanup_policy subcommand.

nexuscli.cli.subcommand_repository module

Usage:

nexus3 repository list nexus3 repository show <repo_name> nexus3 repository (delete|del) <repo_name> [–force] nexus3 repository create hosted (bower|npm|nuget|pypi|raw|rubygems|docker)

<repo_name> [–blob=<store_name>] [–strict-content] [–cleanup=<c_policy>] [–write=<w_policy>]
nexus3 repository create proxy (bower|npm|nuget|pypi|raw|rubygems|yum)
<repo_name> <remote_url> [–blob=<store_name>] [–strict-content] [–cleanup=<c_policy>] [–remote_auth_type=<remote_auth_type>] [–remote_username=<username>] [–remote_password=<password>]
nexus3 repository create hosted maven
<repo_name> [–blob=<store_name>] [–strict-content] [–cleanup=<c_policy>] [–write=<w_policy>] [–version=<v_policy>] [–layout=<l_policy>]
nexus3 repository create proxy maven
<repo_name> <remote_url> [–blob=<store_name>] [–strict-content] [–cleanup=<c_policy>] [–version=<v_policy>] [–layout=<l_policy>] [–remote_auth_type=<remote_auth_type>] [–remote_username=<username>] [–remote_password=<password>]
nexus3 repository create hosted yum
<repo_name> [–blob=<store_name>] [–strict-content] [–cleanup=<c_policy>] [–write=<w_policy>] [–depth=<repo_depth>]
nexus3 repository create proxy docker
<repo_name> <remote_url> [–blob=<store_name>] [–strict-content] [–cleanup=<c_policy>] [–v1_enabled] [–force_basic_auth] [–index_type=<index_type>] [–http_port=<http_port>] [–https_port=<https_port>] [–remote_auth_type=<remote_auth_type>] [–remote_username=<username>] [–remote_password=<password>]
nexus3 repository create hosted docker
<repo_name> [–blob=<store_name>] [–strict-content] [–cleanup=<c_policy>] [–write=<w_policy>] [–v1_enabled] [–force_basic_auth] [–http_port=<http_port>] [–https_port=<https_port>]
nexus3 repository create hosted apt
<repo_name> [–blob=<store_name>] [–strict-content] [–cleanup=<c_policy>] [–write=<w_policy>] [–gpg=<gpg-file-path>] [–passphrase=passphrase] [–distribution=<distribution>]
nexus3 repository create proxy apt
<repo_name> <remote_url> [–blob=<store_name>] [–strict-content] [–cleanup=<c_policy>] [–write=<w_policy>] [–remote_auth_type=<remote_auth_type>] [–remote_username=<username>] [–remote_password=<password>] [–flat] [–distribution=<distribution>]
Options:
--blob=<store_name>
 Use this blob with new repository [default: default] # noqa: E501
--depth=<repo_depth>
 Depth (0-5) where repodata folder(s) exist [default: 0]
--layout=<l_policy>
 Accepted: strict, permissive [default: strict]
--strict-content
 Enable strict content type validation
--version=<v_policy>
 Accepted: release, snapshot, mixed [default: release]
--write=<w_policy>
 Accepted: allow, allow_once, deny [default: allow_once]
--cleanup=<c_policy>
 Accepted: an existing Cleanup Policy name

-f –force Do not ask for confirmation before deleting –v1_enabled Enable v1 registry [default: False] –index_type=<index_type> Accepted: registry, hub, custom [default: registry] –force_basic_auth Force to use basic authentication against this docker repo –remote_auth_type=<remote_auth_type> Accepted: username [default: None] –remote_username=<remote_username> Remote username –remote_password=<remote_password> Remote password –gpg=<gpg-file-path> gpg file [default: ./public.gpg.key] –passphrase=<passphrase> passphrase for the given gpg [default: ] –distribution=<distribution> filter distributions [default: buster] –flat flat repository [default: False]

Commands:
repository create Create a repository using the format and options provided repository delete Delete a repository. repository list List all repositories available on the server repository show Show the configuration for a repository as JSON.
nexuscli.cli.subcommand_repository.cmd_create(nexus_client, args)

Performs nexus3 repository create commands

nexuscli.cli.subcommand_repository.cmd_del(*args, **kwargs)

Alias for cmd_delete()

nexuscli.cli.subcommand_repository.cmd_delete(nexus_client, args)

Performs nexus3 repository delete

nexuscli.cli.subcommand_repository.cmd_list(nexus_client, _)

Performs nexus3 repository list

nexuscli.cli.subcommand_repository.cmd_show(nexus_client, args)

Performs ``nexus3 repository show

nexuscli.cli.subcommand_repository.main(argv=None)

Entrypoint for nexus3 repository subcommand.

nexuscli.cli.subcommand_script module

Usage:
nexus3 script create <script_name> <script_path> [–script_type=<type>] nexus3 script list nexus3 script run <script_name> [<script_args>] nexus3 script (delete|del) <script_name>
Options:
--script_type=<type>
 Script type [default: groovy]
Commands:
script create Create or update a script using the <script_path> file script list List all scripts available on the server script del Remove existing <script_name> script run Run the existing <script_name> with optional <script_args>
nexuscli.cli.subcommand_script.cmd_create(nexus_client, args)

Performs nexus3 script create

nexuscli.cli.subcommand_script.cmd_del(*args, **kwargs)

Alias for cmd_delete()

nexuscli.cli.subcommand_script.cmd_delete(nexus_client, args)

Performs nexus3 script delete

nexuscli.cli.subcommand_script.cmd_list(nexus_client, _)

Performs nexus3 script list

nexuscli.cli.subcommand_script.cmd_run(nexus_client, args)

Performs nexus3 script run

nexuscli.cli.subcommand_script.main(argv=None)

Entrypoint for nexus3 script subcommand.

nexuscli.cli.util module

nexuscli.cli.util.find_cmd_method(arguments, methods)

Helper to find the corresponding python method for a CLI command.

Suitable python methods must be named cmd_COMMAND, where COMMAND is the CLI command and cmd_ is a hard-coded prefix.

Parameters:
  • arguments – the return of docopt.docopt().
  • methods – the return value from globals(), as-is
Returns:

the python method corresponding to the given CLI command. None if no suitable method is found.

Return type:

Union[callable, None]

nexuscli.cli.util.get_client()

Returns a Nexus Client instance. Prints a warning if a configuration file isn’t file.

Return type:nexuscli.nexus_client.NexusClient
nexuscli.cli.util.input_with_default(prompt, default=None)

Prompts for a text answer with an optional default choice.

Parameters:
  • prompt – question to be displayed to user
  • default – default choice
Returns:

user-provided answer or None, if default not provided.

Return type:

Union[str,None]

Module contents

Nexus 3 CLI.

Usage:
nexus3 –help # run this to see full list of commands/subcommands nexus3 –version nexus3 login nexus3 (list|ls) <repository_path> nexus3 (upload|up) <from_src> <to_repository> [–flatten] [–norecurse] nexus3 (download|dl) <from_repository> <to_dst> [–flatten] [–nocache] nexus3 (delete|del) <repository_path> nexus3 <subcommand> [<arguments>…]
Options:
-h –help This screen. For help with sub-commands, run
nexus3 <subcommand> -h
--version Show the Nexus3 CLI version and exit
--flatten Flatten directory structure on nexus3 transfers [default: False]
--nocache Force download even if local copy is up-to-date [default: False]
--norecurse Don’t process subdirectories on nexus3 up transfers [default: False]
Commands:
login Test login and save credentials to ~/.nexus-cli list List all files within a path in the repository upload Upload file(s) to designated repository download Download an artefact or a directory to local file system delete Delete artefact(s) from repository
Sub-commands:
cleanup_policy Cleanup Policy management. repository Repository management. script Script management.
nexuscli.cli.main(argv=None)

Entrypoint for the setuptools CLI console script