open-index/open-npm huggingface dataset:
npm package: @refactr/api-client
Description: Official Sophos Factory API client library for JavaScript.
Latest version: 1.0.0
Deprecated: Refactr is now Sophos Factory! Please update to @sophos-factory/api-client

# Sophos Factory API Client Library for JavaScript

This is the official Sophos Factory API client library for JavaScript.

## Usage

Generate an API Token by logging into Sophos Factory and visiting the [API Tokens page](https://app.refactr.it/user/tokens).

The API client is [hosted on npm](https://www.npmjs.com/package/@refactr/api-client) and can be installed like any other npm package. For example, to list projects:

```js
const { ProjectsApi, Configuration } = require('@refactr/api-client');

const accessToken = '<your api token here>';

const config = new Configuration({
    accessToken: accessToken
});
const client = new ProjectsApi(config);

(async () => {
    const res = await client.listProjects();
    console.info(res.data);
})().catch(e => {
    console.error(`Request failed with status code: ${e.response.status}. Response body:`);
    console.error(e.response.data);
});
```

All methods can be viewed by browsing the specification: https://api.refactr.it/v1/

## Generating the Library

The library is generated from the OpenAPI schema at: https://api.refactr.it/v1

The GitHub Action workflow [Codegen](.github/workflows/gen.yml) runs on a schedule and can also be dispatched manually. It compares the last updated schema stored at `spec/schema.json` with the current schema downloaded from `https://api.refactr.it/v1/spec`. If there is a difference, the workflow regenerates the client library, then opens a pull request with the changes.

## Terms of Use

Please see [Sophos Services Agreement](https://www.sophos.com/en-us/legal/sophos-services-agreement.aspx) and [Sophos Privacy Notice](https://www.sophos.com/en-us/legal/sophos-group-privacy-notice.aspx).
npm package: @refactr/cli
Description: Sophos Factory CLI
Author: Sophos Factory
Latest version: 2.0.1
Deprecated: Refactr is now Sophos Factory! Please update to @sophos-factory/cli

# Sophos Factory CLI

The Sophos Factory command line tool is used to interact with the Sophos Factory Platform API from the command line.

Basic usage and installation is described below. [Click here for complete Sophos Factory CLI documentation.](https://docs.refactr.it/docs/using-the-cli/)

## Usage

```shell
$ refactrctl --help   
Usage: refactrctl <command> [options]

Commands:
  refactrctl run             Execute pipeline or job
  refactrctl rerun [run-id]  Reschedule pipeline run
  refactrctl delete          Delete specified resource
  refactrctl list            List specified resources
  refactrctl get             Get specified resource
  refactrctl create          Create specified resource

Options:
      --version     Show version number                                                                        [boolean]
  -v, --verbose     Print detailed output                                                                      [boolean]
      --format      Output format                                    [choices: "wide", "json", "yaml"] [default: "wide"]
      --filter      Filter output using JsonPath                                                                [string]
      --address     Address of the Sophos Factory API server
                    [string] [default: FACTORY_ADDRESS environment variable if set, otherwise https://api.refactr.it/v1]
      --auth-token  Authentication token                     [string] [default: FACTORY_AUTH_TOKEN environment variable]
      --help        Show help                                                                                  [boolean]
```

## Installation

### Binary

We provide official binaries for Linux and macOS. Get the latest version from [this page](https://github.com/refactr/refactr-cli/releases/latest), and download the archive file for your operating system/architecture. Unpack the archive, and put the binary somewhere in your `$PATH` (e.g. on UNIX-y systems `/usr/local/bin`). Make sure it has execution permission granted.

### npm

To get the latest version of the CLI tool, use `npm`:

```shell
$ npm install @refactr/cli -g
```

or with `yarn`:

```shell
$ yarn global add @refactr/cli
```

Global installation is required.

### Docker

The CLI [available on Docker Hub](https://hub.docker.com/r/refactr/cli) as well:

```shell
$ docker pull refactr/cli
```

## License
Sophos Factory CLI is [MIT](./LICENSE) licensed.

## Terms of Use

Please see [Sophos Services Agreement](https://www.sophos.com/en-us/legal/sophos-services-agreement.aspx) and [Sophos Privacy Notice](https://www.sophos.com/en-us/legal/sophos-group-privacy-notice.aspx).