Skip to main content

仓咚咚 - 个人金融命令行工具 (AI Native)

Project description

Cang CLI

仓咚咚 - 个人金融命令行工具 (AI Native)

Version License

Cang CLI 是一个本地优先的个人财务管理工具,所有数据存储在本地 SQLite 数据库中。

特性

  • 🏦 账户管理 - 管理现金、银行卡、支付宝、微信等各类账户
  • 💰 收支记录 - 记录日常收入和支出,支持分类管理
  • 🔄 转账记录 - 记录账户间的转账
  • 📊 资产记录 - 记录固定资产(房产、车辆等)
  • 💹 投资记录 - 记录股票买卖、分红等投资交易
  • 📋 预算管理 - 设置和跟踪月度预算

安装

# 先安装依赖
pip install dong-core

# 安装 cang-cli
pipx install dong-cang

快速开始

初始化

cang init

添加账户

# 添加现金账户
cang fin account add "现金" cash

# 添加银行卡
cang fin account add "招商银行" bank --currency CNY

记录支出

# 记录一笔餐饮支出
cang fin tx add --account "现金" --amount 50 --category "餐饮" "午餐"

# 记录购物支出
cang fin tx add --account "招商银行" --amount 299 --category "购物" "买衣服"

记录收入

cang fin tx add --account "招商银行" --amount 10000 --category "工资" --type income "发工资"

查看账户

# 列出所有账户
cang fin account ls

# 查看账户余额
cang fin account get 1

记录资产

# 添加固定资产
cang asset add --name "自住房" --type real_estate --value 5000000

# 添加车辆
cang asset add --name "特斯拉 Model 3" --type vehicle --value 250000 --purchase-date "2024-01-01"

记录投资

# 买入股票
cang invest buy --symbol "600519" --price 1800 --quantity 100

# 卖出股票
cang invest sell --symbol "600519" --price 1850 --quantity 50

# 记录分红
cang invest dividend --symbol "600519" --amount 500

查看持仓

cang invest holdings

命令结构

cang
├── init              # 初始化数据库
├── fin               # 财务流动 (收支/转账)
│   ├── init
│   ├── account       # 账户管理
│   ├── tx            # 交易记录
│   ├── transfer      # 转账
│   └── category      # 分类管理
├── asset             # 资产存量
│   ├── init
│   ├── ls            # 列出资产
│   ├── add           # 添加资产
│   ├── get           # 获取资产
│   ├── update        # 更新资产
│   ├── delete        # 删除资产
│   └── networth      # 净资产统计
├── budget            # 预算管理
│   ├── init
│   ├── budget        # 设置预算
│   ├── status        # 预算状态
│   └── history       # 历史记录
└── invest            # 投资记录
    ├── init
    ├── ls            # 列出交易
    ├── buy           # 买入
    ├── sell          # 卖出
    ├── dividend      # 分红
    ├── holdings      # 持仓
    └── profit        # 收益

数据存储

所有数据存储在本地 ~/.dong/cang/cang.db SQLite 数据库中。

设计原则

  • 本地优先 - 数据在你电脑上,不上云
  • AI 原生 - 所有命令返回 JSON,方便 Agent 调用
  • 一个工具一件事 - 只做记录,不做报表、分析、推荐

依赖

  • Python >= 3.11
  • dong-core >= 0.1.0
  • typer >= 0.12.0

许可证

MIT License - see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dong_cang-0.7.0.tar.gz (148.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dong_cang-0.7.0-py3-none-any.whl (61.1 kB view details)

Uploaded Python 3

File details

Details for the file dong_cang-0.7.0.tar.gz.

File metadata

  • Download URL: dong_cang-0.7.0.tar.gz
  • Upload date:
  • Size: 148.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for dong_cang-0.7.0.tar.gz
Algorithm Hash digest
SHA256 2010e8f388caf537842d05ceee26d43612995cd6e98088f9c82e5e7f5f47aa28
MD5 84f55528987d64ccbfbcbcad752aed02
BLAKE2b-256 f2ae7f633a7ddfc4fa1fefbd2ecff2cdd60f8fa2914bbb72ea3d35888f49cdc1

See more details on using hashes here.

File details

Details for the file dong_cang-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: dong_cang-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 61.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for dong_cang-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3238ce70f2e058818a2000a7a8abfce23f92a888cc335ff3bb3b2dbb67105c8e
MD5 bb50f43e03f0cd44601ef806a7bc5461
BLAKE2b-256 da49a193260d5bbd32c4eb1986753e1bc51e9b599618a221e9080aeeae23451a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page