An overview of the `taxi` command line tool, and it's config
The taxi
command line tool provides access to the compiler - which validates the syntax of taxi projects - and allows plugins of generators to create models and services in different langauges and frameworks.
Download and install the taxi command line tool by running the following:
curl -s "https://gitlab.com/taxi-lang/taxi-lang/raw/master/install-cli.py" | python3
This will install the taxi
command line tool.
A typical taxi project will be laid out as follows:
project/├── src/│ ├── someTypes.taxi│ └── moreTypes.taxi└── taxi.conf
A taxi.conf
file describes a project's layout, and the plugins to be invoked after compilation. It follows the HOCON format, which is like supercharged JSON.
project {sourceFolder: 'src/main/taxi' // defaultoutputFolder: 'target' // defaultplugins: {// specify the plugins, such as generators, here.}}pluginSettings {} // Not currently used.
The config settings map to a TaxiConfig object, with the Project config the common area of config. See the respective links for the canonical definition of attributes and their default values.
Plugins define how a compiled taxi document will be processed. Typically, this involves creating models in some language.
Currently, there's only a single generator provided - the Kotlin generator. However, the plugin system of Taxi is evolving rapidly, and we intend to support loading externally provided plugins.
Plugins can be used to output a taxi model in a specific language - or to modify the source from a generator.
project {plugins: {// create kotlin sourcekotlin {}// Modify the generated source adding JPA annotations// (Note: Not an actual plugin, yet)jpa {}}}
A simple demo project is provided here.