This guide helps AI agents and human contributors work with the
edenreich/console-component repository. It covers project layout,
build/test commands, coding style, and contribution conventions.
.
├── AGENTS.md # This file — contributor guide for agents
├── CLAUDE.md -> AGENTS.md # Symlink for Claude Code compatibility
├── .githooks/
│ └── pre-commit # Pre-commit hook (typecheck + tests)
├── .clang-format # WebKit-based C++ formatting rules
├── .gitignore
├── CMakeLists.txt # Root CMake — delegates to src/ and tests/
├── CHANGELOG.md # Release notes (Keep a Changelog style)
├── LICENSE
├── README.md
├── cmake/
│ └── CPM.cmake # CPM dependency manager
├── src/
│ ├── CMakeLists.txt # Library build — static lib `console`
│ ├── application.cpp
│ ├── input.cpp
│ ├── output.cpp
│ ├── progress_bar.cpp
│ └── include/console/
│ ├── application.h
│ ├── input.h
│ ├── output.h
│ ├── progress_bar.h
│ ├── interfaces/ # Abstract interfaces (CommandInterface, etc.)
│ └── types/ # Type aliases, enums (ExitCode, Colors, etc.)
├── tests/
│ ├── CMakeLists.txt # Test build — links gtest + console
│ ├── main.cpp # Google Test entry point
│ └── unit/
│ ├── application_test.cpp
│ ├── input_test.cpp
│ ├── output_test.cpp
│ └── commands/ # Test command stubs (greetings/, todo/)
├── examples/
│ ├── http/ # Example: HTTP client using the library
│ └── todo/ # Example: Todo-list CLI app
└── .github/workflows/
├── build.yml # CI: build + test on ubuntu/macos/windows
├── lint.yml # CI: clang-format-18 check
└── tasks.yml # Agent workflow dispatch
- CMake ≥ 3.12
- C++17 compiler (GCC 7+, Clang 5+, MSVC 2017+)
- make (or Ninja)
cd build
cmake .. -DCMAKE_BUILD_TYPE=ReleaseTests are enabled by default (-DWITH_TESTS=ON). To disable:
cmake .. -DWITH_TESTS=OFFcd build
cmake --build . --target install --config ReleaseThe built library and headers are installed to build/dist/.
./build/bin/testsfind . -iname '*.cpp' -o -iname '*.h' | grep -v build | xargs clang-format-18 -nTo auto-format in-place, replace -n with -i.
cd build && cmake .. -DCMAKE_BUILD_TYPE=Release && cmake --build . --target install --config Release && ../build/bin/tests- Language: C++17 (
CMAKE_CXX_STANDARD 17) - Formatting: WebKit-based via
.clang-format(4-space indent, 150-char column limit, All namespace indentation) - Include guards:
#ifndef/#define/#endifstyle (uppercase, underscored) - Comments: Doxygen-style (
/** @param ... @return ... */) - Naming:
- Classes: PascalCase (
Application,CommandInterface) - Methods: camelCase (
setApplicationName,getDescription) - Member variables:
m_prefix (m_name,m_commands) - Namespaces: PascalCase (
Console::,Console::Interfaces,Console::Types)
- Classes: PascalCase (
- No external runtime dependencies — the library is statically linked and keeps deps minimal
- SortIncludes:
false(includes are not auto-sorted by clang-format)
Use Conventional Commits:
<type>(<scope>): <description>
| Type | Usage |
|---|---|
feat |
New feature or command |
fix |
Bug fix |
chore |
Tooling, CI, build, or repo maintenance |
docs |
Documentation changes |
style |
Formatting, clang-format changes |
refactor |
Code restructuring without behavior change |
test |
Adding or updating tests |
Scope examples: core, input, output, progress-bar, ci, docs.
Examples:
feat(core): add command suggestion on typo
fix(input): handle empty option values correctly
chore(ci): update cmake version in build workflow
docs(readme): add install instructions for vscode extension
- Branch naming:
feature/<short-description>orfix/<short-description>. - PR title: Same as the commit message —
type(scope): description. - PR description: Include a Summary (2–4 sentences) and a Changes bullet list.
- CI must pass before review — the build workflow runs on ubuntu, macOS, and Windows.
- Do not merge your own PR — a human maintainer reviews and merges.
- Keep PRs focused — one logical change per PR.
A .githooks/pre-commit script is provided. It runs the project's
typecheck (build) and tests before each commit. The hook is inert
until you activate it:
git config core.hooksPath .githooksRun this once per clone. After that, git commit will automatically
build and test your changes. If the build or tests fail, the commit is
aborted.
This repository supports agent-driven development via
.github/workflows/tasks.yml. Agents are dispatched on:
workflow_dispatch(manual trigger with a prompt)issueopened or editedissue_commentcreatedpull_request_review_commentcreated
Agents use the inference-gateway/infer-action action and are
configured with the @opentask trigger phrase.