API Reference

The main interface

@quicken.cli_factory(name, *, runtime_dir_path=None, log_file=None, server_idle_timeout=None, bypass_server=None, reload_server=None)[source]

Decorator to mark a function that provides the main script entry point.

To benefit most from the daemon speedup, you must do required imports within the factory function itself and then have the returned function itself do a minimal amount of configuration - only those things dependent on e.g. environment/cwd.

If any imported top-level modules make use of environment then they must be reconfigured on invocation of the cli, otherwise the environment of future clients will not be taken into account.

Parameters:
  • name (str) – the name used for the socket file.
  • runtime_dir_path (Optional[str]) – the directory used for the socket and pid file. If not provided then we fall back to: $XDG_RUNTIME_DIR/quicken-{name} or $TMPDIR/quicken-{name}-{uid} or /tmp/quicken-{name}-{uid}. If the directory exists it must be owned by the current user and have permissions 700.
  • log_file (Optional[str]) – optional log file used by the server, must be an absolute path. If not provided the default is $XDG_CACHE_HOME/quicken-{name}/server.log or $HOME/.cache/quicken-{name}/server.log.
  • server_idle_timeout (Optional[float]) – time in seconds after which the server will shut down if no requests are being processed.
  • bypass_server (Optional[Callable[[], bool]]) – if True then run command directly instead of trying to use daemon.
  • reload_server (Optional[Callable[[], bool]]) – if True then restart the server before executing the function.
Throws:
QuickenError: If any directory used by runtime_dir does not have the
correct permissions.