Skip to main content

Firefly III CLI - 个人财务管理命令行工具

Project description

coder-firefly-cli

Firefly III CLI - 个人财务管理命令行工具

安装

pip install -e .

前提条件

  • Python 3.10+
  • 运行中的 Firefly III 实例
  • Personal Access Token (PAT)

配置

环境变量(推荐)

export FIREFLY_BASE_URL="https://firefly.yourdomain.com"
export FIREFLY_PAT="your-personal-access-token"

命令行参数

coder-firefly-cli --base-url https://firefly.yourdomain.com --pat your-token accounts list

使用方法

账户管理

# 列出账户
coder-firefly-cli accounts list
coder-firefly-cli accounts list --type asset

# 获取账户详情
coder-firefly-cli accounts get --id 123

# 创建账户
coder-firefly-cli accounts create --name "现金" --type asset --currency-code CNY

# 更新账户
coder-firefly-cli accounts update --id 123 --name "新名称"

# 删除账户
coder-firefly-cli accounts delete --id 123

交易管理

# 列出交易
coder-firefly-cli transactions list
coder-firefly-cli transactions list --limit 10 --start 2024-01-01

# 创建支出
coder-firefly-cli transactions create --description "超市购物" --amount 100.00 --source-account 1

# 创建转账
coder-firefly-cli transactions create --description "转账" --amount 500.00 --source-account 1 --destination-account 2 --type transfer

# 获取交易详情
coder-firefly-cli transactions get --id 456

# 删除交易
coder-firefly-cli transactions delete --id 456

预算管理

# 列出预算
coder-firefly-cli budgets list

# 创建预算
coder-firefly-cli budgets create --name "餐饮预算"

# 设置预算限额
coder-firefly-cli budgets limit-create --budget-id 1 --amount 2000 --start 2024-01-01 --end 2024-01-31

分类管理

# 列出分类
coder-firefly-cli categories list

# 创建分类
coder-firefly-cli categories create --name "餐饮"

标签管理

# 列出标签
coder-firefly-cli tags list

# 创建标签
coder-firefly-cli tags create --tag "重要"

账单管理

# 列出账单
coder-firefly-cli bills list

# 创建账单
coder-firefly-cli bills create --name "房租" --amount-min 3000 --amount-max 3000 --date 2024-01-01

储蓄罐管理

# 列出储蓄罐
coder-firefly-cli piggy-banks list

# 创建储蓄罐
coder-firefly-cli piggy-banks create --name "旅行基金" --account-id 1 --target-amount 10000

搜索

# 搜索交易
coder-firefly-cli search transactions --query "超市"

洞察报告

# 支出洞察
coder-firefly-cli insights expense --start 2024-01-01 --end 2024-01-31

# 收入洞察
coder-firefly-cli insights income --start 2024-01-01 --end 2024-01-31

系统信息

# 获取系统信息
coder-firefly-cli info about

# 检查连接状态
coder-firefly-cli info status

JSON 输出

所有命令都支持 --json 参数以结构化格式输出:

coder-firefly-cli --json accounts list

故障排除

连接失败

错误: 无法连接到 Firefly III 实例

检查:

  1. Firefly III 实例是否正在运行
  2. 基础 URL 是否正确
  3. 网络连接是否正常

认证失败

错误: 认证失败: Personal Access Token 无效

检查:

  1. PAT 是否正确
  2. PAT 是否已过期
  3. 在 Firefly III 的 选项 > 个人资料 > OAuth 中生成新的 PAT

开发

# 安装依赖
pip install -e ".[dev]"

# 运行测试
pytest

# 代码格式化
black src/

许可证

MIT License

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

coder_firefly_cli-1.0.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

coder_firefly_cli-1.0.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file coder_firefly_cli-1.0.0.tar.gz.

File metadata

  • Download URL: coder_firefly_cli-1.0.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for coder_firefly_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cfd58c8cd3acefcd7359b25b1be63c473b77f5f2785c97b7db752d76a8c81e02
MD5 490957f779731e4d8fa50e3eaf83ac8b
BLAKE2b-256 cdce9a6a06ef48cb92a74ec64c6f1be56b5b43b6e93c2ebd608fa3fea54a6d8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for coder_firefly_cli-1.0.0.tar.gz:

Publisher: publish.yml on joyous-coder/coder-firefly-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coder_firefly_cli-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for coder_firefly_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0887453a986568871c02b2de886690ed3e2fce43da19d66b252b146bd793fdc7
MD5 aa7ab8d8db0cf6cc833515881cfb777c
BLAKE2b-256 b73b2184fe09af3f8a2d4dcf4808eb82c577eeb531292608b60f7c4032e1ae98

See more details on using hashes here.

Provenance

The following attestation bundles were made for coder_firefly_cli-1.0.0-py3-none-any.whl:

Publisher: publish.yml on joyous-coder/coder-firefly-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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