#handler #events #field #event-handling

app kount

A global input counter built for streaming software

1 unstable release

0.1.0 Aug 11, 2021

#965 in Hardware support

MPL-2.0 license

161 lines

Kount #kount:mib.dev crates.io license

A global input counter with a built-in webserver for convenient use with streaming software.


Installing is fairly simple, provided you have a working Rust installation. If you don't have Rust installed, using Rustup to install it is highly recommended.

Compiling from source

To build for your default target, run

cargo build --release

Installing through crates.io

Installing is as simple as running

cargo install kount

Once run, Kount will be installed to your Cargo binary directory (unix: $HOME/.cargo/bin, windows: %USERPROFILE%\.cargo\bin) which should make kount available in your path.


If you don't have a working Rust installation and don't want to setup one, pre-compiled biaries are available from the releases tab.



There are 4 environment variables the user can use to control and configure the program.
If you're not sure how to change these; don't worry. The defaults will likely work for you.

  • KOUNT_ADDR (default:
    IP address the webserver should bind to.
  • KOUNT_PORT (default: 3000)
    Port the webserver should listen on.
  • KOUNT_DIR (default: fields)
    Directory live counter files should be placed in.
  • RUST_LOG (default: kount=info)
    Tracing filter directive for console logs.

Throughout the remainder of this README, $WEB is assumed to be and should be replaced with http://$KOUNT_ADDR:$KOUNT_PORT. By default, $WEB is and therefore the webserver runs at

Using with streaming software

Most streaming software has the ability to embed and live-reload text files. There are files corresponding to all fields, updating live. Reference available in the file API section.

If the streaming software you use isn't listed here, consider opening an issue or starting a topic in discussions about it. It's very likely that Kount can still work with the software.


There's a very rudementary web JSON "API" endpoint available: $WEB/json returns all the counters as a JSON object.


Live-updating files with the values of fields. The directory in which these files are placed can be configured, but are here assumed to be the default of fields. The counter directory is in the directory Kount was run from.

  • fields/keyboard
    Keyboard press count


Endspoints available for directly accessing counters. Prepend $WEB to the endpoints listed below.

  • /field/keyboard
    Keyboard press count


~806K SLoC