Flow is a set of command line tools designed to simplify expences tracking, analysis and forecast. Working in conjuction with your favorite editors for JSON and CSV files it helps to maintain your budget.
Flow works with a PostgreSQL database, so you'll need to spin one up and save connection string into flow configuration. You can use src\docker-compose.yaml
file to spin up a new database or use an existing instance if you have one.
Before the first use, you need to apply database migrations from Flow.Infrastructure.Storage.Migrations
project using EF Core .NET Core CLI tools. They are already referenced in src\.config\dotnet-tools.json
so you'll just need to run dotnet tool update
as mentioned in the guide.
Once tools are installed, please use dotnet ef database update -- %CONNECTION_STRING_HERE%
command in Migrations project folder. Don't forget to replace %CONNECTION_STRING_HERE%
with actual connection string.
Flow works best together with file editors, but they are optional. Apps can always record output to file or print it to STDOUT so you can examine the results of the command without any editor.
- Clone repository
- Navigate to
build\_scripts
folder - Invoke script
flow.cli-bundle.ps1
(or copy command and invoke it from command line if you don't use PowerShell) - Copy binaries from folder
build\cli-bundle
to desired location. Don't forget to add this location to PATH environment variable! - run
flow bundle register
to add folder with bundle to path and set appsettings.json as a global config file for all flow apps
Now you can use all CLI tools in any folder.
CLI tools uses .NET Configuration with json and Environment Variables providers available.
You can write settings to appsettings.json file in the working directory, specify a separate file location in FLOW_CONFIG_FILE
environment variable or set environment variables to override anyting what's already in settings file.
flow bundle configure
shorthand allows to open editor for configuration file from FLOW_CONFIG_FILE
environment variable.
There are quite a few settings to provide, and most of them optional:
flow:ConnectionString
- required. A connection string to PostgreSQL database that handles data;flow:CultureCode
- optional. Culture code (2-letter language, 2-letter region) that should be used to read or write data. App will use current culture by default;flow:Editor:JSON
- a path to external editor for JSON files. Empty by default;flow:Editor:CSV
- a path to external editor for CSV files. Empty by default;flow:PluginsPath
- a path to folder with the plugins. Empty by default;
Once registered and configured, CLI bundle is ready to work. You can use it on your own or add tools into batch scripts as any other regular CLI application.
All tools have help command
that briefly explains supported commands and its options. More detailed guides can be found below:
Flow has a plugin system that allows to extend core functionality with 3rd-party addons. The plugins should be placed to a specific folder (that needs to be defined in configuration). Each plugin must be placed to its own subfolder to avoid dependency resolution conflicts.
As an example, this repository contains a special transaction detector for Tinkoff bank. If you need it, you can build this plugin using build\_scripts\flow.plugins.transactions.ps1
script and then copy entire build\plugins\Flow.Plugins.Transactions.TKF
directory into plugins directory specified in configuration file.
Please refer to Architecture Decision Records first.
It's preferrable to use Visual Studio to work with a solution, but any .NET-friendly IDE or editor should work.
Build scripts used for package creation are powershell scripts, but it's not required to use them for development.
Solution contains several test projects with unit tests.
If you want to create a plugin for flow, you need to to pack plugin dependencies into nuget packages using build\_scripts\flow.plugin-deps.ps1
script.
Then you can reference them from your project and implement a particular plugin interface. You can implement several plugins within a single project, if needed. Each plugin is isolated from main DI container by design, so you are responsible for proper plugin initialization in constructor.
MIT