Skip to content
项目

关于

A modern Rust-powered CLI to easily create, configure, and build C/C++ projects with CMake.

开发工具

这些数字如何统计

可以做什么

  • C11/C17 and C++11/14/17/20/23 executable, static-library, and header-only templates.
  • Non-destructive new and init commands, optional tests and Git initialization.
  • CMake configuration/build/run/clean commands with Debug/Release, generator, compiler, and parallel-job options.
  • Tool diagnostics through clyx doctor and a portable --no-color mode.

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Clyx

Clyx is a small, cross-platform Rust CLI for creating and managing modern C and C++ projects built with CMake. Generated projects use target-based CMake and keep source files, build artifacts, and configuration separate.

Features

  • C11/C17 and C++11/14/17/20/23 executable, static-library, and header-only templates.
  • Non-destructive new and init commands, optional tests and Git initialization.
  • CMake configuration/build/run/clean commands with Debug/Release, generator, compiler, and parallel-job options.
  • Tool diagnostics through clyx doctor and a portable --no-color mode.

Installation and prerequisites

Install Clyx locally with Cargo from a cloned checkout:

git clone https://github.com/Viazel/clyx.git
cd clyx
cargo install --path .

The installed clyx executable is then available from Cargo's binary directory (usually ~/.cargo/bin):

clyx --version

Clyx itself needs a stable Rust toolchain. Generated projects need CMake 3.16+ and a C or C++ compiler. Ninja and Git are optional unless selected explicitly.

Quick start

clyx new hello --language cpp --standard c++20 --tests --git
cd hello
clyx build --debug --jobs 8
clyx run
clyx build --release
clyx clean --all

Use clyx init in an existing directory. It never replaces existing source files or CMakeLists.txt; --force only permits writing missing project scaffolding in a non-empty directory.

Commands

Command Purpose
new NAME Create a project (--language, --standard, --template, --tests, --git, --compiler)
init [PATH] Initialize an existing directory
build Configure and build (--debug, --release, --jobs, --generator, --clean)
run Build and execute the generated executable
clean Remove build artifacts; --all also removes nested target/build directories
list Show project metadata and available templates
doctor Check CMake, compilers, Ninja, and Git

Run clyx --help or clyx COMMAND --help for complete option details.

Configuration

Each project has an optional clyx.toml:

[defaults]
standard = "c++20"
template = "executable"
tests = true

[build]
generator = "Ninja"
build_type = "Debug"

[ui]
color = true

Command-line options override project settings. Configuration is not required for CMake projects created outside Clyx.

Generated layout

An executable contains CMakeLists.txt, clyx.toml, a generated README.md, source layout (src/, optional tests/, and include/), and a .gitignore. Libraries use add_library; header-only libraries use an INTERFACE target and install-ready include paths.

Contributing

See CONTRIBUTING.md for development and template guidance.

License

MIT; see LICENSE.

探索相关项目

加载中…