Sign inSign up

cyd01/nexuscli

By cyd01

•Updated 3 months ago

A light client for Nexus repository manager API

Image
Developer tools
0

1.2K

cyd01/nexuscli repository overview

⁠Nexus repository manager API client

⁠Description

This repository wraps this Nexus repository manager API⁠ instance.

⁠How to run

To run the Nexus API client execute the following docker run command to get the client usage:

docker run --rm --interactive --tty cyd01/nexuscli

⁠How to target your Nexus RM instance

Set a NEXUS_URL environment variable with the URL of your Nexus instance.

export NEXUS_URL="http://nexus.example.com:8081/"
docker run --rm --interactive --tty --env NEXUS_URL cyd01/nexuscli status reachable
Remote instance is reachable

Note: reachable is the only API call that do not require authentication.

⁠How to authenticate

⁠Authenticate with usename and password

It is possible to authenticate with username and password. Just set NEXUS_AUTH_USER and NEXUS_AUTH_PASS environment variables

export NEXUS_AUTH_USER="admin"
export NEXUS_AUTH_PASS="admin123"
docker run --rm --interactive --tty --env NEXUS_URL --env NEXUS_AUTH_USER --env NEXUS_AUTH_PASS cyd01/nexuscli status check
Name                       Healthy Message                                                                     Time          Duration Timestamp                    
-------------------------- ------- --------------------------------------------------------------------------- ------------- -------- -----------------------------
AvailableCPU                  true The host system is allocating a maximum of 8 cores to the application.      1707921165926        0 2024-02-14T15:32:45.926+01:00
AzureBlobStore               false                                                                                         0        0                              
BlobStores                   false                                                                                         0        0                              
CoordinateContentSelectors    true No content selectors using coordinates found.                               1707921165928        0 2024-02-14T15:32:45.928+01:00
DefaultAdminCredentials       true                                                                             1707921165926        2 2024-02-14T15:32:45.926+01:00
DefaultRoleRealm              true Default Role Realm not in use.                                              1707921165934        0 2024-02-14T15:32:45.934+01:00
FileBlobStoresPath            true                                                                             1707921165934        6 2024-02-14T15:32:45.934+01:00
FileDescriptors               true                                                                             1707921165928        0 2024-02-14T15:32:45.928+01:00
Licensing                     true                                                                             1707921165926        0 2024-02-14T15:32:45.926+01:00
LifecyclePhase                true                                                                             1707921165926        0 2024-02-14T15:32:45.926+01:00
NuGetV2repositories           true No NuGet version 2 repositories found.                                      1707921165880        0 2024-02-14T15:32:45.880+01:00
ReadOnlyDetector              true                                                                             1707921165926        0 2024-02-14T15:32:45.926+01:00
RecentVersion                 true                                                                             1707921165923        0 2024-02-14T15:32:45.923+01:00
Scheduler                     true                                                                             1707921165923       38 2024-02-14T15:32:45.923+01:00
Scripting                    false Enabling and running scripts is not recommended as this bypasses securit... 1707921165926        0 2024-02-14T15:32:45.926+01:00
ThreadDeadlockDetector        true                                                                             1707921165928        2 2024-02-14T15:32:45.928+01:00
Transactions                  true                                                                             1707921165928        0 2024-02-14T15:32:45.928+01:00

⁠About output formatting

By default this Nexus API client prints results in a Docker-style well-formatted output.

There is a useful parameter option: -raw to print the original JSON response.

docker run --rm --interactive --tty --env NEXUS_URL --env NEXUS_AUTH_USER --env NEXUS_AUTH_PASS cyd01/nexuscli blobstore ls -raw
[
    {
        "softQuota": {
            "type": "",
            "limit": 0
        },
        "name": "default",
        "type": "File",
        "unavailable": false,
        "blobCount": 294,
        "totalSizeInBytes": 1692622134,
        "availableSpaceInBytes": 74767597568
    },
...

Tag summary

Content type

Image

Digest

sha256:d478eb9a6…

Size

19.1 MB

Last updated

3 months ago

docker pull cyd01/nexuscli