Documentation · Commands

kalku init

Keeps kalku in a project: detects the language and writes .kalku.toml and .kalku/summon.

Sets a project up: it detects its language and writes .kalku.toml and the .kalku/summon script.

kalku init [dir] [options]

It is not needed to measure: a project without a .kalku.toml is measured as it is. init is for keeping kalku in the project, with a configuration the team shares.

What it does

It reads the project’s own markers, says what it found and asks before writing. This is its output in an Elixir project, with --yes:

kalku: this looks like elixir (mix.exs is here)

It will write:
  ./.kalku.toml     how a run is set up
  ./.kalku/summon   how this project's kalku is summoned
  mix.exs            this line in `deps`, so the kalku can be summoned:
                        {:kalku_elixir, "~> 0.1", only: :test, runtime: false}

  wrote   ./.kalku.toml
  wrote   ./.kalku/summon

The marker decides the language:

MarkerLanguage
mix.exsElixir
Cargo.tomlRust
pyproject.tomlPython
pom.xml, or the Gradle filesJava
kai.tomlkaikai

What it never does

  • It never writes over a file that is there.
  • It never edits the build file that decides what a project depends on: it prints the line to add and says why.

In an Elixir project, after adding that line to deps:

mix deps.get
kalku run lib/thing.ex

Options

OptionWhat it does
--lang <name>The project’s language, when init should not guess
-y, --yesDo not ask before writing

Configuration explains the file it leaves.