neuron-explorer
Steering-first neuron explorer for Qwen3.5-4B: push every MLP neuron, keep every rollout, browse the results
C++17 CLI library with Cobra-like command tree and pflag-like parsing
Developer toolsC++ · CMakeGitHub @cuihairuOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Clasp is a modern C++ library designed for building powerful command-line applications. Inspired by Go's Cobra library, Clasp offers a straightforward API to define and organize commands, parse flags, and manage CLI application lifecycles.
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
Clasp is a modern C++ library designed for building powerful command-line applications. Inspired by Go's Cobra library, Clasp offers a straightforward API to define and organize commands, parse flags, and manage CLI application lifecycles.Read the full README ↗English | 简体中文
Clasp is a modern C++ library designed for building powerful command-line applications. Inspired by Go's Cobra library, Clasp offers a straightforward API to define and organize commands, parse flags, and manage CLI application lifecycles.
NoOptDefVal), and extra helpers like bytes/count/IP/CIDR/IPNet/IPMask/URL.vscode, sublime, iterm2) and --color=auto|always|never.TraverseChildren, sorted help output, examples, and custom help/usage/version templates.__complete directives and configurable completion command names..env-style key=value, .ini/.cfg with [section] mapping, and basic nested-object flatten for .json/.toml/.yaml). Unknown extensions are rejected.Flag parsing is intentionally pflag-like: --k=v, -k=v, short grouping (-abc), bool negation (--no-foo), repeated occurrences, and optional values are all supported. When command traversal is enabled, Clasp keeps subcommand discovery separate from optional flag values, so a token that names a subcommand is not consumed as the value for a NoOptDefVal flag.
git clone https://github.com/cuihairu/clasp.git
cd clasp
cmake -S . -B build
cmake --build build --parallel
ctest --test-dir build --output-on-failure
cmake --install build
# or: cmake --install build --prefix /your/prefix
To build/install only the library (no examples/CTest), configure with -DCLASP_BUILD_EXAMPLES=OFF.
#include "clasp/clasp.hpp"
#include <iostream>
#include <string>
#include <vector>
int main(int argc, char** argv) {
clasp::Command rootCmd("app", "A brief description of your application");
clasp::Command printCmd("print", "Prints a message to the console");
printCmd
.withFlag("--message", "-m", "message", "Message to print", std::string("Hello, World!"))
.action([](clasp::Command& /*cmd*/, const clasp::Parser& parser, const std::vector<std::string>& /*args*/) {
const auto message = parser.getFlag<std::string>("--message", "Hello, World!");
std::cout << message << "\n";
return 0;
});
rootCmd.addCommand(std::move(printCmd));
return rootCmd.run(argc, argv);
}
./app print --message "Hello, Clasp!"
Hello, Clasp!
EXAMPLES.md: index of all runnable examples and what they demonstrate.COMPAT.md: what “Cobra-like” means for this project.CHANGELOG.md: notable changes and release notes.include/clasp/ (clasp/clasp.hpp includes the main API).docs/: VuePress site sources (optional).CLI > env > config file > default.configFile("path") hardwires a config path; configFileFlag("config") lets a flag such as --config supply it..env, .ini, .cfg, .json, .toml, and .yaml/.yml. Unknown extensions are rejected.__complete / __completeNoDesc commands.markFlagFilename(...) and markPersistentFlagFilename(...), or markFlagDirname() and markPersistentFlagDirname().ctest --test-dir build -C Debug --output-on-failure.The test suite is broad, but coverage report generation depends on toolchain support:
-DCLASP_ENABLE_COVERAGE=ON and use your usual gcov/lcov flow.CLASP_ENABLE_COVERAGE does not instrument MSVC builds. Use Visual Studio code coverage tooling if you need a Windows coverage report.cd docs
npm install
npm run dev
Clasp follows SemVer. The version in CMakeLists.txt is kept consistent with the CLASP_VERSION_* macros in include/clasp/clasp.hpp.
After installing (or setting CMAKE_PREFIX_PATH to your install prefix), consume Clasp via:
find_package(clasp CONFIG REQUIRED)
target_link_libraries(myapp PRIVATE clasp::clasp)
Issues and PRs are welcome.
Clasp is licensed under the Apache License 2.0. See LICENSE for more details.