CashUtil: GnuCash CLI.
A command-line GnuCash interface for Gnucash 2.0 using the QOF-generator front-end, the GnuCash financial objects and current GnuCash XML handlers.
Note: There is no formal release yet.
The current subversion code requires QOF 0.7.2 - available in SourceForge CVS and on release in Debian. Other versions are in Ubuntu or various flavours of Fedora.
Progress report
Work completed
- GETTEXT support
- man page
- Clean build environment - CashUtil will build using make distcheck without errors.
- Mac OSX / Fink support - has built cleanly on OSX with fink since before the first interim release. A proportion of testing and development has been on OSX. A finkinfo file is provided but CashUtil development on OSX halted at version 0.1.4.
- GnuCash backend: Loading and saving GnuCash 1.8 data files. GnuCash 1.9.x has modified the XML backend and loading a 1.8 data file in gnucash 1.9.x will modify the data file to match the 1.9.x format. This file may then become difficult to use with gnucash 1.8 and cashutil. GnuCash developers have fixed this problem and cashutil will benefit from these solutions. In the meantime, I advise using cashutil with copies of gnucash 1.8 data files.
- Undo support (via QOF 0.7.0).
Functions already supported
Most still need to be made more intuitive.
- Non-interactive:
- -x, --xml-file <filename> : Query the GnuCash/QSF XML in <filename>
- -l, --list : List all databases supported by the current QOF framework and exit.
- --explain : List the fields within the specified database and exit, requires -d.
- -t, --date string : Shorthand to only query objects that contain the specified date.
- -d, --database string : Shorthand to only query objects within one specific supported database.
- -e, --exclude string : Shorthand to exclude a supported database from the query.
- -s, --sql string : Specify a SQL query on the command line.
- -f, --sql-file filename : Specify one or more SQL queries contained in a file.
- --shell-script : Batch mode operation using shell commands from a text file.
- -w, --write filename : Write the results of any query to the file
- Interactive
- add [object] : Add a new instance of the object.
- edit [object] : Select one instance and edit (set) the parameter values.
- delete [object] : Select one instance for deletion.
- list : Synonym for the --list command outside the shell.
- print [object] : Select one instance and print the parameter values.
- explain [object] : Synonym for the --explain command outside the shell.
- load [filename] : Replace the current book with data from the file. Prompt to save the current book, if any.
- write [filename] : Write out the current book. If no filename is given, write to the original file. (uses STDOUT if STDIN is used.)
- merge [filename] : Merge data from the file into the current book.
- help | ? : The help screen.
- quit | q | exit : Quit the shell
Functions requiring completion
- Interactive
- shell logic - how to edit hierarchical objects in the interactive shell.
Object support
cashutil currently supports these database table names: You can use the names with cashutil -d, in the interactive shell (with 'add' or 'edit') and in SQL queries (as the table name) with cashutil -s|f Descriptions are shown only for readability. Certain objects, like AccountGroup and Commodity, are supported but have few or no editable parameters. This illustrates the kind of ancillary logic that is yet to be built into CashUtil.
| Name | Description |
|---|---|
| SXTGroup | Scheduled Transaction Templates |
| sched-xaction | Scheduled Transaction |
| FreqSpec | Frequency Specification |
| AccountGroup | AccountGroup |
| Split | Split |
| Trans | Transaction |
| Account | Account |
| CommodityTable | CommodityTable |
| CommodityNamespace | Namespace |
| Commodity | Commodity |
| gncOrder | Order |
| gncTaxTable | Tax Table |
| gncVendor | Vendor |
| gncJob | Job |
| gncInvoice | Invoice |
| gncEntry | Order/Invoice/Bill Entry |
| gncEmployee | Employee |
| gncCustomer | Customer |
| gncBillTerm | Billing Term |
| gncAddress | Address |
Use '-d <database> --explain' to see the list of fields within any supported database.
General Information