Docs Menu

Quick Start

A 5-step, 60-second guide to setting up your first Ion project.

1. Create a Project

Initialize a new executable project using the C++23 standard.

bash
ion new my-app --std 23
cd my-app

This generates the following structure:

text
my-app/
├── src/main.cpp
├── include/
├── tests/
├── CMakeLists.txt
└── ion.toml

2. Add Dependencies

Let's add fmt for formatting and spdlog for logging from the default Ion registry.

bash
ion add fmt spdlog

Your ion.toml will be automatically updated:

toml
[project]
name = "my-app"
version = "0.1.0"
std = "23"

[dependencies]
fmt = "10.2.1"
spdlog = "1.14.1"

3. Build Out the Logic

Update src/main.cpp to use the newly installed libraries.

cpp
#include <fmt/core.h>
#include <spdlog/spdlog.h>

int main() {
    spdlog::info("Application started");
    fmt::print("Hello, {}!\n", "Ion");
    return 0;
}

4. Build and Run

Compile the project with ion build. The tool will download dependencies, generate the CMake hierarchy, and invoke your compiler.

bash
ion build
ion run

5. Check Code Quality

Use Ion's built-in linter to analyze your code for memory leaks, modern C++ anti-patterns, and bad practices.

bash
ion check --fix

The --fix flag will automatically apply simple fixes (like changing NULL to nullptr).