npm package: @scaleflow/cli
Description: Official command-line interface for Scaleflow - manage metrics, initiatives, and analytics from your terminal.
Author: Wilco van Duinkerken
Latest version: 0.9.2

# sf-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 Scaleflow.

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

<!-- toc -->
* [sf-cli](#sf-cli)
* [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 @scaleflow/cli
$ sf COMMAND
running command...
$ sf (--version)
@scaleflow/cli/0.9.2 darwin-arm64 node-v22.19.0
$ sf --help [COMMAND]
USAGE
  $ sf COMMAND
...
```
<!-- usagestop -->

# Debugging

To enable debug logging for troubleshooting:

```bash
# Enable debug output for any command
DEBUG=sf-cli sf 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 -->
* [`sf auth login`](#sf-auth-login)
* [`sf auth logout`](#sf-auth-logout)
* [`sf auth status`](#sf-auth-status)
* [`sf commands`](#sf-commands)
* [`sf config`](#sf-config)
* [`sf config profile`](#sf-config-profile)
* [`sf conversation ID`](#sf-conversation-id)
* [`sf conversation messages ID`](#sf-conversation-messages-id)
* [`sf conversations`](#sf-conversations)
* [`sf help [COMMAND]`](#sf-help-command)
* [`sf ideas`](#sf-ideas)
* [`sf increment METRIC-ID [VALUE]`](#sf-increment-metric-id-value)
* [`sf initiative INITIATIVE-ID`](#sf-initiative-initiative-id)
* [`sf initiative show INITIATIVE-ID`](#sf-initiative-show-initiative-id)
* [`sf initiatives`](#sf-initiatives)
* [`sf measure METRIC-ID VALUE`](#sf-measure-metric-id-value)
* [`sf metric [METRIC-ID]`](#sf-metric-metric-id)
* [`sf metric aggregates`](#sf-metric-aggregates)
* [`sf metric create`](#sf-metric-create)
* [`sf metric delete`](#sf-metric-delete)
* [`sf metric import-csv`](#sf-metric-import-csv)
* [`sf metric list`](#sf-metric-list)
* [`sf metric measure`](#sf-metric-measure)
* [`sf metric measurements`](#sf-metric-measurements)
* [`sf metric show [METRIC-ID]`](#sf-metric-show-metric-id)
* [`sf metrics`](#sf-metrics)

## `sf auth login`

Authenticate with Scaleflow using OAuth

```
USAGE
  $ sf 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 Scaleflow using OAuth

EXAMPLES
  $ sf auth login

  $ sf auth login --profile staging
```

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

## `sf auth logout`

Clear stored authentication credentials

```
USAGE
  $ sf auth logout

DESCRIPTION
  Clear stored authentication credentials

EXAMPLES
  $ sf auth logout
```

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

## `sf auth status`

Show current authentication status

```
USAGE
  $ sf auth status

DESCRIPTION
  Show current authentication status

EXAMPLES
  $ sf auth status
```

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

## `sf commands`

Show all available CLI commands in a formatted table

```
USAGE
  $ sf commands

DESCRIPTION
  Show all available CLI commands in a formatted table

EXAMPLES
  $ sf commands
```

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

## `sf config`

Display or manage configuration

```
USAGE
  $ sf 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
  $ sf config

  $ sf config --tenant my-tenant-id

  $ sf config --profile staging

  $ sf config --api-key your-api-key

  $ sf config --clear-tenant
```

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

## `sf config profile`

Show available configuration profiles

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

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

DESCRIPTION
  Show available configuration profiles

EXAMPLES
  $ sf config profile

  $ sf config profile --profile staging
```

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

## `sf conversation ID`

Retrieve all messages in a conversation

```
USAGE
  $ sf conversation ID [--json] [--profile <value>] [--tenant <value>]

ARGUMENTS
  ID  Conversation ID

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

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Retrieve all messages in a conversation

EXAMPLES
  $ sf conversation abc123
```

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

## `sf conversation messages ID`

List all messages in a conversation

```
USAGE
  $ sf conversation messages ID [--json] [--profile <value>] [--tenant <value>]

ARGUMENTS
  ID  Conversation ID

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

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List all messages in a conversation

EXAMPLES
  $ sf conversation messages abc123
```

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

## `sf conversations`

List the conversations within a tenant.

```
USAGE
  $ sf conversations [--json] [--profile <value>] [--tenant <value>]

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

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List the conversations within a tenant.

EXAMPLES
  $ sf conversations
```

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

## `sf help [COMMAND]`

Display help for sf.

```
USAGE
  $ sf 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 sf.
```

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

## `sf ideas`

List the Ideas.

```
USAGE
  $ sf ideas [--json] [--profile <value>] [--tenant <value>] [--csv] [--expand-relationships]

FLAGS
  --csv                   Output as CSV format
  --expand-relationships  Expand relationship IDs to names (requires additional API calls)
  --profile=<value>       Configuration profile (production, staging)
  --tenant=<value>        Scaleflow tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List the Ideas.

EXAMPLES
  $ sf ideas

  $ sf ideas --csv

  $ sf ideas --csv --expand-relationships
```

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

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

Add an incremental measurement to a metric

```
USAGE
  $ sf 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>    Scaleflow tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Add an incremental measurement to a metric

EXAMPLES
  $ sf increment def456

  $ sf increment def456 5

  $ sf increment def456 -c "Daily increment"

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

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

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

## `sf initiative INITIATIVE-ID`

Show details of a specific initiative

```
USAGE
  $ sf initiative INITIATIVE-ID [--json] [--profile <value>] [--tenant <value>]

ARGUMENTS
  INITIATIVE-ID  Initiative ID

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

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Show details of a specific initiative

ALIASES
  $ sf initiative show

EXAMPLES
  $ sf initiative abc123

  $ sf initiative abc123
```

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

## `sf initiative show INITIATIVE-ID`

Show details of a specific initiative

```
USAGE
  $ sf initiative show INITIATIVE-ID [--json] [--profile <value>] [--tenant <value>]

ARGUMENTS
  INITIATIVE-ID  Initiative ID

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

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Show details of a specific initiative

ALIASES
  $ sf initiative show

EXAMPLES
  $ sf initiative show abc123

  $ sf initiative abc123
```

## `sf initiatives`

List the Initiatives.

```
USAGE
  $ sf initiatives [--json] [--profile <value>] [--tenant <value>]

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

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List the Initiatives.

EXAMPLES
  $ sf initiatives
```

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

## `sf measure METRIC-ID VALUE`

Add an absolute measurement to a metric

```
USAGE
  $ sf 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>    Scaleflow tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Add an absolute measurement to a metric

EXAMPLES
  $ sf measure abc123 42

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

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

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

## `sf metric [METRIC-ID]`

See the details of a metric

```
USAGE
  $ sf 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>     Scaleflow tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  See the details of a metric

ALIASES
  $ sf metric show

EXAMPLES
  $ sf metric --metric-id abc123

  $ sf metric abc123
```

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

## `sf metric aggregates`

List the Aggregates for a metric

```
USAGE
  $ sf 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>     Scaleflow 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
  $ sf metric aggregates --metric-id abc123

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

  $ sf 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.2/src/commands/metric/aggregates.ts)_

## `sf metric create`

Create a metric

```
USAGE
  $ sf 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>    Scaleflow tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Create a metric

EXAMPLES
  $ sf metric create
```

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

## `sf metric delete`

Delete a metric

```
USAGE
  $ sf 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>   Scaleflow tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Delete a metric

EXAMPLES
  $ sf metric delete
```

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

## `sf metric import-csv`

Import measurements from a CSV file.

```
USAGE
  $ sf 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>      Scaleflow tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Import measurements from a CSV file.

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

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

  $ sf 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.2/src/commands/metric/import-csv.ts)_

## `sf metric list`

List the metrics for the tenant.

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

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

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List the metrics for the tenant.

ALIASES
  $ sf metrics

EXAMPLES
  $ sf metric list
```

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

## `sf metric measure`

Update a measurement of a metric.

```
USAGE
  $ sf 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>           Scaleflow tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Update a measurement of a metric.

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

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

  $ sf 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.2/src/commands/metric/measure.ts)_

## `sf metric measurements`

List the Measurements for a metric

```
USAGE
  $ sf 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>     Scaleflow tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List the Measurements for a metric

EXAMPLES
  $ sf metric measurements
```

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

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

See the details of a metric

```
USAGE
  $ sf 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>     Scaleflow tenant ID

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  See the details of a metric

ALIASES
  $ sf metric show

EXAMPLES
  $ sf metric show --metric-id abc123

  $ sf metric show abc123
```

## `sf metrics`

List the metrics for the tenant.

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

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

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List the metrics for the tenant.

ALIASES
  $ sf metrics

EXAMPLES
  $ sf metrics
```
<!-- commandsstop -->

- [`sf measure`](#sf-measure)

## `sf measure`

Add a measurement to a metric in Scaleflow

```
USAGE
  $ sf 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
  $ sf measure --id {some_metric_id} --value 42

  $ sf 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)_

## `sf help [COMMAND]`

Display help for sf.

```
USAGE
  $ sf 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 sf.
```

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