/netbox-labs:build-pluginfrom netbox-labs
Scaffolds a new NetBox plugin with standard project structure, including PluginConfig, models, views, API, forms, and packaging.
Ships in netbox-labs. Installing the plugin adds it to Claude Code.
Guide the user through scaffolding a new NetBox plugin. Reference the netbox-plugin-development skill for detailed implementation patterns.
Ask the user:
netbox-my-plugin)4.5.0–4.7.99; note 4.5 = Django 5.2, 4.6 = Django 6.0, 4.7 = Django 6.1)netbox-my-plugin/
├── netbox_my_plugin/
│ ├── __init__.py # PluginConfig class
│ ├── models.py # Django models
│ ├── views.py # UI views
│ ├── api/
│ │ ├── __init__.py
│ │ ├── serializers.py # DRF serializers
│ │ ├── views.py # API viewsets
│ │ └── urls.py # API URL routing
│ ├── forms.py # Django forms
│ ├── filtersets.py # Filtering logic
│ ├── tables.py # django-tables2 table classes
│ ├── urls.py # UI URL routing
│ ├── navigation.py # Menu items
│ ├── templates/
│ │ └── netbox_my_plugin/ # Template files
│ └── migrations/
│ └── __init__.py
├── pyproject.toml # packaging + "netbox.plugins" entry point
├── MANIFEST.in
└── README.md
from netbox.plugins import PluginConfig
class MyPluginConfig(PluginConfig):
name = 'netbox_my_plugin'
verbose_name = 'My Plugin'
description = 'Description of what this plugin does'
version = '0.1.0'
base_url = 'my-plugin'
min_version = '4.5.0' # bump to '4.7.0' if the plugin uses 4.7-only APIs
max_version = '4.7.99' # .99 so patch releases are accepted
config = MyPluginConfig # must be a module-level variable named `config`
pyproject.toml — do not list netbox as a dependency (NetBox is on PyPI since 4.7; pip would
install a second copy into the venv). Version compatibility is declared by min_version/max_version:
[project]
name = "netbox-my-plugin"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = []
[project.entry-points."netbox.plugins"]
netbox_my_plugin = "netbox_my_plugin:config"
| Need | Approach | Key Files |
|---|---|---|
| New data model | Django model + migration | models.py, migrations/ |
| Custom UI pages | Views + templates | views.py, templates/ |
| REST API endpoints | DRF viewsets | api/views.py, api/serializers.py |
| Navigation menu items | PluginMenuItem | navigation.py |
| Background processing | NetBox Job framework | jobs.py |
| Template extensions | TemplateExtension class | template_content.py |
| Custom validators | Validator classes | validators.py |
| Custom event rule action types (4.7+) | EventRuleAction subclass | event_rules.py |
| Jinja filters / context for config templates (4.7+) | filters dict, get_jinja_context() | jinja_env.py, __init__.py |
| Fields/filters on core GraphQL types (4.7+) | Type/filter extension classes | graphql_extensions.py |
# Development install
pip install -e .
# Add to NetBox configuration.py
PLUGINS = ['netbox_my_plugin']
# Run migrations
cd /opt/netbox/netbox
python manage.py migrate
# Restart services
sudo systemctl restart netbox netbox-rq
For detailed implementation patterns (model mixins, API serializers, testing, packaging), load the netbox-plugin-development skill.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
2 commands in this plugin
npx claudepluginhub netboxlabs/skills --plugin netbox-labsOther plugins' commands for the same job