Skip to content

Initialization

In this page, you'll learn,

  • Recommended Folder structure of a project.
  • How to install and source the Kit
  • Creating basic configuration file

Directory Structure

About this..

  • The default structure is intended (& recommended) to provide a clean structure & follo
  • wed by documentation.
  • Except modules dir, config file, you are free to organize your project however you like.1
Project Root
├── main.sh
├── config.yml 
├── src/
│   └── packages.sh
└── modules/
    ├── Module1.sh
    └── Module2.sh

1. main.sh

  • Location: Project Root
  • Desc:
  • This is entry point of the project.
  • This file holds all steps. initializing kit, importing modules, using methods, is done in this method.
Example main.sh
#!/bin/bash

# Init Kit
eval "$(kireisakura -i)"

# Import modules
kimport utils.os utils.font

# list all installed fonts & find one
font.list | grep "jetbrains"

# Rest of the script

2. config.yml

  • Location: Project Root
  • Desc:
  • This file holds configuration for your project.
  • It allows you to customize the behavior of the Kit in your project.
  • See configuration reference for details.

3. modules dir

  • Location: Project Root
  • Desc: This directory holds local modules. This directory is interpreted as local package within the kit.

4. src dir

  • Location: Project Root
  • Desc: This directory is intended to hold resource files that are part of your project.
Example src/packages.sh
cli_packages=(
    "yazi"
    "eza"
    "htop"
)

gui_packages=(
    "zen-browser"
    "code-oss"
    "mpv"
    "redshift"
)
#!/bin/env bash
source src/packages.sh

install-package cli_packages gui_packages


Installation & source Kit

Before everything

  • Make sure you have curl, grep installed.
  • Optionally figlet too for the header.

ℹ️ There are two ways to Install & source the kit : -

  • This one is recommended.
  • Just execute your entry script, initialization will be done automatically.
  • Suitable for portable scripts. (ex. in a dotfiles install script)
Add these lines at top of your script
#!/bin/env bash

if command -v kireisakura &> /dev/null; then
  eval "$(kireisakura --init)"
else
  clear -x
  printf "\n> Downloading KireiSakura-Kit\n"
  curl -sSL https://kireisakura.soymadip.me/install | bash -s -ds
fi
  • Installs the kit in your system but Doesn't source kit even if executed inside a script.
  • Suitable if only needed to install.
Run this in terminal
curl -L https://kireisakura.soymadip.me/install | bash -s


Create config file

Create a file called config.yml in your project root.

Add below lines with proper values : -

Project:
    name: "Your project name"
    owner: "your name"

  1. These can be customized too. See configuration reference