Generic resource actions
A NetBox CLI for humans and AI agents. Single static binary, schema-driven typed flags, versioned JSON output envelope, agent skill files.
npx -y skills add Hebbian-Robotics/nbx --skill generic-resource-actionsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Shared CRUD pattern for NetBox resources whose entire CLI surface is generated from the OpenAPI schema.
SKILL.md
3.2 KB, 804 tokens by cl100k_base, as published. Nobody here has run it
nbx Generic Resource Actions
Purpose
A single skill covering the resources whose CLI surface is generated wholesale from the NetBox OpenAPI schema. They share one CRUD pattern (list / get / create / update / delete / bulk-update / bulk-delete) and one set of conventions for typed flags, FK resolution, and --data escape-hatching.
Covered resources:
- DCIM:
cables,device-roles,device-types,inventory-items,locations,manufacturers,platforms,racks,regions,site-groups,sites - Extras:
tags - IPAM:
aggregates,ip-addresses,rirs,roles,vlan-groups,vlans,vrfs - Tenancy:
tenant-groups,tenants
dcim devices, dcim interfaces, and ipam prefixes use the same generated typed flags but add hand-written extensions on top — they have dedicated skills (dcim-devices, dcim-interfaces, ipam-prefixes).
When to use which action
list— find by typed filters (--name,--tag, etc.) or arbitrary--query 'key=value'for unsurfaced filters.--page-allstreams every page as NDJSON.get <id-or-lookup>— fetch by numeric ID or by the resource's default lookup field. Common defaults:slugfor named reference objects,namefor racks/VLANs/VRFs,addressfor IP addresses,prefixfor aggregates/prefixes.create— typed flags for every property in the resource'sWritable<X>Requestschema. Required schema fields are required clap flags.update <id-or-lookup>— same flag set ascreate, all optional. PATCH semantics.delete <id-or-lookup> --confirm— DELETE.bulk-update --data <json-array>/bulk-delete --data <json-array> --confirm— array payload by numericid.
Key behaviors
- Foreign-key name resolution. Typed FK flags accept slug or name (resolved at runtime via the NetBox lookup endpoint declared in
FK_RESOLVERS) or a numeric ID directly. --data/--data-fileescape hatch. Available on every mutation for fields the codegen does not surface (custom_fields, complex array shapes, tagobject_types, cable terminations, etc.). Typed flags merge into and override--datawhen both supply the same field.--tags <csv>. Comma-separated tag slugs; nbx converts the CSV to NetBox's[{"slug": "..."}]shape.--dry-run. Prints the resolved request without sending.- Default lookups vary by resource. Use
--lookup-field <field>to override (e.g. on a resource where the default isslugbut you want to look up byname).
Discovering flags and output
Run nbx <app> <resource> --help and nbx <app> <resource> <action> --help for the authoritative flag list, enum values ([possible values: ...]), and required/optional markers. Each resource has its own typed flag set derived from its schema. Run mutations with --dry-run to preview.
Errors
- exit 1
general— network failure or unexpected NetBox response. - exit 2
not_found— resource or referenced FK not found. - exit 3
auth_failed— token rejected. - exit 4
validation_error— required field missing, FK name resolves to multiple IDs, or NetBox 4xx body.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.