> For the complete documentation index, see [llms.txt](https://docs.kick.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kick.co/ai/cli/cli-use-case-library/advisory-and-deliverables.md).

# Advisory and Deliverables

Kick CLI scripts for client analysis: summarize expenses by category for a quarter and export monthly cash flow statement data.

Use these scripts to pull numbers you'll analyze or share with a client. Both only read from Kick.

<details>

<summary><strong>Top expense categories for a quarter</strong> (read)</summary>

To see where spend concentrated last quarter, pull transactions and group negative amounts by category. The script reads every page of transactions with `find_all_transactions`, 100 rows per request.

**The Script**

```bash
#!/bin/bash
# top-expense-categories.sh
set -euo pipefail

WORKSPACE_ID="<workspace-id>"
SINCE="2026-01-01"
UNTIL="2026-03-31"

find_all_transactions() {
  local page=1 rows all="[]"
  while true; do
    rows=$(kick --workspace "$WORKSPACE_ID" transactions find "$@" \
      --limit 100 --cursor "$page" --output json) || return 1
    all=$(printf '%s\n%s\n' "$all" "$rows" | jq -s 'add')
    if [ "$(printf '%s' "$rows" | jq 'length')" -lt 100 ]; then
      break
    fi
    page=$((page + 1))
  done
  printf '%s\n' "$all"
}

echo "Top expense categories: $SINCE to $UNTIL"
echo ""

find_all_transactions \
  --since "$SINCE" \
  --until "$UNTIL" \
  --fields amount,category | \
jq -r '
  [.[] | select(.amount < 0)] |
  group_by(.category) |
  map({
    category: (.[0].category // "Uncategorized"),
    total: (map(.amount) | add),
    count: length
  }) |
  sort_by(.total) |
  .[] |
  "\(.category): $\(.total | fabs) (\(.count) transactions)"
'
```

**How to Customize**

* Narrow `SINCE` and `UNTIL` per client
* Group by counterparty instead: add `counterparty` to `--fields` and use `group_by(.counterparty)`
* Add a percentage of total with an extra `jq` pass

`transactions find` has no entity filter. To total one entity only, replace the `find_all_transactions` call with `kick tools run transactions_find`, which accepts entity ids in `filters.entityIds` (read). It returns up to 100 rows per call under `rows`; while `hasMore` is `true`, run it again with `"cursor"` set to the returned `nextCursor`:

```bash
kick --workspace "$WORKSPACE_ID" tools run transactions_find \
  --input-json '{"since": "2026-01-01", "until": "2026-03-31", "limit": 100, "fields": ["amount", "category"], "filters": {"entityIds": [123]}}' \
  --output json | jq '.rows'
```

**What It Outputs**

```
Cloud Infrastructure: $12500.00 (36 transactions)
Payroll: $75000.00 (3 transactions)
```

</details>

<details>

<summary><strong>Cash flow statement by month</strong> (read)</summary>

To analyze operating, investing, and financing totals by month, use the cash flow statement report instead of rolling up raw transactions.

**The Script**

```bash
#!/bin/bash
# cash-flow-by-month.sh

WORKSPACE_ID="<workspace-id>"
ENTITY_ID=123
START_DATE="2026-01-01"
END_DATE="2026-03-31"

ledger_id=$(kick --workspace "$WORKSPACE_ID" accounting ledgers get --entity-id "$ENTITY_ID" --output json | jq -r '.ledgers[] | select(.basis == "cash") | .id')

kick --workspace "$WORKSPACE_ID" reports cash-flow-statement \
  --entity "$ENTITY_ID" \
  --ledger-id "$ledger_id" \
  --start-date "$START_DATE" \
  --end-date "$END_DATE" \
  --cycle month \
  --output json | jq .
```

**How to Customize**

* Add `--comparison previous-year` for year-over-year context, or `--comparison previous-period` for the prior period
* For an accrual-basis statement, pass the entity's Accrual ledger id instead. `kick workspaces context <workspace-id> --output json | jq '.ledgers'` lists every ledger with its `basis`
* Export vendor-level detail with `kick reports expenses-by-vendor`, which takes the same `--entity`, `--ledger-id`, `--start-date`, and `--end-date` flags. It returns 100 vendor rows per call by default; pass `--limit` (up to 500) and `--cursor` with the returned `nextCursor` for more

**What It Outputs**

* JSON cash flow statement with monthly columns for the entity and period

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kick.co/ai/cli/cli-use-case-library/advisory-and-deliverables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
