CLI
Overview
List, filter, view, and act on savings recommendations from the terminal.
l4 recommendations lists pending savings recommendations and prints the full record for one.
rec and recs are aliases for recommendations, so l4 rec accept REC-1234 and
l4 recommendations accept REC-1234 are the same command.
Subcommands
| Command | Purpose | Scope |
|---|---|---|
list | Paginated, filterable list of recommendations | read |
view | Full detail for one recommendation | read |
accept | Record a decision to make the change | read-write |
reject | Close it, with an optional reason | read-write |
execute | Request execution of an accepted recommendation | read-write |
list
l4 recommendations list [flags]Flags
| Flag | Description |
|---|---|
--provider <id> | aws, gcp, azure, k8s (auto-detected if omitted) |
--service <s> | Repeatable filter |
--account <a> | Repeatable filter |
--environment <e> | Repeatable filter |
--tag <t> | Repeatable filter |
--status <s> | Repeatable: available, pending, processing, optimized, rejected, unavailable |
--search <q> | Free-text search within current page |
--sort-by <field> | recommendation_id, service, environment, account, tag, monthly_savings, savings_percentage, status |
--sort-order | asc or desc |
--page <n> / --page-size <n> | Pagination. Defaults to 20 per page, 100 is the maximum |
--tui | Open the interactive viewer |
Global flags apply. See CLI overview.
--search matches against the table the CLI prints, and only against the rows already on the page. A recommendation on page 4 stays invisible while you read page 1. It is also dropped under --json, --jq and --template, which return the whole page unfiltered, so a script that relies on it silently gets more rows than it asked for. Filter with --service, --status, --account, --environment or --tag instead: those go to the API.--tui opens the list in the interactive viewer, with KPI cards and live filtering. Filtering and sorting has its keys.
Examples
l4 recommendations list
l4 recommendations list --service RDS --status available
l4 recommendations list --sort-by monthly_savings --sort-order desc
l4 recommendations list --page 2 --page-size 10
l4 recommendations list --provider gcp --environment production
l4 recommendations list --status available --jq '.data.data.items[] | .recommendation_id'JSON shape (relevant paths)
.data.data.total_savings # sum across the page
.data.data.items[] # array of recommendation rows
.data.data.items[].recommendation_id
.data.data.items[].service
.data.data.items[].monthly_savings
.data.data.items[].savings_percentage
.data.data.items[].status
.data.data.pagination.total_pages # for pagination loops
.data.data.pagination.has_nextTo walk every page and total the result, use Aggregate 100% savings recommendations.
view
l4 recommendations view <id> [--tui]l4 recommendations view prints the full record for one recommendation: description, monthly/annual savings, comparison against current spend, implementation steps, risk and rollback notes.
Examples
l4 recommendations view REC-001
l4 recommendations view REC-001 --tui
l4 recommendations view REC-001 --json
l4 recommendations view REC-001 --webIn the TUI, use Tab / Shift+Tab to switch between Recommendation / Comparison / Risk panes, and the arrow keys to scroll within each tab.
Piping ids from list into view is Fetch full detail for the top five recommendations.
Related
- Recipes: the multi-page pipelines built on
list - Filtering and sorting: the TUI keys and the
--jqquirks - Recommendations API: the endpoints underneath