npm package: @producthub/ph-cli
Description: Official command-line interface for ProductHub - manage metrics, business cases, and analytics from your terminal.
Author: Wilco van Duinkerken
Latest version: 0.9.0
Deprecated: This package has been renamed to @scaleflow/cli

ph-cli
=================

> **⚠️ NOTICE: Early Development**  
> This software is in very early development stages. Please do not rely on it for production purposes yet.

A cli that helps you interact with ProductHub.

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/ph-cli.svg)](https://npmjs.org/package/ph-cli)
[![Downloads/week](https://img.shields.io/npm/dw/ph-cli.svg)](https://npmjs.org/package/ph-cli)

<!-- toc -->
* [Usage](#usage)
* [Debugging](#debugging)
* [Enable debug output for any command](#enable-debug-output-for-any-command)
* [For development with auto-rebuild and debug enabled](#for-development-with-auto-rebuild-and-debug-enabled)
* [Commands](#commands)
<!-- tocstop -->

# Usage
<!-- usage -->
```sh-session
$ npm install -g @producthub/ph-cli
$ ph COMMAND
running command...
$ ph (--version)
@producthub/ph-cli/0.9.0 darwin-arm64 node-v20.15.0
$ ph --help [COMMAND]
USAGE
  $ ph COMMAND
...
```
<!-- usagestop -->

# Debugging

To enable debug logging for troubleshooting:

```bash
# Enable debug output for any command
DEBUG=ph-cli ph config

# For development with auto-rebuild and debug enabled
npm run dev config
```

Debug logging provides detailed information about:
- Authentication and credential loading
- API requests and responses  
- Client configuration and profiles
- Request headers and error details

# Commands
<!-- commands -->
* [`ph auth login`](#ph-auth-login)
* [`ph auth logout`](#ph-auth-logout)
* [`ph auth status`](#ph-auth-status)
* [`ph business-cases`](#ph-business-cases)
* [`ph commands`](#ph-commands)
* [`ph config`](#ph-config)
* [`ph config profile`](#ph-config-profile)
* [`ph help [COMMAND]`](#ph-help-command)
* [`ph increment METRIC-ID [VALUE]`](#ph-increment-metric-id-value)
* [`ph measure METRIC-ID VALUE`](#ph-measure-metric-id-value)
* [`ph metric [METRIC-ID]`](#ph-metric-metric-id)
* [`ph metric aggregates`](#ph-metric-aggregates)
* [`ph metric create`](#ph-metric-create)
* [`ph metric delete`](#ph-metric-delete)
* [`ph metric import-csv`](#ph-metric-import-csv)
* [`ph metric list`](#ph-metric-list)
* [`ph metric measure`](#ph-metric-measure)
* [`ph metric measurements`](#ph-metric-measurements)
* [`ph metric show [METRIC-ID]`](#ph-metric-show-metric-id)
* [`ph metrics`](#ph-metrics)

## `ph auth login`

Authenticate with ProductHub using OAuth

```
USAGE
  $ ph auth login [--port <value>] [--profile <value>]

FLAGS
  --port=<value>     [default: 3000] Local server port for OAuth callback
  --profile=<value>  [default: production] Configuration profile (production, staging)

DESCRIPTION
  Authenticate with ProductHub using OAuth

EXAMPLES
  $ ph auth login

  $ ph auth login --profile staging
```

_See code: [src/commands/auth/login.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/auth/login.ts)_

## `ph auth logout`

Clear stored authentication credentials

```
USAGE
  $ ph auth logout

DESCRIPTION
  Clear stored authentication credentials

EXAMPLES
  $ ph auth logout
```

_See code: [src/commands/auth/logout.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/auth/logout.ts)_

## `ph auth status`

Show current authentication status

```
USAGE
  $ ph auth status

DESCRIPTION
  Show current authentication status

EXAMPLES
  $ ph auth status
```

_See code: [src/commands/auth/status.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/auth/status.ts)_

## `ph business-cases`

List the Business Cases.

```
USAGE
  $ ph business-cases [--json] [--profile <value>] [--tenant <value>]

FLAGS
  --profile=<value>  Configuration profile (production, staging)
  --tenant=<value>   ProductHub tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List the Business Cases.

EXAMPLES
  $ ph business-cases
```

_See code: [src/commands/business-cases.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/business-cases.ts)_

## `ph commands`

Show all available CLI commands in a formatted table

```
USAGE
  $ ph commands

DESCRIPTION
  Show all available CLI commands in a formatted table

EXAMPLES
  $ ph commands
```

_See code: [src/commands/commands.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/commands.ts)_

## `ph config`

Display or manage configuration

```
USAGE
  $ ph config [-k <value>] [--clear-api-key] [--clear-profile] [--clear-tenant] [-p <value>] [-t <value>]

FLAGS
  -k, --api-key=<value>  Set API key for authentication
  -p, --profile=<value>  Set default profile (production, staging)
  -t, --tenant=<value>   Set default tenant ID
      --clear-api-key    Clear the stored API key
      --clear-profile    Clear the stored profile
      --clear-tenant     Clear the stored tenant ID

DESCRIPTION
  Display or manage configuration

EXAMPLES
  $ ph config

  $ ph config --tenant my-tenant-id

  $ ph config --profile staging

  $ ph config --api-key your-api-key

  $ ph config --clear-tenant
```

_See code: [src/commands/config/index.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/config/index.ts)_

## `ph config profile`

Show available configuration profiles

```
USAGE
  $ ph config profile [--profile <value>]

FLAGS
  --profile=<value>  Show details for specific profile

DESCRIPTION
  Show available configuration profiles

EXAMPLES
  $ ph config profile

  $ ph config profile --profile staging
```

_See code: [src/commands/config/profile.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/config/profile.ts)_

## `ph help [COMMAND]`

Display help for ph.

```
USAGE
  $ ph help [COMMAND...] [-n]

ARGUMENTS
  COMMAND...  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for ph.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.32/src/commands/help.ts)_

## `ph increment METRIC-ID [VALUE]`

Add an incremental measurement to a metric

```
USAGE
  $ ph increment METRIC-ID [VALUE] [--json] [--profile <value>] [--tenant <value>] [-c <value>] [-d <value>]

ARGUMENTS
  METRIC-ID  Metric ID
  VALUE      [default: 1] Increment value

FLAGS
  -c, --comment=<value>   Optional comment for the measurement
  -d, --decimals=<value>  Number of decimal places
      --profile=<value>   Configuration profile (production, staging)
      --tenant=<value>    ProductHub tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Add an incremental measurement to a metric

EXAMPLES
  $ ph increment def456

  $ ph increment def456 5

  $ ph increment def456 -c "Daily increment"

  $ ph increment def456 10 -c "New signups today"

  $ ph increment def456 2.5 -d 1 -c "Revenue increase"
```

_See code: [src/commands/increment.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/increment.ts)_

## `ph measure METRIC-ID VALUE`

Add an absolute measurement to a metric

```
USAGE
  $ ph measure METRIC-ID VALUE [--json] [--profile <value>] [--tenant <value>] [-c <value>] [-d <value>]

ARGUMENTS
  METRIC-ID  Metric ID
  VALUE      Measurement value

FLAGS
  -c, --comment=<value>   Optional comment for the measurement
  -d, --decimals=<value>  Number of decimal places
      --profile=<value>   Configuration profile (production, staging)
      --tenant=<value>    ProductHub tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Add an absolute measurement to a metric

EXAMPLES
  $ ph measure abc123 42

  $ ph measure abc123 100 -c "Daily active users"

  $ ph measure abc123 95.5 -d 1 -c "Completion rate"
```

_See code: [src/commands/measure.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/measure.ts)_

## `ph metric [METRIC-ID]`

See the details of a metric

```
USAGE
  $ ph metric [METRIC-ID] [--json] [--profile <value>] [--tenant <value>] [-n <value>]

ARGUMENTS
  METRIC-ID  Metric ID (alias for aggregates)

FLAGS
  -n, --metric-id=<value>  id of the metric
      --profile=<value>    Configuration profile (production, staging)
      --tenant=<value>     ProductHub tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  See the details of a metric

ALIASES
  $ ph metric show

EXAMPLES
  $ ph metric --metric-id abc123

  $ ph metric abc123
```

_See code: [src/commands/metric/index.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/metric/index.ts)_

## `ph metric aggregates`

List the Aggregates for a metric

```
USAGE
  $ ph metric aggregates -n <value> [--json] [--profile <value>] [--tenant <value>] [--from <value>] [-l
    days|weeks|months|quarters|years] [--to <value>]

FLAGS
  -l, --level=<option>     [default: weeks] aggregation level
                           <options: days|weeks|months|quarters|years>
  -n, --metric-id=<value>  (required) id of the metric
      --from=<value>       start date (YYYY-MM-DD or substring)
      --profile=<value>    Configuration profile (production, staging)
      --tenant=<value>     ProductHub tenant ID
      --to=<value>         end date (YYYY-MM-DD or substring)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List the Aggregates for a metric

EXAMPLES
  $ ph metric aggregates --metric-id abc123

  $ ph metric aggregates --metric-id abc123 --level days

  $ ph metric aggregates --metric-id abc123 --level weeks --from 2025-01 --to 2025-03
```

_See code: [src/commands/metric/aggregates.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/metric/aggregates.ts)_

## `ph metric create`

Create a metric

```
USAGE
  $ ph metric create [--json] [--profile <value>] [--tenant <value>] [-d <value>] [-p DAY|WEEK|MONTH|YEAR] [-s
    number|percentage|currency] [-n <value>] [-t UP|DOWN|NEUTRAL]

FLAGS
  -d, --decimals=<value>  Number of decimals.
  -n, --title=<value>     Title of the metric.
  -p, --period=<option>   Default reporting period.
                          <options: DAY|WEEK|MONTH|YEAR>
  -s, --symbol=<option>   [default: number] Type of measurement
                          <options: number|percentage|currency>
  -t, --trend=<option>    The trend you would like to see.
                          <options: UP|DOWN|NEUTRAL>
      --profile=<value>   Configuration profile (production, staging)
      --tenant=<value>    ProductHub tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Create a metric

EXAMPLES
  $ ph metric create
```

_See code: [src/commands/metric/create.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/metric/create.ts)_

## `ph metric delete`

Delete a metric

```
USAGE
  $ ph metric delete [--json] [--profile <value>] [--tenant <value>] [-n <value>]

FLAGS
  -n, --id=<value>       ID of the metric to delete
      --profile=<value>  Configuration profile (production, staging)
      --tenant=<value>   ProductHub tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Delete a metric

EXAMPLES
  $ ph metric delete
```

_See code: [src/commands/metric/delete.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/metric/delete.ts)_

## `ph metric import-csv`

Import measurements from a CSV file.

```
USAGE
  $ ph metric import-csv -f <value> --metric-id <value> [--json] [--profile <value>] [--tenant <value>] [--batch-size
    <value>] [--dry-run]

FLAGS
  -f, --file=<value>        (required) CSV file path
      --batch-size=<value>  [default: 100] Number of measurements to process in each batch
      --dry-run             Parse and validate CSV without importing
      --metric-id=<value>   (required) Metric ID
      --profile=<value>     Configuration profile (production, staging)
      --tenant=<value>      ProductHub tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Import measurements from a CSV file.

EXAMPLES
  $ ph metric import-csv --metric-id {some_metric_id} --file measurements.csv

  $ ph metric import-csv --metric-id {some_metric_id} --file measurements.csv --batch-size 50

  $ ph metric import-csv --metric-id {some_metric_id} --file measurements.csv --dry-run
```

_See code: [src/commands/metric/import-csv.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/metric/import-csv.ts)_

## `ph metric list`

List the metrics for the tenant.

```
USAGE
  $ ph metric list [--json] [--profile <value>] [--tenant <value>]

FLAGS
  --profile=<value>  Configuration profile (production, staging)
  --tenant=<value>   ProductHub tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List the metrics for the tenant.

ALIASES
  $ ph metrics

EXAMPLES
  $ ph metric list
```

_See code: [src/commands/metric/list.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/metric/list.ts)_

## `ph metric measure`

Update a measurement of a metric.

```
USAGE
  $ ph metric measure --metric-id <value> -v <value> [--json] [--profile <value>] [--tenant <value>] [-c <value>]
    [-d <value>] [-i | [-a | ]] [--measured_at_utc <value>]

FLAGS
  -a, --absolute                 Provide the absolute value
  -c, --comment=<value>          Optional annotation to the measurement
  -d, --decimals=<value>         The number of decimals in the value
  -i, --increment                Provide the increment instead of absolute value
  -v, --value=<value>            (required) Value
      --measured_at_utc=<value>  Timestamp when the measurement was taken
      --metric-id=<value>        (required) Metric ID
      --profile=<value>          Configuration profile (production, staging)
      --tenant=<value>           ProductHub tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Update a measurement of a metric.

EXAMPLES
  $ ph metric measure --id {some_metric_id} --value 42

  $ ph metric measure --id {some_metric_id} --value 42 -d 0 --comment "Annotations are great" --increment

  $ ph metric measure --id {some_metric_id} --value 42 --measured_at_utc "2025-03-05T12:00:00Z"
```

_See code: [src/commands/metric/measure.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/metric/measure.ts)_

## `ph metric measurements`

List the Measurements for a metric

```
USAGE
  $ ph metric measurements -n <value> [--json] [--profile <value>] [--tenant <value>]

FLAGS
  -n, --metric-id=<value>  (required) id of the metric
      --profile=<value>    Configuration profile (production, staging)
      --tenant=<value>     ProductHub tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List the Measurements for a metric

EXAMPLES
  $ ph metric measurements
```

_See code: [src/commands/metric/measurements.ts](https://github.com/producthub/ph-cli/blob/v0.9.0/src/commands/metric/measurements.ts)_

## `ph metric show [METRIC-ID]`

See the details of a metric

```
USAGE
  $ ph metric show [METRIC-ID] [--json] [--profile <value>] [--tenant <value>] [-n <value>]

ARGUMENTS
  METRIC-ID  Metric ID (alias for aggregates)

FLAGS
  -n, --metric-id=<value>  id of the metric
      --profile=<value>    Configuration profile (production, staging)
      --tenant=<value>     ProductHub tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  See the details of a metric

ALIASES
  $ ph metric show

EXAMPLES
  $ ph metric show --metric-id abc123

  $ ph metric show abc123
```

## `ph metrics`

List the metrics for the tenant.

```
USAGE
  $ ph metrics [--json] [--profile <value>] [--tenant <value>]

FLAGS
  --profile=<value>  Configuration profile (production, staging)
  --tenant=<value>   ProductHub tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List the metrics for the tenant.

ALIASES
  $ ph metrics

EXAMPLES
  $ ph metrics
```
<!-- commandsstop -->
* [`ph measure`](#ph-measure)

## `ph measure`

Add a measurement to a metric in ProductHub

```
USAGE
  $ ph measure --id <value> -v <value> [-i | -a] [-d <value>] [-c <value>]

FLAGS
  -a, --absolute          Provide the absolute value
  -c, --comment=<value>   Optional annotation to the measurement
  -d, --decimals=<value>  The number of decimals in the value
  -i, --increment         Provide the increment instead of absolute value
  -v, --value=<value>     (required) Value
      --id=<value>        (required) Metric ID

DESCRIPTION
  Update a measurement of a metric.

EXAMPLES
  $ ph measure --id {some_metric_id} --value 42

  $ ph measure --id {some_metric_id} --value 42 -d 0 --comment "Annotations are great" --increment
```

_See code: [src/commands/measure.ts](https://github.com/Scaleforce-Services/ph-cli/blob/main/src/commands/measure.ts)_

## `ph help [COMMAND]`

Display help for ph.

```
USAGE
  $ ph help [COMMAND...] [-n]

ARGUMENTS
  COMMAND...  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for ph.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.21/src/commands/help.ts)_