> ## Documentation Index
> Fetch the complete documentation index at: https://docs.costgraph.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List rightsizing recommendations with the CostGraph CLI

> List rightsizing recommendations for virtual machines and Kubernetes nodes, filter them, and total their savings

List the rightsizing recommendations CostGraph has computed for your tenant, and total their monthly savings. Refer to [Recommendations](https://docs.costgraph.ai/costgraph/recommendations.md) for where recommendations come from and how to act on them. The CLI lists recommendations. It doesn't apply them.

## Requirements

The `costgraph recommendations` commands need a signed-in CLI session. They don't accept API keys. Refer to [Install and sign in](https://docs.costgraph.ai/costgraph/cli/install.md). `costgraph recs` is a shorter name for the same commands.

## List recommendations

The following command lists recommendations for virtual machines, largest savings first.

```shell theme={null}
costgraph recommendations list
```

In a terminal, the list opens in an interactive browser grouped by action.

| Key | Action |
| - | - |
| `/` | Filter the list. |
| Tab | Move between action groups. |
| Enter | Open a recommendation. |
| `q` | Close the browser. |

In a script or pipe, the command prints a static table. Each row includes the resource, provider, region, current and recommended shape, and monthly savings.

### Kubernetes node recommendations

Recommendations cover virtual machines by default. Add `--type kubernetes_node` for Kubernetes nodes.

```shell theme={null}
costgraph recommendations list --type kubernetes_node -o json
```

JSON output contains the recommendations without opening the browser.

### Pagination

The command returns 50 rows by default. Use `--limit` for up to 200 rows, `--offset` to skip rows, or `--all` to fetch every page.

## Filter recommendations

`costgraph recommendations list` and `costgraph recommendations summary` accept the same filters. Separate several values with commas.

| Flag | Values |
| - | - |
| `--action` | `DOWNSIZE`, `TERMINATE`, `UPSIZE`, `NOOP`, or `NO_RECOMMENDATION`. |
| `--confidence` | `low`, `medium`, or `high`. |
| `--provider` | A provider, such as `aws`, `gcp`, `azure`, or `digitalocean`. |
| `--region` | A provider region identifier, such as `us-east-1`. |
| `--min-savings` | A minimum monthly saving in US dollars. |
| `--active` | `true` for resources that still report a heartbeat, or `false` for resources that stopped. |
| `--search` | Text matched against the resource name or hostname. |
| `--reason` | A reason code, such as `idle_instance` or `cheaper_safe_candidate_found`. Shell completion lists every code. |

The following command lists high-confidence downsizing and termination recommendations on AWS that save at least 50 US dollars a month.

```shell theme={null}
costgraph recommendations list \
  --provider aws \
  --action DOWNSIZE,TERMINATE \
  --confidence high \
  --min-savings 50
```

`--sort` orders the list by `savings_desc`, the default, `generated_at_desc`, or `generated_at_asc`.

## Total the savings

`costgraph recommendations summary` reports fleet totals for the same filters. The totals include savings, coverage, and the number of recommendations for each action.

```shell theme={null}
costgraph recommendations summary --provider aws --confidence high
```

Add `-o json` to use the totals in a report.

## Command reference

Commands are shown without the `costgraph` prefix. Add `--help` for the complete flag list.

### Recommendation commands

These commands require a saved session. `recs` is an alias for `recommendations`.

**recommendations list** `command`

Lists rightsizing recommendations. Opens a browser in a terminal, a table in pipes, or JSON with `-o json`.

**recommendations summary** `command`

Totals monthly savings, coverage, and recommendation counts by action. Does not apply changes.

### Shared filters

Both commands accept these filters. Separate multiple values with commas.

**--type** `string` (default: virtual\_machine)

Chooses `virtual_machine` or `kubernetes_node`.

**--provider, --region** `string[]`

Filter by provider and region identifiers.

**--action** `string[]`

Selects `DOWNSIZE`, `TERMINATE`, `UPSIZE`, `NOOP`, or `NO_RECOMMENDATION`.

**--confidence** `string[]`

Selects `low`, `medium`, or `high` confidence.

**--min-savings** `number`

Sets minimum monthly savings in US dollars.

**--active** `string`

Filters resources by whether they still report a heartbeat.

**--search** `string`

Matches a resource name or hostname.

**--reason** `string[]`

Filters by reason code. Shell completion lists supported codes.

### List pagination and sorting

Pass these flags to `costgraph recommendations list`.

**--limit** `integer` (default: 50)

Sets rows per page, up to 200.

**--offset** `integer`

Skips rows before returning a page.

**--all** `boolean`

Fetches every page.

**--sort** `string` (default: savings\_desc)

Chooses `savings_desc`, `generated_at_desc`, or `generated_at_asc`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.