No description
Find a file
2026-08-30 22:43:04 +02:00
.gitignore .gitignore 2026-08-30 22:43:04 +02:00
example.gif v1.0 2026-08-26 11:26:53 +02:00
getapi Yes, C++ *does* require more logic... 2026-08-26 12:14:38 +02:00
LICENSE.txt v1.0 2026-08-26 11:26:53 +02:00
README.md Yes, C++ *does* require more logic... 2026-08-26 12:14:38 +02:00

getapi

A fast, lightweight CLI helper for instantly extracting and colorizing C/C++ API function declarations in your terminal.

Note

What getapi is (and isn't): getapi is a quick command-line helper designed to help you rapidly wade through API "deserts" when onboarding or exploring C/C++ header files. It is not a full-fledged source-to-documentation tool (like Doxygen or Sphinx). Instead, it gives you a zero-config, terminal-native way to summarize, left-align, and visually group an API's function declarations in seconds.


Features

  • Left-Aligned Function Names: Converts traditional C prototypes (int foo(int x)) into trailing return type syntax (foo(int x) -> int;), aligning function names cleanly along the left margin for effortless scanning.
  • Distinct Multi-Color Highlighting
  • Automatic Namespace Detection: Automatically detects common C namespace conventions (prefix_action) without requiring setup.

🚀 Quick Start

# Dump a clean, colorized API overview directly to standard output
./getapi path/to/header.h

# Explicitly specify custom library prefixes
./getapi -n mylib_ -n sys_ path/to/header.h

# Save colorized API summary to a file
./getapi -o api_summary.h path/to/header.h

📋 Sample Output

LiceCAP capture of getapi working on sds.h


🛠️ Options

usage: getapi [-h] [-n NAMESPACE] [-o OUTPUT] [-v] [file]

Extract and syntax-highlight C/C++ API function declarations with ANSI escape
codes.

positional arguments:
  file                  Path to raw C/C++ header file

options:
  -h, --help            show this help message and exit
  -n, --namespace NAMESPACE
                        Namespace prefix to highlight (e.g. -n sds -n ini_ -n
                        parg_). Can be specified multiple times.
  -o, --output OUTPUT   Output file (default: stdout)
  -v, -V, --version     show program's version number and exit