npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zeus-ci/cli

v0.5.6

Published

CLI for https://zeus.ci

Downloads

3

Readme

Travis GitHub release npm version license

The official command line utility for Zeus.

Table of Contents

Installation

The CLI comes as NPM package and can be installed via npm or yarn:

npm install -g @zeus-ci/cli
yarn global add @zeus-ci/cli

Usage

The CLI offers a set of commands to interact with the Zeus server. Besides specific parameters and options for each command, there is a range of common options:

zeus <command>

Commands:
  zeus job <command>     Manipulate jobs                            [aliases: j]
  zeus upload <file...>  Upload build artifacts                     [aliases: u]
  zeus completion        generate bash completion script

Options:
  --url          Fully qualified URL to the Zeus server                 [string]
  --token        Token for authorized access to Zeus                    [string]
  -v, --version  Show version number                                   [boolean]
  -h, --help     Show help                                             [boolean]

The --url parameter defaults to https://zeus.ci. If you are running a self-hosted version of Zeus, set this parameter to the fully qualified URL that the server is listening to. The value can also be provided via the ZEUS_URL environment variable. The command line option always takes precedence over the environment.

Most commands use the legacy ZEUS_HOOK_BASE environment variable. This requires a hook to be configured in the environment. In future versions, this will be replaced with the default authorization tokens.

The CLI also supports reading environment variables from a .env file located in the current working directory. Note that command line parameters always override the environment.

ZEUS_URL=https://zeus.ci
ZEUS_TOKEN=zeus-u-xxxxxxxx

Supported CI Systems

In some environments, the CLI is able to infer parameters like build or job numbers and commit hashes for you. In this case, you can omit the respective parameters. These systems are:

  • Travis CI
  • AppVeyor
  • Buildkite
  • CircleCI
  • Microsoft Azure Pipelines

Updating Jobs

Create new or update existing jobs in Zeus, providing a job ID and the corresponding build ID. If the provided build does not exist, it will be created. On supported CI systems, the job and build id are automatically inferred from the environment.

Note: if the corresponding build does not exist, you must provide --ref attribute, otherwise Zeus will fail to create the build.

zeus job update

Add/update a job

Options:
  --url, -u            Custom URL                                       [string]
  --token              Token for authorized access to Zeus              [string]
  --job, -j            Job id                                [number] [required]
  --build, -b          Build id                              [number] [required]
  --ref, -r            Commit hash                                      [string]
  --build-label, -B    Custom build label                               [string]
  --job-label, -J      Custom job label                                 [string]
  --status, -s         Job execution status
                               [string] [choices: "pending", "passed", "failed"]

Examples:

# Create job 234 in build number 123
zeus job update --job=234 --build=123 --ref=0123456

# Update job's label and url
zeus job update --job=234 --build=123 --url='https://travis-ci.org/org/repo/jobs/123' --label='New job'

# Set job's status to 'passed'
zeus job update --job=234 --build=123 --status=passed

# On supported CI systems one can omit build, job, and commit IDs
zeus job update --status=passed
# ...will have the same effect as this, if run on Travis:
zeus job update --status=passed -b "$TRAVIS_BUILD_ID" -j "$TRAVIS_JOB_ID" -r "$TRAVIS_COMMIT"

Uploading Artifacts

Upload a build artifact for processing or storage. The artifact is attached to a build and job. On supported CI systems, the build and job ids are automatically inferred from the environment.

Optionally, you can specify a mime type to classify the artifact with --type. This is used to hint Zeus how the artifact should be processed. By default, the mime type is inferred from the file name.

zeus upload <file...>

Positionals:
  file  Path to the artifact                    [array] [required] [default: []]

Options:
  --url          Fully qualified URL to the Zeus server                 [string]
  --token        Token for authorized access to Zeus                    [string]
  -t, --type     Mime type of the file to upload                        [string]
  -n, --name     Artifact name to use in place of the filename          [string]
  -j, --job      Unique id of the job in CI                             [string]
  -b, --build    Unique id of the build in CI                           [string]

Examples:

# On a supported build server
zeus upload coverage.xml

# With explicit mime type
zeus upload -t 'text/xml+coverage' coverage.xml

# Multiple files
zeus upload -t 'application/javascript' build/**/*.js

# On a custom build server
zeus upload -b $MY_BUILD_ID -j $MY_JOB_ID -t 'text/xml+coverage' coverage.xml

Bash Completion

Output a script to generate command line completion suggestions.

# Linux
zeus completion >> ~/.bashrc

# macOS
zeus completion >> ~/.bash_profile

Development

# Install dependencies
yarn

# Run the bot
yarn start

# Run test watchers
yarn test:watch

We use prettier for auto-formatting and eslint as linter. Both tools can automatically fix a lot of issues for you. To invoke them, simply run:

yarn fix

It is highly recommended to use VSCode and install the suggested extensions. They will configure your IDE to match the coding style, invoke auto formatters every time you save and run tests in the background for you. No need to run the watchers manually.