Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Horos

A minimalist command-line utility written in Rust for bootstrapping C development environments with pre-configured build scripts and automatic Language Server Protocol (LSP) resolution.

<project_name>/
├── .clangd          # Language server configuration with host-detected resource paths
├── .gitignore       # Source control exclusions
├── README.md        # Initial project documentation
├── build.sh         # POSIX-compliant automated compilation script
├── include/         # Header file interface directory (.h)
└── src/             # Implementation source directory (.c)


Technical Architecture & Templates

Horos generates zero-dependency, structured environments optimized for specific compilation targets. It completely bypasses complex build system generators, relying instead on clean directory separation and direct compiler invocations via POSIX shell scripts.

1. Native Target (Default)

Engineered for general-purpose applications, CLI tools, and system libraries.

  • Standard: C11
  • Compiler Execution: clang
  • Compilation Flags: -O2 -Wall -Wextra

2. Web Target

Configured for WebAssembly (Wasm) compilation layers.

  • Toolchain Integration: Emscripten (emcc)
  • Compilation Model: Freestanding module architecture generated without a default main entry point, optimized specifically for exported function interfaces.

3. Kernel Target

An unconstrained, freestanding environment engineered for bare-metal, OS kernel, bootloader, or low-level firmware development.

  • Compilation Flags: -ffreestanding -nostdlib -nostdinc
  • Runtime Bounds: Standard libc is entirely excluded; provides a clean slate for custom memory layouts and runtime implementations.

Systems Integration

Automated LSP Path Resolution

To ensure immediate, out-of-the-box code navigation and diagnostics without manual configuration, Horos actively inspects the host system during execution:

  1. It queries the local compiler layer using clang -print-resource-dir to locate the exact host resource directory.
  2. It dynamically injects these absolute paths into the generated .clangd file.
  3. This allows any LSP-compliant editor (e.g., Vim, Neovim, VS Code) to resolve system-level headers accurately, even when operating inside isolated, containerized, or cross-compilation environments.

Security Boundaries & Sanitization

  • Path Traversal Protection: The generator strictly rejects project names containing absolute paths or parent directory navigation components (..).
  • Shell Infiltration Defense: Inputs are strictly sanitized against shell-sensitive characters (;, &, |, $, ```), eliminating potential command injection vectors inside the generated POSIX build.sh.

Memory & Performance Optimization

  • Buffer Allocation: String buffers are pre-allocated to size during template generation to minimize heap reallocations.
  • Filesystem Caching: PathBuf components are cached and evaluated deterministically to minimize redundant I/O filesystem joining operations.

Usage

Installation

# From Crates.io
cargo install horos

# From Source
git clone https://github.com/KirikaeLabs/horos
cd horos
cargo install --path .

Syntax

horos <PROJECT_NAME> [OPTIONS]

Options

Option Short Description
--type <TYPE> -t Selects target template: native (default), web, or kernel
--force Forces execution by overwriting the target directory if it exists
--dry-run Outputs planned filesystem operations to stdout without execution

Examples

# Initialize a standard C11 environment
horos system_tool

# Initialize a WebAssembly compilation environment
horos web_module --type web

# Initialize a freestanding bare-metal environment
horos custom_kernel --type kernel

Project Metadata

About

A minimalist C project scaffolding tool

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages