Skip to content

Customization

Understanding Cit

The cit repo has this structure:

cit/
  ...
  commands/
    cit.just
    scaffold.just
    open.just
    run.just
    ...

The cit command is an alias to

just -f $CIT_HOME/commands/cit.just

The main cit.just imports other .just files as submodules. Check out just to learn more about it!

Adding a new subcommand

We want to add:

cit <command> <new-subcommand> # e.g. cit run kafka

We'll have to add a new rule to commands/<command>.just:

# commands/run.just

kafka:
  docker run --rm -d --name kafka -p 9092:9092 apache/kafka:latest

Adding a new command

We want to add:

cit <new-command> # e.g. cit say

We'll have to add a new .just file (a Just module) to commands/:

# commands/say.just

hello:
  @echo Hello

bye:
  @echo Bye

And then we'll have to import it in commands/cit.just:

# commands/cit.just
mod say