Doca Argp
NVIDIAOfficialCreated by NVIDIA
- Skill
- Tool integration
- Software development
- Apache-2.0
- Medium risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides technical guidance for developers working with the DOCA Arg Parser library. It covers the lifecycle management of CLI parameters, including registration, initialization, and destruction, as well as the use of standard DOCA flags and JSON configuration files. It is designed for developers modifying existing DOCA samples or building new applications that require a consistent CLI interface. The skill includes debugging support for common Arg Parser errors and ensures proper integration with the DOCA SDK environment.
What it does
- Guides the registration and lifecycle management of CLI parameters using doca_argp.
- Provides instructions for integrating standard DOCA flags and JSON configuration files.
- Offers debugging strategies for common Arg Parser errors like BAD_STATE or INVALID_VALUE.
- Ensures consistent CLI behavior across DOCA-using applications.
- Assists in verifying the presence and version of the doca-argp library via pkg-config.
When to use it
- When adding, removing, or renaming CLI flags in a DOCA-based application.
- When wiring the doca_argp initialization and destruction lifecycle in a main() function.
- When troubleshooting parameter registration order or type-mismatch errors.
- When implementing JSON-based configuration for complex CLI inputs.
- When ensuring a new application adheres to the standard DOCA CLI surface.
Advantages
- Maintains consistency with standard DOCA CLI patterns.
- Reduces development time by providing clear lifecycle and registration workflows.
- Helps avoid common pitfalls like incorrect parameter registration order.
- Provides a structured approach to debugging library-specific errors.
- Integrates seamlessly with existing DOCA sample code structures.
Usage examples
- “How do I add a custom flag to a DOCA sample?”
- The agent provides the steps to register a typed parameter using doca_argp_param_set_* before calling doca_argp_start, ensuring the sample retains its standard CLI flags.
- “Why does doca_argp_param_set_* return BAD_STATE?”
- The agent explains the lifecycle requirement, confirming if the registration call was made after doca_argp_start, and provides the correct initialization order.
- “Can I drive a sample from a JSON file?”
- The agent guides the user on utilizing the --json flag to point to a configuration file, avoiding the need for long command-line arguments.
- “My --my-flag value is rejected as INVALID_VALUE.”
- The agent helps verify the parameter type declaration against the provided value, ensuring it matches the expected DOCA_ARGP_TYPE enum.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/nvidia/doca-argp/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip doca-argp.zip -d .agents/skills
Documentation by NVIDIA
DOCA Arg Parser
Examples
"Add a custom flag to a DOCA sample." — this is in scope. Register a typed
doca_argpparam; do not drop to getopt."BAD_STATE registering a new param." — check init → register → start order before changing the flag type.
Instructions
Follow Loading order below. Open the tasks companion for configure / register / debug. Open the capabilities companion for the public param types. Do not open every companion file.
Where to start: This skill assumes DOCA is already installed
and the user is doing hands-on CLI work on a DOCA sample or
new DOCA-using app. Open the tasks companion if the user wants
to do something (configure / build / modify / run / test /
debug); open the capabilities companion when the
question is what can the Arg Parser express on this version. If
the user has not installed DOCA yet, route to
doca-setup/SKILL.md first. If the user is
about to rewrite a sample's CLI with getopt / argparse /
custom parsing instead of reusing the Arg Parser, read the
load-bearing rule in
the capabilities companion
before any code change.
Example questions this skill answers well
The CLASSES of Arg Parser questions this skill is built to answer, each with one worked example. The agent should treat the class as the load-bearing piece — the worked example is a single instance.
"How do I add a new flag to a DOCA sample without breaking the standard CLI?" — worked example: "add
--my-flagto/opt/mellanox/doca/samples/doca_dma/dma_local_copy/so the sample still accepts--device <PCI>and--sdk-log-level <level>the same way it did before". Answered by the reuse-the-Arg-Parser rule in the capabilities companionthe register-before-start workflow in the tasks companion.
"Why does
doca_argp_param_set_*returnBAD_STATEon my second call?" — worked example: "registering a new param afterdoca_argp_starthas already parsed argv". Answered by the lifecycle order in the capabilities companionthe error-taxonomy row in the capabilities companion for
DOCA_ERROR_BAD_STATE.
"Can I drive a sample from a JSON file instead of a long command line?" — worked example: "point a sample at
./my-config.jsonso the operator does not have to type out ten flags every time". Answered by the--json <path>integration in the capabilities companionthe JSON-config-file workflow in the tasks companion and the tasks companion.
"My
--my-flag Xvalue is rejected asINVALID_VALUE— why?" — worked example: "declared the param asintbut passed--my-flag 0x40". Answered by the parameter-type table in the capabilities companionthe type-mismatch row in the capabilities companion.
"Is
doca-argpeven on my installed DOCA?" — worked example: "a colleague's sample mentions doca-argp but I want to confirm before I depend on it". Answered by the presenceversion-detection rule in the capabilities companion, which cross-links the canonical detection chain in
doca-version/SKILL.md.
"Should I use doca-argp here, or is this case actually outside its scope?" — worked example: "writing a host-side CLI tool that never calls a
doca_*symbol". Answered by the path-selection rule in the capabilities companion Use doca-argp when … / Do not use doca-argp when … bullets.
Audience
This skill serves external developers building or modifying
DOCA-using applications — i.e., users whose code already calls
doca_* (directly in C/C++, or through FFI/bindings from
another language) and who need the standard DOCA CLI surface so
operators of the resulting binary do not have to relearn how to
invoke each sample. It is not for NVIDIA developers
contributing to the Arg Parser library itself.
Language scope. DOCA Arg Parser ships as a C library with
pkg-config module name doca-argp. The shipped samples are
written in C. C and C++ consumers are the canonical case; the
worked examples in the tasks companion assume that path. Other-language
consumers (Rust, Go, Python, …) consume the same *.so through
FFI or language-specific bindings; the skill's contribution in
that case is to keep the lifecycle, parameter-type, JSON-config,
standard-flag-surface, and error-taxonomy guidance
language-neutral, and to route the agent to the public C ABI as
the authoritative surface that any wrapper will eventually call.
When to load this skill
Load this skill when the user is doing hands-on DOCA Arg Parser work, in any language. Concretely:
Adding, removing, or renaming a CLI flag on a shipped DOCA sample or on a new app that wants to share the standard DOCA CLI surface (
--device <PCI>,--representor <name>,--rep-list,--json <path>,--sdk-log-level <level>).Wiring
doca_argp_init/doca_argp_start/doca_argp_destroyinto amain(), including the register-before-start lifecycle and the cleanup-on-exit contract.Registering a
doca_argp_param(short name, long name, value callback, description for--help) with a parameter type drawn from the six-value public enum: string, int, boolean, device, device representor, or double. A JSON config file is an input surface for those parameters, not a parameter type.Reading complex configurations from a JSON file via the shared
--json <path>flag instead of expanding the command line.Confirming the build- and runtime-side Arg Parser version on the user's install (
pkg-config --exists doca-argp,pkg-config --modversion doca-argp) before depending on it.Debugging a
DOCA_ERROR_*returned from adoca_argp_*call (lifecycle vs. type-mismatch vs. unknown JSON key vs. unreadable file).Designing or extending non-C bindings (Rust, Go, Python, …) that wrap the Arg Parser C ABI — for the lifecycle, parameter-type, JSON-config, and standard-flag rules the wrapper must honor.
Do not load this skill for general DOCA orientation, install
of DOCA itself, or non-Arg-Parser library questions. For those,
use
doca-public-knowledge-map/SKILL.md.
What this skill provides
This is a thin loader. The body keeps only the orientation needed to pick the right next file. The substantive Arg-Parser-specific material lives in two companion files:
the capabilities companion — what the Arg Parser can express on this version: the param-registration model, the small set of public parameter types, the standard DOCA CLI surface every sample shares, the
--json <path>file integration, the register-before-start lifecycle, the Arg Parser error taxonomy (mapped onto the cross-libraryDOCA_ERROR_*set), the observability surface (the--helpoutput and the DOCA Log channel), and the safety / path-selection policy (when reusing doca-argp is mandatory; when a language-native parser is the right answer).the tasks companion — step-by-step workflows for the six in-scope Arg Parser verbs:
configure,build,modify,run,test,debug. Plus aDeferred task verbsblock that points out-of-scope questions at the right next skill.
The skill assumes a host or BlueField where DOCA is already
installed at the standard location. It does not cover installing
DOCA — that path goes through
doca-setup/SKILL.md.
What this skill deliberately does not ship
This skill is agent guidance, not a samples or templates bundle. To keep the boundary clean, it deliberately does not contain — and pull requests should not add:
Pre-written DOCA Arg Parser usage code, in any language. The verified Arg Parser usage is the
*_main.cfile in every shipped DOCA sample at/opt/mellanox/doca/samples/<library>/<sample>/. The agent's job is to route the user to that file and prescribe a minimum-diff modification on it via the universal modify-a-sample workflow indoca-programming-guide/SKILL.md, layered with the Arg-Parser-specific overrides in the tasks companion.Standalone build manifests (
meson.build,CMakeLists.txt,Cargo.toml, …) parked inside the skill. The agent constructs the build manifest in the user's project directory against the user's installed DOCA, wherepkg-config --modversion doca-argpis the source of truth.A
samples/,bindings/, orreference/subtree of any kind. A mock or incomplete artifact in this skill's tree, even one labeled "reference", is misleading: users will read it as buildable.
Loading order
Read this skill first to confirm the user's question is in scope.
For the param-registration model, parameter types, the standard DOCA CLI surface, the
--json <path>rule, the register-before-start lifecycle, error taxonomy, observability, and the path-selection / safety policy, see the capabilities companion.For step-by-step workflows — configure, build, modify, run, test, debug — see the tasks companion.
Both companion files cross-link to each other,
doca-version/SKILL.md for the canonical
version-handling rules, and
doca-public-knowledge-map/SKILL.md
whenever the right answer is "look it up in the public docs or
the installed package layout" rather than "Arg-Parser-specific
guidance".
Related skills
doca-public-knowledge-map/SKILL.md— the routing table for every public DOCA documentation source and the on-disk layout of an installed DOCA package. The Arg Parser URL ishttps://docs.nvidia.com/doca/sdk/DOCA-Arg-Parser/index.html; the canonical on-disk usage example is any sample's*_main.cunder/opt/mellanox/doca/samples/.doca-setup/SKILL.md— env preparation, install verification, and the I have no install yet path with the public NGC DOCA container. This skill assumes its preconditions are satisfied.doca-version/SKILL.md— canonical DOCA version-handling rules. This skill's## Version compatibilitycross-links the four-way match rule and adds the Arg-Parser-specific presence-check overlay.doca-structured-tools-contract/SKILL.md— the bundle's structured-tools precedence rule (detect / prefer / fall back / report). The Command appendix in the tasks companion honors this contract.doca-programming-guide/SKILL.md— general DOCA programming patterns shared by every library: the canonicalpkg-config+ meson build pattern, the universal modify-a-shipped-sample first-app workflow, the universal lifecycle, the cross-libraryDOCA_ERROR_*taxonomy, and the program-side debug order. This skill layers Arg-Parser specifics on top.doca-debug/SKILL.md— the cross-cutting debug ladder (install / version / build / link / runtime / program / driver). Arg-Parser-specific debug (lifecycle violations, type-mismatch on a registered param, unknown JSON key) overlays on top of that ladder.
Files
- ATTRIBUTION.mdAdded by AutoGineer885 B
- BENCHMARK.md9.9 KiB
- CAPABILITIES.md20.2 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md12.2 KiB
- SKILLCARD.yaml2.7 KiB
- TASKS.md24.5 KiB
- evals/evals.json3.0 KiB
- skill-card.md4.8 KiB
- skill.oms.sig5.1 KiB
CAPABILITIES.md
DOCA Arg Parser capabilities, version overlay, errors, observability, safety
Where to start: Pick the H2 anchor that matches your question (param model / parameter types / standard CLI surface / JSON config / version / errors / safety) and read that section end-to-end. The tables in each section are the load-bearing content; the prose around them is interpretation.
Read this file when the loader sent you here from
SKILL.md. For the how of executing each pattern
(the verbs configure / build / modify / run / test / debug),
jump to TASKS.md. For the canonical DOCA
version-handling rules that this skill layers an Arg-Parser
overlay on top of, see
doca-version/SKILL.md.
Pattern overview
Every Arg Parser question this skill teaches resolves into one of FIVE patterns. The patterns are CLASSES — they apply across every DOCA release and every sample, not just the worked examples shown.
| Pattern | When it applies (class shape) | Where the substance lives |
|---|---|---|
| 1. Reuse, do not rewrite | The user is modifying a shipped DOCA sample's CLI (adding / removing / renaming a flag) and is tempted to swap the Arg Parser for getopt / argparse / hand-rolled parsing | ## Capabilities and modes reuse rule + TASKS.md ## modify |
| 2. Register before start | New params are registered against the Arg Parser instance BEFORE doca_argp_start parses argv; registering after parse is the most common first-app failure | ## Capabilities and modes lifecycle table + TASKS.md ## configure |
| 3. Pick the parameter type | Choose from the six-value public enum (string, int, boolean, device, device representor, double); JSON config is a separate input surface, not a type | ## Capabilities and modes parameter-type table + TASKS.md ## modify |
| 4. Inherit the standard CLI surface | Keep --device, --representor, --rep-list, --json (-j), --sdk-log-level working the same way they do in the sibling samples; users learn one CLI for all of DOCA | ## Capabilities and modes standard-surface table + TASKS.md ## modify |
| 5. Diagnose an Arg Parser error | Map symptom (BAD_STATE, INVALID_VALUE, NOT_SUPPORTED, IO_FAILED) to root cause without leaving the Arg Parser layer prematurely | ## Error taxonomy + TASKS.md ## debug |
Two cross-cutting rules that apply to every pattern above:
The shipped sample's
*_main.cis the canonical reference, every time. doca-argp does not ship its own dedicated sample tree; instead, every DOCA sample's*_main.c(under/opt/mellanox/doca/samples/<library>/<sample>/) is a working, version-matched Arg Parser usage. Quote the installed file, not a remembered API shape.The standard CLI surface is the user's mental model, not a stylistic preference. When a user invokes any DOCA sample, they expect
--device,--representor(or--rep-list),--json(-j), and--sdk-log-levelto behave the same way as in the sibling samples. Adding a flag on top of that surface is fine; replacing the surface breaks the cross-sample mental model and is a regression.
Capabilities and modes
DOCA Arg Parser is a small, foundational CPU-side library. It has no hardware accelerator behind it, no DOCA Core context, and no progress engine — it owns parsing, not execution. On top of that small surface, it layers a param-registration lifecycle, a small parameter-type set, the shared DOCA standard flag surface, and the JSON-config file integration.
The Arg Parser lifecycle. Every consumer follows the same register-before-start order. The agent must not invent steps; the public surface is closed.
| Step | Call | What it does | Order constraint |
|---|---|---|---|
| Init | doca_argp_init(<program-name>, <user-config>) | Creates the per-process Arg Parser instance; allocates the default standard-flag set | Must be the FIRST doca_argp_* call in the program |
| Register | doca_argp_param_create → doca_argp_param_set_* (short name, long name, value-callback, description, type) → doca_argp_register_param | Adds one doca_argp_param to the instance for each app-specific flag | Must happen AFTER doca_argp_init and BEFORE doca_argp_start; registration after start returns BAD_STATE |
| Start (parse) | doca_argp_start(argc, argv) | Walks argv (and any --json <path> / -j <path> file), calls each matching param's value-callback with the parsed value, fails fast on the first invalid value | Runs ONCE per process; a second _start returns BAD_STATE |
| Destroy | doca_argp_destroy() | Frees the per-process instance and every registered doca_argp_param | Should pair with _init on every exit path, including error paths |
Parameter types. The full public enum doca_argp_type the Arg
Parser exposes. Picking the right one is what makes argv
validation and JSON-config validation Just Work. The enum has
six real values (DOCA_ARGP_TYPE_STRING,
DOCA_ARGP_TYPE_INT, DOCA_ARGP_TYPE_BOOLEAN,
DOCA_ARGP_TYPE_DEVICE, DOCA_ARGP_TYPE_DEVICE_REP,
DOCA_ARGP_TYPE_DOUBLE) — do not silently omit the latter three.
| Type (enum) | Argv shape | JSON shape | Typical use |
|---|---|---|---|
DOCA_ARGP_TYPE_STRING | --my-flag VALUE | "my-flag": "VALUE" | File paths, free-form strings |
DOCA_ARGP_TYPE_INT | --my-flag 1234 | "my-flag": 1234 | Queue depth, message size cap, max-num-tasks |
DOCA_ARGP_TYPE_BOOLEAN | --my-flag (presence sets true) | "my-flag": true | Enable a code path that is off by default |
DOCA_ARGP_TYPE_DEVICE | --my-flag pci/<BDF>[,devargs] | "my-flag": {"type": "pci", "identifier": "<BDF>"} (optional "devargs") | A device flag whose value the Arg Parser opens as a doca_dev for you (e.g. --device pci/0000:03:00.0) — preferred over hand-rolling the device open via DOCA_ARGP_TYPE_STRING |
DOCA_ARGP_TYPE_DEVICE_REP | --my-flag pci/<BDF>,<rep>[,devargs] | "my-flag": {"type": "pci", "identifier": "<BDF>,<rep>"} (optional "devargs") | A representor flag whose value the Arg Parser opens as a doca_dev_rep for you (e.g. --representor pci/08:00.0,pf0vf1) — DPU-side counterpart to _TYPE_DEVICE |
DOCA_ARGP_TYPE_DOUBLE | --my-flag 12.5 | "my-flag": 12.5 | Floating-point knobs (e.g. timeouts in seconds, fractional caps) |
| JSON config file (special, not a type) | --json /path/to/file.json (or -j) | n/a (this IS the JSON file) | Drive any of the above from a file instead of expanding argv. The real flag is --json / -j, NOT --json-config — do not invent the longer name. |
The standard DOCA CLI surface. doca_argp_init registers a fixed
set of built-in DOCA flags (printed under "DOCA Flags" by --help) so
the user learns ONE CLI for all of DOCA. Device / representor flags
(e.g. --device, --representor) are NOT built-in: each program
registers its own, typically as DOCA_ARGP_TYPE_DEVICE / _DEVICE_REP
(syntax pci/<BDF>[,devargs]; representor pci/<BDF>,pf0vf1).
Modifications must preserve this surface.
| Flag | Value type | Meaning |
|---|---|---|
-h / --help | Bool flag | Print the help synopsis (DOCA Flags + Program Flags) and exit |
-v / --version | Bool flag | Print program version information and exit |
-l <N> / --log-level <N> | Numeric level: 10=DISABLE, 20=CRITICAL, 30=ERROR, 40=WARNING, 50=INFO, 60=DEBUG, 70=TRACE | Set the program (app-side) DOCA Log level for this run |
--json <path> / -j <path> | String (path to a JSON file) | Read parameter values from a JSON file instead of expanding argv. The flag is registered as --json (-j) by the library itself (the public registration entry point is doca_argp_register_param); there is no --json-config flag. |
--sdk-log-level <N> | Numeric level, same 10-70 scale (e.g. 60 = DEBUG) | Set the SDK-side DOCA Log threshold for this run |
--log-filter <list> | String (comma-separated module names) | Filter logs from specific modules |
JSON-config integration. The --json <path> flag (also
short-form -j <path>; the long name is --json, NOT
--json-config) is not optional cosmetic detail — shipped
samples with non-trivial configurations expect operators to
drive them from a file (the command line becomes unreadable
past ~5 flags). The JSON keys match the registered long names;
the JSON value types match the registered parameter types; an
unknown JSON key fails with DOCA_ERROR_NOT_SUPPORTED (pedantic parsing) per
## Error taxonomy.
Path selection — when doca-argp is the right answer. This is a small library, but its scope is sharp. Walk this rule before recommending the Arg Parser path.
| Use doca-argp when … | Do not use doca-argp when … |
|---|---|
| Modifying a shipped DOCA sample's CLI (add / remove / rename a flag) — reusing the Arg Parser keeps the sample's CLI consistent with every sibling sample | The program never calls a doca_* symbol — there is no DOCA-side interaction to begin with, so a language-native CLI parser is the right answer (and avoids dragging in libdoca-argp for no benefit) |
Building a new DOCA-using app that wants operators to learn the standard --device / --representor / --json (-j) / --sdk-log-level CLI conventions instead of inventing a fresh one | The user genuinely needs a POSIX getopt feature the Arg Parser does not cover (e.g. optional-argument optional-value forms) — and is willing to accept the cost of breaking sample-CLI consistency for that specific need; even then, prefer layering doca-argp + the extra parser, not replacing it |
Driving a complex configuration from a JSON file (--json <path> / -j <path>) — the file format and key validation come for free | The CLI surface is interactive (REPL, prompt loop) — that is not what an arg parser is for; reach for a TUI / REPL library instead |
Version compatibility
For the canonical DOCA version-detection chain, the four-way
match rule, NGC container semantics, and the
headers-win-over-docs rule, see
doca-version/SKILL.md. The body lives
there; this skill does not duplicate it.
The Arg-Parser-specific overlay is:
Presence is the first check; version is the second. doca-argp is a small, foundational library — agents tend to assume it is always present. It is not always installed in every package profile. Use
pkg-config --exists doca-argpfor the presence check FIRST, thenpkg-config --modversion doca-argpfor the version. Per the cross-cutting rule indoca-version CAPABILITIES.md ## Observability(doca-version/CAPABILITIES.md#observability), the build-timepkg-configvalue is the authority for "is this library available for me to link against?".doca-argp.pcanddoca-common.pcmust both matchdoca_caps --versionat the four-way-match check (perdoca-version CAPABILITIES.md ## Version compatibility(doca-version/CAPABILITIES.md#version-compatibility)). A common partial-install pattern after a DOCA upgrade is thatdoca-argp.pclingers from the previous release; route todoca-version TASKS.md ## debug(doca-version/TASKS.md#debug) layer 2 before any Arg-Parser-layer diagnosis.Headers in $(pkg-config --variable=includedir doca-common) win over public docs. Per the headers-win-over-docs rule in
doca-version/SKILL.md, if a public Arg Parser doc page mentions adoca_argp_*symbol that is not in the installeddoca_argp.h, the headers describe what this install can call; the docs describe what some release shipped. The agent must quote the headers, not the docs URL, when the two disagree.
Error taxonomy
Arg-Parser-specific overlays on the cross-library
DOCA_ERROR_* taxonomy. The cross-library taxonomy itself
lives in
doca-programming-guide CAPABILITIES.md ## Error taxonomy (doca-programming-guide/CAPABILITIES.md#error-taxonomy);
the rows below are the Arg Parser surface meaning that the
agent must disambiguate before falling back to the
cross-library response.
| Error | Arg Parser context where it shows up | Arg-Parser-specific cause |
|---|---|---|
DOCA_ERROR_BAD_STATE | doca_argp_register_param after doca_argp_start; a second doca_argp_start in the same process; any doca_argp_* call after doca_argp_destroy | Lifecycle violation. Walk the lifecycle table in ## Capabilities and modes; the most common case is the program registering an extra param inside the value-callback of another param (i.e. during _start, not before). |
DOCA_ERROR_INVALID_VALUE | doca_argp_start when an argv value (or JSON-config value) does not match the registered param's declared type | Type mismatch. Re-check the registered type vs. the value the user is passing (e.g. param declared as int but operator wrote --my-flag 0x40). The fix is on the declaration side OR the operator side, not a retry. |
DOCA_ERROR_NOT_SUPPORTED | doca_argp_start when a JSON-config key is not the long name of any registered param (pedantic parsing rejects the unknown field) | The JSON file references a flag the program never registered. Either the key is a typo, or the program is older than the JSON config it is being fed. Diff the registered long names against the JSON keys. |
DOCA_ERROR_IO_FAILED | doca_argp_start when --json <path> (or -j <path>) points at a file the process cannot open or read | File-system failure (missing path, wrong permission, JSON syntax error). Resolve at the OS layer (ls -l <path>; cat <path> | jq .) before any code change. |
DOCA_ERROR_NOT_SUPPORTED (operator-side) | doca_argp_start against argv containing an unknown long / short name (an unsupported program flag, per the doca_argp_start doc in doca_argp.h) | The operator passed a flag the program never registered. The fix is on the operator side; the program may surface its own --help listing all registered params via the per-param descriptions. |
The agent's rule: never recommend a retry loop on a
doca_argp_* DOCA_ERROR_*. Every row above is an
authoring or operator mistake, not a transient state — the fix
is to correct the call site, the registration, the JSON key, or
the file path, not to retry.
Observability
The Arg Parser's observability surface is small but
load-bearing: the program's own --help output (synthesized
from the registered param descriptions) is what the operator
reads, and DOCA Log is what the program emits at parse time.
Three primary signals the agent should reach for:
The
--helpoutput. Every Arg Parser instance auto-generates a--helplisting fromdoca_argp_init's default standard flags plus every registered param's description. The agent should ask the user to run./<binary> --helpbefore any other debug step — if the new flag is not listed, registration never happened; if the standard flags are not listed,doca_argp_initwas skipped.The parsed-value callback fires. Each registered
doca_argp_param's value-callback runs once per matched flag (argv or JSON-config). A param that registers cleanly but whose callback never fires means the operator never passed the flag — not that the library dropped it. Add a one-line log inside the callback before assuming a parser bug.DOCA Log lines from the Arg Parser layer. Per the cross-cutting observability primitives (
DOCA_LOG_LEVEL=trace,--sdk-log-level, the trace build flavor) indoca-debug CAPABILITIES.md ## Observability(doca-debug/CAPABILITIES.md#observability), the Arg Parser routes its own messages through DOCA Log; a trace-level run shows the per-param parse calls and the JSON-config file read.
For the install-tree observability (logger names, package
layout) defer to
doca-public-knowledge-map/SKILL.md.
Safety policy
Overlay on the bundle-wide hardware-safety meta-policy. The rules below are this skill's per-artifact overlay on the cross-cutting rules in
doca-hardware-safetyCAPABILITIES.md ## Safety policy (doca-hardware-safety/CAPABILITIES.md#safety-policy) (specifically ### Per-artifact overlay pattern (doca-hardware-safety/CAPABILITIES.md#per-artifact-overlay-pattern)). When the two layers disagree, the stricter wins; when either layer says STOP, the agent stops.
The Arg Parser's safety surface is lower-stakes than most DOCA
libraries for string, integer, boolean, and double parameters: that
parsing runs in the user's process and holds no kernel-side resources.
DOCA_ARGP_TYPE_DEVICE and DOCA_ARGP_TYPE_DEVICE_REP are different:
the parser opens the selected doca_dev or doca_dev_rep handle and
can fail on device visibility or permissions. Opening a handle is not
itself a hardware-state mutation, but the agent must identify the
target and surface those access failures. If the callback or
downstream workflow uses that handle for a state change, load
doca-hardware-safety and apply its stricter gate before that change.
The load-bearing safety rule is structural, not access-control
shaped: when modifying a shipped DOCA sample's CLI, reuse the
Arg Parser; do not replace it with getopt / argparse /
hand-rolled parsing. The reasons this is a safety rule, not
a stylistic preference:
Cross-sample CLI consistency is a user contract. Operators of DOCA samples carry mental models across libraries (
--device,--representor,--json/-j,--sdk-log-levelbehave the same in every sample). A modified sample that silently breaks that contract becomes a trap for operators and a debugging time-sink that looks like a library bug.--json <path>(-j <path>) is shared infrastructure (the long name is--json, NOT--json-config). Sample CI, sample documentation, and operator runbooks all assume the JSON-config path works. A hand-rolled parser drops the JSON path silently;--helpstill looks right; the failure surface is "my JSON file is ignored", which the operator has no obvious place to file against.Lifecycle violations are caught only when doca-argp owns parsing. The
BAD_STATE/INVALID_VALUE/NOT_SUPPORTED/IO_FAILEDladder in## Error taxonomyonly fires when the program goes throughdoca_argp_*— a hand-rolled parser re-creates this ladder by accident, badly.
The narrow exception (path-selection rule in
## Capabilities and modes): when
the program never calls a doca_* symbol at all, doca-argp is
not the right tool — a language-native parser is — and pulling
in libdoca-argp adds a build-time dependency for no agent or
user benefit. The agent must distinguish "DOCA-using app
modifying its CLI" (reuse mandatory) from "non-DOCA CLI
tool" (language-native parser is correct).
Deferred topic boundaries
This skill scopes itself to the DOCA Arg Parser library. Adjacent topics the agent will get asked but should route elsewhere:
Generic CLI-parser feature requests (variadic flags, subcommand routing, shell-completion generation) — outside this skill. The Arg Parser exposes a deliberately small public surface; route the user to a language-native parser layered on top if a feature is genuinely required.
DOCA Core context, progress engine, and
doca_mmapinternals — owned bydoca-programming-guide/SKILL.md. Arg Parser is upstream of the Core context (it parses the CLI that selects which device the Core context will open); it does not redefine the Core context.DOCA Log internals (registry names, per-source level filters) — owned by the public DOCA Log guide reachable through
doca-public-knowledge-map/SKILL.md. Arg Parser registers--sdk-log-levelas a default flag but does not own the log layer it configures.Cross-cutting
DOCA_ERROR_*taxonomy — owned bydoca-programming-guide CAPABILITIES.md ## Error taxonomy(doca-programming-guide/CAPABILITIES.md#error-taxonomy). This skill adds the Arg Parser overlay, not the taxonomy itself.Cross-cutting debug ladder (install / version / build / link / runtime / program / driver) — owned by
doca-debug ## debug(doca-debug/TASKS.md#debug). This skill's## debugoverlays the program layer.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
The author says: Requires DOCA SDK installed at /opt/mellanox/doca on Linux (Ubuntu 22.04/24.04 or RHEL/SLES) with a BlueField DPU or ConnectX NIC attached. Reads the user's local install via `pkg-config doca-argp` and inspects /opt/mellanox/doca/{lib,include,samples,applications}. The validation steps require a live DOCA install.
Security
What our scanner noticed· Medium risk
- Large base64-encoded blobs
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- NVIDIA
- Publisher
- NVIDIA (Official)
- Source
- NVIDIA/skills · skills/doca-argp · commit fce3cca
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE-APACHE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by NVIDIA.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download doca-argp.zip