docs: rename bookkeeping skill to AutoACCT

This commit is contained in:
2026-05-04 16:17:57 +08:00
parent cedae6e2d9
commit 499af13bd3
5 changed files with 27 additions and 27 deletions

View File

@@ -21,7 +21,7 @@ Follow the 6 steps below. Takes ~10 minutes.
### Step 1 — Clone the skill and install Python deps ### Step 1 — Clone the skill and install Python deps
```bash ```bash
git clone https://git.deepknow.site/Knowit/AutoACCT.git ~/.openclaw/workspace/skills/bookkeeping git clone https://git.deepknow.site/Knowit/AutoACCT.git ~/.openclaw/workspace/skills/AutoACCT
pip install google-api-python-client google-auth pip install google-api-python-client google-auth
``` ```
@@ -30,11 +30,11 @@ pip install google-api-python-client google-auth
1. Open https://console.cloud.google.com/ and create a new project (e.g. `autoacct`). 1. Open https://console.cloud.google.com/ and create a new project (e.g. `autoacct`).
2. In the top search bar, search **Google Sheets API** → click the result → **Enable**. 2. In the top search bar, search **Google Sheets API** → click the result → **Enable**.
3. Left menu: **IAM & Admin → Service Accounts → + Create Service Account** 3. Left menu: **IAM & Admin → Service Accounts → + Create Service Account**
- Name: `bookkeeping` (any name works) - Name: `AutoACCT` (any name works)
- Click **Create and Continue → Done** (skip the optional role step). - Click **Create and Continue → Done** (skip the optional role step).
4. Click the new service account → **Keys** tab → **Add Key → Create new key → JSON → Create**. 4. Click the new service account → **Keys** tab → **Add Key → Create new key → JSON → Create**.
A `.json` key file will download to your browser's Downloads folder. A `.json` key file will download to your browser's Downloads folder.
5. **Copy the service account's email** (looks like `bookkeeping@<project>.iam.gserviceaccount.com`) — you'll paste it in Step 4. 5. **Copy the service account's email** (looks like `autoacct@<project>.iam.gserviceaccount.com`) — you'll paste it in Step 4.
### Step 3 — Move the key file out of the repo ### Step 3 — Move the key file out of the repo
@@ -42,8 +42,8 @@ Never leave a service-account key inside the repo directory. Move it to `~/.conf
```bash ```bash
mkdir -p ~/.config/gcp mkdir -p ~/.config/gcp
mv ~/Downloads/<your-downloaded-file>.json ~/.config/gcp/bookkeeping-sa.json mv ~/Downloads/<your-downloaded-file>.json ~/.config/gcp/autoacct-sa.json
chmod 600 ~/.config/gcp/bookkeeping-sa.json chmod 600 ~/.config/gcp/autoacct-sa.json
``` ```
### Step 4 — Create the Google Sheet ### Step 4 — Create the Google Sheet
@@ -62,7 +62,7 @@ chmod 600 ~/.config/gcp/bookkeeping-sa.json
### Step 5 — Write config.json ### Step 5 — Write config.json
```bash ```bash
cd ~/.openclaw/workspace/skills/bookkeeping cd ~/.openclaw/workspace/skills/AutoACCT
cp config.example.json config.json cp config.example.json config.json
``` ```
@@ -72,7 +72,7 @@ Open `config.json` in your editor and fill in **sheet_id** and **worksheet** wit
{ {
"sheet_id": "1abc...xyz", "sheet_id": "1abc...xyz",
"worksheet": "Sheet1", "worksheet": "Sheet1",
"service_account_path": "~/.config/gcp/bookkeeping-sa.json", "service_account_path": "~/.config/gcp/autoacct-sa.json",
"hkd_fx_provider": "frankfurter" "hkd_fx_provider": "frankfurter"
} }
``` ```
@@ -82,7 +82,7 @@ Open `config.json` in your editor and fill in **sheet_id** and **worksheet** wit
### Step 6 — Sanity check ### Step 6 — Sanity check
```bash ```bash
echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"currency":"HKD","amount_hkd":1,"fx_rate":1,"fx_date":"2026-04-20"}' | python3 ~/.openclaw/workspace/skills/bookkeeping/scripts/append_row.py echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"currency":"HKD","amount_hkd":1,"fx_rate":1,"fx_date":"2026-04-20"}' | python3 ~/.openclaw/workspace/skills/AutoACCT/scripts/append_row.py
``` ```
Success looks like: `OK 'Sheet1'!A2:N2` and a new row appears in the sheet. Delete the TEST row when you're done. Success looks like: `OK 'Sheet1'!A2:N2` and a new row appears in the sheet. Delete the TEST row when you're done.

View File

@@ -21,7 +21,7 @@
### Step 1 — Clone 仓库 + 装 Python 依赖 ### Step 1 — Clone 仓库 + 装 Python 依赖
```bash ```bash
git clone https://git.deepknow.site/Knowit/AutoACCT.git ~/.openclaw/workspace/skills/bookkeeping git clone https://git.deepknow.site/Knowit/AutoACCT.git ~/.openclaw/workspace/skills/AutoACCT
pip install google-api-python-client google-auth pip install google-api-python-client google-auth
``` ```
@@ -30,11 +30,11 @@ pip install google-api-python-client google-auth
1. 打开 https://console.cloud.google.com/,左上角下拉 → **New Project** → 随便起名(如 `autoacct`)→ Create 1. 打开 https://console.cloud.google.com/,左上角下拉 → **New Project** → 随便起名(如 `autoacct`)→ Create
2. 顶部搜索框搜 **Google Sheets API** → 点进去 → **Enable** 2. 顶部搜索框搜 **Google Sheets API** → 点进去 → **Enable**
3. 左侧菜单 **IAM & Admin → Service Accounts → + Create Service Account** 3. 左侧菜单 **IAM & Admin → Service Accounts → + Create Service Account**
- Name 填 `bookkeeping`(随意) - Name 填 `AutoACCT`(随意)
-**Create and Continue → Done**(中间可选的 role 步骤跳过) -**Create and Continue → Done**(中间可选的 role 步骤跳过)
4. 点进刚建好的服务账号 → 顶部 **Keys** 标签 → **Add Key → Create new key → 选 JSON → Create** 4. 点进刚建好的服务账号 → 顶部 **Keys** 标签 → **Add Key → Create new key → 选 JSON → Create**
浏览器会自动下载一个 `.json` 文件到你的 Downloads 浏览器会自动下载一个 `.json` 文件到你的 Downloads
5. **复制服务账号的 email**(形如 `bookkeeping@<项目名>.iam.gserviceaccount.com`Step 4 要用 5. **复制服务账号的 email**(形如 `autoacct@<项目名>.iam.gserviceaccount.com`Step 4 要用
### Step 3 — 把 key 文件挪出 repo ### Step 3 — 把 key 文件挪出 repo
@@ -42,8 +42,8 @@ pip install google-api-python-client google-auth
```bash ```bash
mkdir -p ~/.config/gcp mkdir -p ~/.config/gcp
mv ~/Downloads/<你下载的文件名>.json ~/.config/gcp/bookkeeping-sa.json mv ~/Downloads/<你下载的文件名>.json ~/.config/gcp/autoacct-sa.json
chmod 600 ~/.config/gcp/bookkeeping-sa.json chmod 600 ~/.config/gcp/autoacct-sa.json
``` ```
### Step 4 — 建 Google Sheet ### Step 4 — 建 Google Sheet
@@ -62,7 +62,7 @@ chmod 600 ~/.config/gcp/bookkeeping-sa.json
### Step 5 — 写 config.json ### Step 5 — 写 config.json
```bash ```bash
cd ~/.openclaw/workspace/skills/bookkeeping cd ~/.openclaw/workspace/skills/AutoACCT
cp config.example.json config.json cp config.example.json config.json
``` ```
@@ -72,7 +72,7 @@ cp config.example.json config.json
{ {
"sheet_id": "1abc...xyz", "sheet_id": "1abc...xyz",
"worksheet": "Sheet1", "worksheet": "Sheet1",
"service_account_path": "~/.config/gcp/bookkeeping-sa.json", "service_account_path": "~/.config/gcp/autoacct-sa.json",
"hkd_fx_provider": "frankfurter" "hkd_fx_provider": "frankfurter"
} }
``` ```
@@ -82,7 +82,7 @@ cp config.example.json config.json
### Step 6 — 冒烟测试 ### Step 6 — 冒烟测试
```bash ```bash
echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"currency":"HKD","amount_hkd":1,"fx_rate":1,"fx_date":"2026-04-20"}' | python3 ~/.openclaw/workspace/skills/bookkeeping/scripts/append_row.py echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"currency":"HKD","amount_hkd":1,"fx_rate":1,"fx_date":"2026-04-20"}' | python3 ~/.openclaw/workspace/skills/AutoACCT/scripts/append_row.py
``` ```
看到 `OK 'Sheet1'!A2:N2`(或中文 tab 名)并且 sheet 第 2 行出现 TEST就全通了。完事记得把这行测试数据删掉。 看到 `OK 'Sheet1'!A2:N2`(或中文 tab 名)并且 sheet 第 2 行出现 TEST就全通了。完事记得把这行测试数据删掉。

View File

@@ -1,19 +1,19 @@
--- ---
name: bookkeeping name: AutoACCT
description: Extract expense data from a receipt/invoice image (plus optional caption) and append it to a Google Sheet with HKD conversion. Use whenever the user provides a receipt image and wants it logged, or forwards a WhatsApp-style message that contains a receipt. description: Extract expense data from a receipt/invoice image (plus optional caption) and append it to a Google Sheet with HKD conversion. Use whenever the user provides a receipt image and wants it logged, or forwards a WhatsApp-style message that contains a receipt.
--- ---
# Bookkeeping — Receipt → Google Sheet # AutoACCT — Receipt → Google Sheet
Default working language: **English**. All written output (row values, replies) is English unless the user explicitly requests otherwise. Default working language: **English**. All written output (row values, replies) is English unless the user explicitly requests otherwise.
## When to use ## When to use
- User provides a receipt / invoice / payment-screenshot image and wants it recorded. - User provides a receipt / invoice / payment-screenshot image and wants it recorded.
- User says "log this", "record this expense", "add to bookkeeping", "记一下" with an image. - User says "log this", "record this expense", "add to AutoACCT", "记一下" with an image.
- Caption may be empty, or may add context (who paid, split %, category hint, payment method). Always incorporate caption if present. - Caption may be empty, or may add context (who paid, split %, category hint, payment method). Always incorporate caption if present.
## Prerequisites (check once per session) ## Prerequisites (check once per session)
1. `~/.openclaw/workspace/skills/bookkeeping/config.json` exists. If only `config.example.json` is present, **stop** and tell the user to copy it and fill in `sheet_id`, `worksheet`, `service_account_path`. Point them at `scripts/setup.md`. 1. `~/.openclaw/workspace/skills/AutoACCT/config.json` exists. If only `config.example.json` is present, **stop** and tell the user to copy it and fill in `sheet_id`, `worksheet`, `service_account_path`. Point them at `scripts/setup.md`.
2. Python deps installed: `google-api-python-client`, `google-auth`. If `append_row.py` fails with ImportError, instruct the user to run `pip install google-api-python-client google-auth` and retry. 2. Python deps installed: `google-api-python-client`, `google-auth`. If `append_row.py` fails with ImportError, instruct the user to run `pip install google-api-python-client google-auth` and retry.
## Workflow ## Workflow
@@ -21,12 +21,12 @@ Default working language: **English**. All written output (row values, replies)
2. **Normalize** per the rules below. 2. **Normalize** per the rules below.
3. **Convert to HKD** by running: 3. **Convert to HKD** by running:
``` ```
python ~/.openclaw/workspace/skills/bookkeeping/scripts/fx_convert.py <amount> <currency> --date <yyyy-mm-dd> python ~/.openclaw/workspace/skills/AutoACCT/scripts/fx_convert.py <amount> <currency> --date <yyyy-mm-dd>
``` ```
Output is `<hkd_amount>\t<fx_rate>\t<fx_date>` (tab-separated). If currency is HKD, skip the call and set `amount_hkd=amount`, `fx_rate=1`, `fx_date=<date>`. Output is `<hkd_amount>\t<fx_rate>\t<fx_date>` (tab-separated). If currency is HKD, skip the call and set `amount_hkd=amount`, `fx_rate=1`, `fx_date=<date>`.
4. **Append the row** by piping JSON into: 4. **Append the row** by piping JSON into:
``` ```
echo '<json>' | python ~/.openclaw/workspace/skills/bookkeeping/scripts/append_row.py echo '<json>' | python ~/.openclaw/workspace/skills/AutoACCT/scripts/append_row.py
``` ```
Keys must match `schema.md` (snake_case: `date`, `merchant`, `category`, `amount`, `currency`, `amount_hkd`, `fx_rate`, `fx_date`, `payment_method`, `line_items`, `raw_ocr`, `note`, `receipt`). Script adds `logged_at` automatically. Keys must match `schema.md` (snake_case: `date`, `merchant`, `category`, `amount`, `currency`, `amount_hkd`, `fx_rate`, `fx_date`, `payment_method`, `line_items`, `raw_ocr`, `note`, `receipt`). Script adds `logged_at` automatically.
5. **Report** to the user: the row you wrote and any field you had to guess. 5. **Report** to the user: the row you wrote and any field you had to guess.

View File

@@ -1,6 +1,6 @@
{ {
"sheet_id": "PUT_GOOGLE_SHEET_ID_HERE", "sheet_id": "PUT_GOOGLE_SHEET_ID_HERE",
"worksheet": "Expenses", "worksheet": "Expenses",
"service_account_path": "~/.config/gcp/bookkeeping-sa.json", "service_account_path": "~/.config/gcp/autoacct-sa.json",
"hkd_fx_provider": "frankfurter" "hkd_fx_provider": "frankfurter"
} }

View File

@@ -10,9 +10,9 @@ pip install google-api-python-client google-auth
2. Enable the **Google Sheets API** for the project. 2. Enable the **Google Sheets API** for the project.
3. Create a **service account**; skip the optional IAM steps. 3. Create a **service account**; skip the optional IAM steps.
4. In the service account, create a **JSON key** and download it. 4. In the service account, create a **JSON key** and download it.
5. Move the key to a safe path, e.g. `~/.config/gcp/bookkeeping-sa.json`, then: 5. Move the key to a safe path, e.g. `~/.config/gcp/autoacct-sa.json`, then:
``` ```
chmod 600 ~/.config/gcp/bookkeeping-sa.json chmod 600 ~/.config/gcp/autoacct-sa.json
``` ```
## 3. Prepare the Google Sheet ## 3. Prepare the Google Sheet
@@ -26,7 +26,7 @@ pip install google-api-python-client google-auth
## 4. Skill config ## 4. Skill config
``` ```
cd ~/.openclaw/workspace/skills/bookkeeping cd ~/.openclaw/workspace/skills/AutoACCT
cp config.example.json config.json cp config.example.json config.json
# edit config.json: sheet_id, service_account_path # edit config.json: sheet_id, service_account_path
``` ```
@@ -34,6 +34,6 @@ cp config.example.json config.json
## 5. Sanity check ## 5. Sanity check
``` ```
echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"currency":"HKD","amount_hkd":1,"fx_rate":1,"fx_date":"2026-04-20"}' \ echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"currency":"HKD","amount_hkd":1,"fx_rate":1,"fx_date":"2026-04-20"}' \
| python ~/.openclaw/workspace/skills/bookkeeping/scripts/append_row.py | python ~/.openclaw/workspace/skills/AutoACCT/scripts/append_row.py
``` ```
You should see `OK Expenses!A2:N2` (or similar) and a new row in the sheet. Delete the TEST row when done. You should see `OK Expenses!A2:N2` (or similar) and a new row in the sheet. Delete the TEST row when done.