{\itshape Elektra provides a universal and secure framework to store configuration parameters in a global, hierarchical key database.}



The core is a small library implemented in C. The plugin-\/based framework fulfills many configuration-\/related tasks to avoid any unnecessary code duplication across applications while it still allows the core to stay without any external dependency. Elektra abstracts from cross-\/platform-\/related issues with an consistent A\+P\+I, and allows applications to be aware of other applications' configurations, leveraging easy application integration.

\href{#goals}{\tt Why should I use Elektra?}

\subsection*{Contact}

Do not hesitate to ask any question on \href{https://github.com/ElektraInitiative/libelektra/issues}{\tt github issue tracker}, \href{https://lists.sourceforge.net/lists/listinfo/registry-list}{\tt Mailing List} or directly to one of the authors.

\subsection*{Quickstart}

If you want to use Elektra for your application, \hyperlink{doc_tutorials_application-integration_md}{read the application integration tutorial}.

\subsubsection*{Installation}

The preferred way to install Elektra is by using packages provided for your distribution. On Debian/\+Ubuntu, this can be done by running the following command\+:

```bash sudo apt-\/get install elektra-\/bin libelektra-\/dev ```

This will install the Elektra tools as well as everything needed to develop with Elektra.

If you're not running Debian/\+Ubuntu, check out the \href{#packages}{\tt package list}, \href{#download}{\tt download elektra directly} or \href{#compiling}{\tt compile it yourself}.

It is preferable to use a recent version\+: They contain many bug fixes and additional features. See \hyperlink{doc_INSTALL_md}{I\+N\+S\+T\+A\+L\+L} for other ways to install Elektra.

\subsubsection*{Usage}

Now that we have Elektra installed, we can start using the \hyperlink{md_doc_help_kdb_doc_help_kdb_md}{kdb command} and the qt-\/gui.

You can use the {\ttfamily kdb} command to configure your applications\+:

```bash kdb set user/env/override/\+H\+T\+T\+P\+\_\+\+P\+R\+O\+X\+Y \char`\"{}http\+://my.\+proxy\+:8080\char`\"{} ```

This will set the {\ttfamily H\+T\+T\+P\+\_\+\+P\+R\+O\+X\+Y} environment variable to {\ttfamily \href{http://my.proxy:8080}{\tt http\+://my.\+proxy\+:8080}}. Configuration can be retrieved with {\ttfamily kdb get}\+:

```bash kdb get /env/override/\+H\+T\+T\+P\+\_\+\+P\+R\+O\+X\+Y ```

For information about elektrified environment variables, see \hyperlink{md_src_libgetenv_README_src_libgetenv_README_md}{src/libgetenv/\+R\+E\+A\+D\+M\+E.md}

\subsubsection*{Documentation}

To get an idea of Elektra, you can take a look at the \href{http://www.libelektra.org/ftp/elektra/presentations/2016/FOSDEM/fosdem.odp}{\tt presentation}.

The full documentation, including \href{http://libelektra.org/blob/master/doc/tutorials/}{\tt tutorials}, \hyperlink{md_doc_help_elektra-glossary_doc_help_elektra-glossary_md}{glossary}, and \hyperlink{md_doc_help_elektra-introduction_doc_help_elektra-introduction_md}{concepts and man pages} is available in the github repository.

You can read the documentation for the kdb tool, either


\begin{DoxyItemize}
\item http\+://libelektra.org/blob/master/doc/help/kdb.\+md \char`\"{}on github\char`\"{}
\item \href{http://doc.libelektra.org/api/latest/html/md_doc_help_kdb.html}{\tt in the A\+P\+I docu}
\item by using {\ttfamily kdb -\/-\/help} or {\ttfamily kdb help $<$command$>$}
\item by using {\ttfamily man kdb}
\end{DoxyItemize}

\subsection*{Goals}


\begin{DoxyItemize}
\item Make it trivial for applications and administrators to access any configuration
\item Postpone some decisions from programmers to
\item Make configuration storage more safe\+: avoid that applications receive wrong or unexpected values that could lead to undefined behaviour.
\item Allow software to be better integrated on configuration level maintainers/administrators, e.\+g. which syntax and the location of configuration files.
\item Reduce rank growth of configuration parsers in our ecosystem, but foster well maintained plugins instead.
\end{DoxyItemize}

And in terms of quality, we want\+:


\begin{DoxyEnumerate}
\item Simplicity (make configuration tasks simple),
\item Robustness (no undefined behaviour of applications), and
\item Extensibility (gain control over configuration access)
\end{DoxyEnumerate}

\hyperlink{doc_GOALS_md}{Read more about the goals of Elektra}

\subsection*{Facts and Features}


\begin{DoxyItemize}
\item Elektra uses the B\+S\+D licence.
\item Elektra implements an \href{http://doc.libelektra.org/api/latest/html/}{\tt A\+P\+I} to fully access a global key database.
\item Elektra can be thought of a virtual file system for configuration.
\item Elektra supports mounting of existing configuration files into the global key database.
\item Elektra has dozens of \hyperlink{md_src_plugins_README_src_plugins_README_md}{Plugins} that make it possible to have a tiny core, but still support many features, including\+:
\begin{DoxyItemize}
\item Elektra can import and export configuration files in any \hyperlink{md_src_plugins_README_src_plugins_README_md}{supported format}.
\item Elektra is able to log and notify other software on any configuration changes, e.\+g., using \hyperlink{md_src_plugins_dbus_README_src_plugins_dbus_README_md}{Dbus} and \hyperlink{md_src_plugins_journald_README_src_plugins_journald_README_md}{Journald}.
\item Elektra can improve robustness by rejecting invalid configuration via \hyperlink{md_src_plugins_type_README_src_plugins_type_README_md}{type checking}, \hyperlink{md_src_plugins_validation_README_src_plugins_validation_README_md}{regex} and more.
\item Elektra provides different mechanisms to \hyperlink{md_src_plugins_resolver_README_src_plugins_resolver_README_md}{locate configuration files}.
\item Elektra supports different ways to \hyperlink{md_src_plugins_ccode_README_src_plugins_ccode_README_md}{escape} and \hyperlink{md_src_plugins_iconv_README_src_plugins_iconv_README_md}{encode} content of configuration files.
\end{DoxyItemize}
\item Elektra is multi-\/process safe and can be used in multi-\/threaded programs.
\item Elektra (except for some \hyperlink{md_src_plugins_README_src_plugins_README_md}{plugins}) is portable and completely written in Ansi-\/\+C99.
\item Elektra (except for some \hyperlink{md_src_plugins_README_src_plugins_README_md}{plugins}) has no external dependency.
\item Elektra is suitable for embedded systems and early boot stage programs.
\item Elektra uses simple key/value pairs that include metadata for any other information.
\item Elektra provides many powerful Bindings to avoid low-\/level access code.
\item Elektra provides powerful Code Generation Techniques for high-\/level configuration access.
\end{DoxyItemize}

\subsection*{News}


\begin{DoxyItemize}
\item \href{http://doc.libelektra.org/news/3c00a5f1-c017-4555-92b5-a2cf6e0803e3.html}{\tt 17 Sep 2015 0.\+8.\+13} adds elektrify-\/getenv
\item \href{http://doc.libelektra.org/news/98770541-32a1-486a-98a1-d02f26afc81a.html}{\tt 12 Jul 2015 0.\+8.\+12} adds dir namespace
\item \href{http://doc.libelektra.org/news/7d4647d4-4131-411e-9c2a-2aca39446e18.html}{\tt 03 Apr 2015 0.\+8.\+11} adds spec namespace
\item \href{http://doc.libelektra.org/news/6ce57ecf-420a-4a31-821e-1c5fe5532eb4.html}{\tt 02 Dec 2014 0.\+8.\+10} adds X\+D\+G/\+Open\+I\+C\+C compatibility
\item \href{http://doc.libelektra.org/news/38640673-3e07-4cff-9647-f6bdd89b1b08.html}{\tt 04 Nov 2014 0.\+8.\+9} adds qt-\/gui
\item \href{http://doc.libelektra.org/news/eca69e19-5ddb-438c-ac06-57c20b1a9160.html}{\tt 02 Sep 2014 0.\+8.\+8} adds 3-\/way merging
\end{DoxyItemize}

Also see \hyperlink{doc_NEWS_md}{News} and its \href{http://www.libelektra.org/news/feed.rss}{\tt R\+S\+S feed}.

\subsection*{Sources}

\subsubsection*{Packages}

The preferred way to install Elektra is by using packages provided for your distribution\+:
\begin{DoxyItemize}
\item \href{https://admin.fedoraproject.org/pkgdb/package/elektra/}{\tt Fedora}
\item \href{http://packages.gentoo.org/package/app-admin/elektra}{\tt Gentoo}
\item \href{https://aur.archlinux.org/packages/elektra/}{\tt Arch Linux}
\item \href{https://packages.debian.org/de/jessie/libelektra4}{\tt Debian}
\item \href{https://launchpad.net/ubuntu/+source/elektra}{\tt Ubuntu}
\end{DoxyItemize}

Available, but not up-\/to-\/date (Version 0.\+7)\+:
\begin{DoxyItemize}
\item \href{http://svnweb.mageia.org/packages/updates/1/elektra/}{\tt Mageia}
\item \href{http://community.linuxmint.com/software/view/elektra}{\tt Linux Mint}
\end{DoxyItemize}

For \href{https://build.opensuse.org/package/show/home:bekun:devel/elektra}{\tt Open\+S\+U\+S\+E, Cent\+O\+S, Fedora, R\+H\+E\+L and S\+L\+E} Kai-\/\+Uwe Behrmann kindly provides packages \href{http://software.opensuse.org/download.html?project=home%3Abekun%3Adevel&package=libelektra4}{\tt for download}. For Debian wheezy and jessie amd64 we provide latest builds. See build server below.

If there are no packages available for your distribution, see the \hyperlink{doc_INSTALL_md}{installation document}.

\subsubsection*{Download}

Elektra's uses a \href{https://github.com/ElektraInitiative/libelektra}{\tt git repository at github}.

You can clone the latest version of Elektra by running\+: \begin{DoxyVerb}     git clone https://github.com/ElektraInitiative/libelektra.git
\end{DoxyVerb}


Releases can be downloaded from \href{http://www.libelektra.org/ftp/elektra/releases/}{\tt http} and {\ttfamily \href{ftp://ftp.libelektra.org/elektra/releases/}{\tt ftp\+://ftp.\+libelektra.\+org/elektra/releases/}}

\subsubsection*{Compiling}

After downloading or cloning Elektra, {\ttfamily cd} to the directory and run the following commands to compile it\+:


\begin{DoxyItemize}
\item {\ttfamily mkdir -\/p build}
\item {\ttfamily cd build}
\item {\ttfamily cmake ..}
\item {\ttfamily make}
\end{DoxyItemize}

Then you can use {\ttfamily sudo make install} to install it.

You can also use the `./configure` command to generate a {\ttfamily cmake} command with special options.

For more information, especially how to set C\+Make Cache, see \hyperlink{doc_COMPILE_md}{here}. Make sure to read how to add plugins, tools and bindings.

\subsection*{Build Server}

The \href{http://build.libelektra.org:8080/}{\tt build server} builds Elektra on every commit in various ways and also produces \href{http://doc.libelektra.org/coverage/latest}{\tt L\+C\+O\+V code coverage report}.

To use the debian repository of the latest builds from master put following files in /etc/apt/sources.list. For jessie\+: \begin{DoxyVerb}    deb     [trusted=yes] http://194.117.254.29/elektra-stable/ jessie main
    deb-src [trusted=yes] http://194.117.254.29/elektra-stable/ jessie main
\end{DoxyVerb}


For wheezy\+: \begin{DoxyVerb}     deb     [trusted=yes] http://build.libelektra.org/debian/ wheezy main
     deb-src [trusted=yes] http://build.libelektra.org/debian/ wheezy main
\end{DoxyVerb}


\subsection*{Develop}

To start development, just clone the repo and start hacking!


\begin{DoxyItemize}
\item We encourage you to improve documentation, especially the R\+E\+A\+D\+M\+E.\+md as if they were a webpage.
\item You should read the \hyperlink{doc_CODING_md}{coding document} before you issue a pull request.
\item Make yourself familiar with the \hyperlink{md_doc_help_elektra-data-structures_doc_help_elektra-data-structures_md}{Key\+Set} (also in the \href{http://doc.libelektra.org/api/latest/html/group__keyset.html}{\tt A\+P\+I docu}) the central data structure in Elektra.
\item You should read the \hyperlink{doc_DESIGN_md}{design document} before you make design relevant decisions.
\item You can always peek into the T\+O\+D\+Os, if you don't know what to do. 
\end{DoxyItemize}