LoginSignup
1
2

More than 1 year has passed since last update.

Ledger CLIをインストールする

Last updated at Posted at 2022-12-02

これアドベントカレンダーなんですけど、すでに2日なのですごく浅い感じで行きます。

Ledger-CLIって何

ledgerでぐぐったら仮想通貨のなんかライブラリが出てきますが、全然関係ありません。

この「複式簿記をプレーンテキストでつけたい」というヤバいソフトウェアです。

どうやってインストールするの

お使いのOSのパッケージマネージャに頼んでください。

# Debian系の人
$ sudo apt install ledger
# Macのひと
$ brew install ledger
# Windowsのひと
$ choco install ledger

簡単ですね。Debian/UbuntuでEmacs使いの人はelpa-ledgerを、Vim使いの人はvim-ledgerをインストールしておくと更に幸せになれます。VS Codeにもextensionがありますが、どうにもポンコツです。無いよりはマシ程度と思ってください。

使ってみたい

$ ledger --version
Ledger 3.2.1-20200518, the command-line accounting tool

Copyright (c) 2003-2019, John Wiegley.  All rights reserved.

This program is made available under the terms of the BSD Public License.
See LICENSE file included with the distribution for details and disclaimer.

多分これじゃない。

$ cat > test.ledger <<EOF
2022/12/01 スーパーで買ったわ
    Expenses:Grocery        2,000 JPY
    Assets:全財産
EOF
$ ledger -f test.ledger balance
          -2,000 JPY  Assets:全財産
           2,000 JPY  Expenses:Grocery
--------------------
                   0
$ ledger -f test.ledger register
22-Dec-01 スーパーで買ったわ                           Expenses:Grocery                                                    2,000 JPY                  2,000 JPY
                                                       Assets:全財産                                                      -2,000 JPY                          0
$ ledger -f test.ledger register "Assets:全財産"
22-Dec-01 スーパーで買ったわ                           Assets:全財産                                                      -2,000 JPY                 -2,000 JPY

なんか残高とか色々表示されてますね。え?全然わかんない?仕訳って何?詳しい説明を明日以降していきます。次↓

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2