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

# 예제

> curl·jq 로 바로 돌려 보는 작은 스크립트

모두 토큰을 환경 변수 `MORROWLY_TOKEN` 에 넣고 돌립니다. 필요한 권한만 고른 토큰을 쓰세요.

```bash theme={null}
export MORROWLY_TOKEN=morrowly_oat_...
```

## 월말 순자산 기록

권한: `finances:write`. 현재 재무를 자세히 고치지 않고 오늘의 합계만 순자산 기록에 남깁니다. 매달 말 cron 등으로 돌립니다.

```bash record.sh theme={null}
#!/usr/bin/env bash
# 사용: ./record.sh 현금 투자 부동산·보증금 부채   (원)
set -euo pipefail
curl -sf -X PUT "https://api.morrowly.app/v1/finances/history/$(date +%F)" \
  -H "Authorization: Bearer $MORROWLY_TOKEN" -H "Content-Type: application/json" \
  -d "{\"cash\":$1,\"investments\":$2,\"realAssets\":$3,\"liabilities\":$4}" | jq .data
```

## 플랜 나란히 보기

권한: `plans:read`. 가구의 플랜마다 끝 순자산·은퇴 때 순자산·경제적 자유 나이를 표로 봅니다.

```bash compare.sh theme={null}
#!/usr/bin/env bash
set -euo pipefail
API=https://api.morrowly.app/v1
auth=(-H "Authorization: Bearer $MORROWLY_TOKEN")
curl -sf "${auth[@]}" "$API/plans" | jq -r '.data[] | [.id, .name] | @tsv' |
  while IFS=$'\t' read -r id name; do
    curl -sf "${auth[@]}" "$API/plans/$id/projection" |
      jq -r --arg name "$name" '.data.summary | [$name, .finalNetWorth, (.retirementNetWorth // "-"), (.fiAge // "-")] | @tsv'
  done
```

## 저장하지 않고 바꿔 보기

권한: `plans:read`. 은퇴를 62세로 미루면 어떻게 되는지 저장 없이 계산합니다. 바꿀 것만 보냅니다([플랜 본문](/plans)).

```bash theme={null}
curl -sf -X POST "https://api.morrowly.app/v1/plans/$PLAN/projection" \
  -H "Authorization: Bearer $MORROWLY_TOKEN" -H "Content-Type: application/json" \
  -d '{"milestones":[{"id":"retirement","name":"은퇴","time":{"age":62}}]}' |
  jq '.data.summary | {finalNetWorth, retirementNetWorth, fiAge}'
```

## 에이전트에게 맡기기

Claude Code·Codex 같은 에이전트는 이 문서와 토큰만 있으면 API 를 직접 부릅니다.

<Steps>
  <Step title="읽기 전용 토큰 만들기">
    점검만 시킬 거면 `finances:read`·`plans:read` 만 고릅니다. 고치게 하려면 `:write` 를 더합니다.
  </Step>

  <Step title="토큰을 환경 변수로">
    에이전트를 띄우는 셸에서 `export MORROWLY_TOKEN=...` 합니다. 대화에 토큰을 붙여 넣지 마세요.
  </Step>

  <Step title="문서를 알려 주고 묻기">
    ```text theme={null}
    Morrowly API(https://api.morrowly.app/v1, 문서 https://docs.morrowly.app/llms-full.txt)를
    $MORROWLY_TOKEN 으로 불러 우리 가구의 현재 재무와 플랜들을 읽고,
    현금이 모자라는 달이 있는 플랜과 그 까닭을 알려 줘. 아무것도 저장하지 마.
    ```
  </Step>
</Steps>


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