netbox-sdk 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. netbox_sdk-0.0.3/LICENSE.txt +177 -0
  2. netbox_sdk-0.0.3/PKG-INFO +230 -0
  3. netbox_sdk-0.0.3/README.md +183 -0
  4. netbox_sdk-0.0.3/netbox_cli/__init__.py +4 -0
  5. netbox_sdk-0.0.3/netbox_cli/api.py +356 -0
  6. netbox_sdk-0.0.3/netbox_cli/cli/__init__.py +509 -0
  7. netbox_sdk-0.0.3/netbox_cli/cli/demo.py +543 -0
  8. netbox_sdk-0.0.3/netbox_cli/cli/dev.py +694 -0
  9. netbox_sdk-0.0.3/netbox_cli/cli/django_model.py +178 -0
  10. netbox_sdk-0.0.3/netbox_cli/cli/dynamic.py +485 -0
  11. netbox_sdk-0.0.3/netbox_cli/cli/runtime.py +178 -0
  12. netbox_sdk-0.0.3/netbox_cli/cli/support.py +380 -0
  13. netbox_sdk-0.0.3/netbox_cli/config.py +236 -0
  14. netbox_sdk-0.0.3/netbox_cli/demo_auth.py +219 -0
  15. netbox_sdk-0.0.3/netbox_cli/dev_tui.py +17 -0
  16. netbox_sdk-0.0.3/netbox_cli/dev_tui.tcss +664 -0
  17. netbox_sdk-0.0.3/netbox_cli/django_model_tui.tcss +165 -0
  18. netbox_sdk-0.0.3/netbox_cli/django_models/__init__.py +8 -0
  19. netbox_sdk-0.0.3/netbox_cli/django_models/diagram.py +199 -0
  20. netbox_sdk-0.0.3/netbox_cli/django_models/fetcher.py +239 -0
  21. netbox_sdk-0.0.3/netbox_cli/django_models/parser.py +284 -0
  22. netbox_sdk-0.0.3/netbox_cli/django_models/rich_rendering.py +571 -0
  23. netbox_sdk-0.0.3/netbox_cli/django_models/store.py +124 -0
  24. netbox_sdk-0.0.3/netbox_cli/docgen/__init__.py +16 -0
  25. netbox_sdk-0.0.3/netbox_cli/docgen/engine.py +410 -0
  26. netbox_sdk-0.0.3/netbox_cli/docgen/format.py +63 -0
  27. netbox_sdk-0.0.3/netbox_cli/docgen/models.py +156 -0
  28. netbox_sdk-0.0.3/netbox_cli/docgen/specs.py +27 -0
  29. netbox_sdk-0.0.3/netbox_cli/docgen_capture.py +277 -0
  30. netbox_sdk-0.0.3/netbox_cli/docgen_specs.py +394 -0
  31. netbox_sdk-0.0.3/netbox_cli/http_cache.py +139 -0
  32. netbox_sdk-0.0.3/netbox_cli/logging_runtime.py +170 -0
  33. netbox_sdk-0.0.3/netbox_cli/logs_tui.tcss +99 -0
  34. netbox_sdk-0.0.3/netbox_cli/markdown_output.py +113 -0
  35. netbox_sdk-0.0.3/netbox_cli/output_safety.py +32 -0
  36. netbox_sdk-0.0.3/netbox_cli/reference/openapi/netbox-openapi.json +297606 -0
  37. netbox_sdk-0.0.3/netbox_cli/schema.py +343 -0
  38. netbox_sdk-0.0.3/netbox_cli/services.py +127 -0
  39. netbox_sdk-0.0.3/netbox_cli/theme_registry.py +258 -0
  40. netbox_sdk-0.0.3/netbox_cli/themes/dracula.json +39 -0
  41. netbox_sdk-0.0.3/netbox_cli/themes/netbox-dark.json +39 -0
  42. netbox_sdk-0.0.3/netbox_cli/themes/netbox-light.json +39 -0
  43. netbox_sdk-0.0.3/netbox_cli/themes/onedark-pro.json +39 -0
  44. netbox_sdk-0.0.3/netbox_cli/themes/tokyo-night.json +39 -0
  45. netbox_sdk-0.0.3/netbox_cli/trace_ascii.py +175 -0
  46. netbox_sdk-0.0.3/netbox_cli/tui.py +7 -0
  47. netbox_sdk-0.0.3/netbox_cli/tui.tcss +1006 -0
  48. netbox_sdk-0.0.3/netbox_cli/ui/__init__.py +22 -0
  49. netbox_sdk-0.0.3/netbox_cli/ui/app.py +1181 -0
  50. netbox_sdk-0.0.3/netbox_cli/ui/chrome.py +171 -0
  51. netbox_sdk-0.0.3/netbox_cli/ui/cli_completions.py +178 -0
  52. netbox_sdk-0.0.3/netbox_cli/ui/cli_tui.py +1194 -0
  53. netbox_sdk-0.0.3/netbox_cli/ui/dev_app.py +923 -0
  54. netbox_sdk-0.0.3/netbox_cli/ui/dev_rendering.py +133 -0
  55. netbox_sdk-0.0.3/netbox_cli/ui/dev_state.py +106 -0
  56. netbox_sdk-0.0.3/netbox_cli/ui/django_model_app.py +752 -0
  57. netbox_sdk-0.0.3/netbox_cli/ui/django_model_state.py +40 -0
  58. netbox_sdk-0.0.3/netbox_cli/ui/filter_overlay.py +324 -0
  59. netbox_sdk-0.0.3/netbox_cli/ui/formatting.py +356 -0
  60. netbox_sdk-0.0.3/netbox_cli/ui/logo_render.py +30 -0
  61. netbox_sdk-0.0.3/netbox_cli/ui/logs_app.py +219 -0
  62. netbox_sdk-0.0.3/netbox_cli/ui/nav_blueprint.py +383 -0
  63. netbox_sdk-0.0.3/netbox_cli/ui/navigation.py +99 -0
  64. netbox_sdk-0.0.3/netbox_cli/ui/panels.py +126 -0
  65. netbox_sdk-0.0.3/netbox_cli/ui/plugin_discovery.py +99 -0
  66. netbox_sdk-0.0.3/netbox_cli/ui/state.py +90 -0
  67. netbox_sdk-0.0.3/netbox_cli/ui/widgets.py +362 -0
  68. netbox_sdk-0.0.3/netbox_cli/ui_common.tcss +1444 -0
  69. netbox_sdk-0.0.3/netbox_sdk.egg-info/PKG-INFO +230 -0
  70. netbox_sdk-0.0.3/netbox_sdk.egg-info/SOURCES.txt +101 -0
  71. netbox_sdk-0.0.3/netbox_sdk.egg-info/dependency_links.txt +1 -0
  72. netbox_sdk-0.0.3/netbox_sdk.egg-info/entry_points.txt +2 -0
  73. netbox_sdk-0.0.3/netbox_sdk.egg-info/requires.txt +18 -0
  74. netbox_sdk-0.0.3/netbox_sdk.egg-info/top_level.txt +1 -0
  75. netbox_sdk-0.0.3/pyproject.toml +116 -0
  76. netbox_sdk-0.0.3/setup.cfg +4 -0
  77. netbox_sdk-0.0.3/tests/test_api_auth.py +380 -0
  78. netbox_sdk-0.0.3/tests/test_api_cache.py +191 -0
  79. netbox_sdk-0.0.3/tests/test_cli_error_handling.py +43 -0
  80. netbox_sdk-0.0.3/tests/test_cli_new_options.py +277 -0
  81. netbox_sdk-0.0.3/tests/test_cli_trace.py +354 -0
  82. netbox_sdk-0.0.3/tests/test_cli_tui.py +794 -0
  83. netbox_sdk-0.0.3/tests/test_cli_tui_theme.py +310 -0
  84. netbox_sdk-0.0.3/tests/test_config_profiles.py +179 -0
  85. netbox_sdk-0.0.3/tests/test_demo_auth.py +161 -0
  86. netbox_sdk-0.0.3/tests/test_demo_cli.py +522 -0
  87. netbox_sdk-0.0.3/tests/test_demo_runtime_refresh.py +75 -0
  88. netbox_sdk-0.0.3/tests/test_dev_tui.py +503 -0
  89. netbox_sdk-0.0.3/tests/test_django_model_tui.py +93 -0
  90. netbox_sdk-0.0.3/tests/test_docgen_paths.py +90 -0
  91. netbox_sdk-0.0.3/tests/test_graphql.py +257 -0
  92. netbox_sdk-0.0.3/tests/test_instance_isolation.py +83 -0
  93. netbox_sdk-0.0.3/tests/test_logging_runtime.py +48 -0
  94. netbox_sdk-0.0.3/tests/test_logo_render.py +32 -0
  95. netbox_sdk-0.0.3/tests/test_logs_tui.py +110 -0
  96. netbox_sdk-0.0.3/tests/test_markdown_output.py +151 -0
  97. netbox_sdk-0.0.3/tests/test_no_hardcoded_colors.py +124 -0
  98. netbox_sdk-0.0.3/tests/test_output_safety.py +51 -0
  99. netbox_sdk-0.0.3/tests/test_plugin_discovery.py +47 -0
  100. netbox_sdk-0.0.3/tests/test_schema_index.py +50 -0
  101. netbox_sdk-0.0.3/tests/test_services.py +64 -0
  102. netbox_sdk-0.0.3/tests/test_theme_registry.py +214 -0
  103. netbox_sdk-0.0.3/tests/test_tui_interaction.py +1997 -0
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,230 @@
1
+ Metadata-Version: 2.4
2
+ Name: netbox-sdk
3
+ Version: 0.0.3
4
+ Summary: API-first NetBox CLI + Textual TUI
5
+ Author-email: Emerson Felipe <emerson@netdevopsbr.com>
6
+ Maintainer-email: Emerson Felipe <emerson@netdevopsbr.com>
7
+ Project-URL: Homepage, https://github.com/emersonfelipesp/netbox-cli
8
+ Project-URL: Documentation, https://emersonfelipesp.com/netbox-cli
9
+ Project-URL: Repository, https://github.com/emersonfelipesp/netbox-cli
10
+ Project-URL: Issues, https://github.com/emersonfelipesp/netbox-cli/issues
11
+ Project-URL: Changelog, https://github.com/emersonfelipesp/netbox-cli/releases
12
+ Keywords: netbox,terminal,netbox-integration,tui,cli,terminal,api,integration
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: System Administrators
17
+ Classifier: License :: OSI Approved :: Apache Software License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Internet
24
+ Classifier: Topic :: System :: Networking
25
+ Classifier: Topic :: System :: Systems Administration
26
+ Classifier: Typing :: Typed
27
+ Requires-Python: >=3.11
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE.txt
30
+ Requires-Dist: aiohttp>=3.9.0
31
+ Requires-Dist: playwright>=1.52.0
32
+ Requires-Dist: pydantic>=2.0
33
+ Requires-Dist: typer>=0.12.0
34
+ Requires-Dist: rich>=13.7.0
35
+ Requires-Dist: textual>=0.62.0
36
+ Requires-Dist: pyyaml>=6.0.0
37
+ Provides-Extra: dev
38
+ Requires-Dist: pre-commit>=4.0.0; extra == "dev"
39
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
40
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
41
+ Requires-Dist: pytest-timeout>=2.3.0; extra == "dev"
42
+ Requires-Dist: pytest-xdist>=3.5.0; extra == "dev"
43
+ Requires-Dist: ruff>=0.11.0; extra == "dev"
44
+ Provides-Extra: docs
45
+ Requires-Dist: mkdocs-material>=9.5; extra == "docs"
46
+ Dynamic: license-file
47
+
48
+ # NetBox CLI and TUI
49
+
50
+ `netbox-cli` is a terminal client for NetBox with two ways to work:
51
+
52
+ - fast command-line operations such as `nbx dcim devices get --id 1`
53
+ - interactive terminal apps such as `nbx tui` and `nbx dev tui`
54
+
55
+ > Temporary naming note: the GitHub repository remains `netbox-cli`, but the
56
+ > published PyPI package is currently `netbox-console` due to PyPI naming policy
57
+ > constraints tracked in https://github.com/pypi/support/issues/9925. This will
58
+ > be reverted to `netbox-cli` on PyPI after that issue is resolved.
59
+
60
+ ## Quick Start with the Demo Instance
61
+
62
+ Install (official PyPI):
63
+
64
+ ```bash
65
+ sudo apt-get update && sudo apt-get install -y curl
66
+ curl -fsSL https://raw.githubusercontent.com/emersonfelipesp/netbox-cli/main/install.sh | bash
67
+ ```
68
+
69
+ Reload your shell:
70
+
71
+ ```bash
72
+ source ~/.bashrc # bash
73
+ source ~/.zshrc # zsh
74
+ ```
75
+
76
+ Authenticate against the public demo instance:
77
+
78
+ ```bash
79
+ nbx demo init
80
+ ```
81
+
82
+ Try a few commands:
83
+
84
+ ```bash
85
+ nbx demo dcim devices list
86
+ nbx demo ipam prefixes list
87
+ nbx demo tui
88
+ nbx demo dev tui
89
+ ```
90
+
91
+ ## Install
92
+
93
+ Install from official PyPI:
94
+
95
+ ```bash
96
+ pip install netbox-console
97
+ ```
98
+
99
+ or with `uv`:
100
+
101
+ ```bash
102
+ uv tool install --force netbox-console
103
+ ```
104
+
105
+ Install from a local checkout (developer workflow):
106
+
107
+ ```bash
108
+ cd <path-to-netbox-cli>
109
+ uv tool install --force .
110
+ ```
111
+
112
+ If `nbx` is not available after install, make sure `~/.local/bin` is in your `PATH`.
113
+
114
+ ## Configure
115
+
116
+ Set up your normal profile:
117
+
118
+ ```bash
119
+ nbx init
120
+ ```
121
+
122
+ Set up the demo profile:
123
+
124
+ ```bash
125
+ nbx demo init
126
+ ```
127
+
128
+ You can also pass credentials directly when needed:
129
+
130
+ ```bash
131
+ nbx demo init --username <your-demo-user> --password <your-demo-password>
132
+ ```
133
+
134
+ ## Common Commands
135
+
136
+ List and inspect resources:
137
+
138
+ ```bash
139
+ nbx dcim devices list
140
+ nbx dcim devices get --id 1
141
+ nbx ipam prefixes list
142
+ ```
143
+
144
+ Create or update objects:
145
+
146
+ ```bash
147
+ nbx ipam ip-addresses create --body-json '{"address":"192.0.2.10/24","status":"active"}'
148
+ nbx dcim devices patch --id 1 --body-json '{"name":"edge-sw01"}'
149
+ ```
150
+
151
+ Send direct HTTP requests:
152
+
153
+ ```bash
154
+ nbx call GET /api/status/
155
+ nbx call POST /api/ipam/ip-addresses/ --body-file ./payload.json
156
+ ```
157
+
158
+ Explore available groups, resources, and operations:
159
+
160
+ ```bash
161
+ nbx groups
162
+ nbx resources dcim
163
+ nbx ops dcim devices
164
+ ```
165
+
166
+ ## TUI Modes
167
+
168
+ Main TUI:
169
+
170
+ ```bash
171
+ nbx tui
172
+ nbx demo tui
173
+ ```
174
+
175
+ Developer workbench:
176
+
177
+ ```bash
178
+ nbx dev tui
179
+ nbx demo dev tui
180
+ ```
181
+
182
+ Log viewer:
183
+
184
+ ```bash
185
+ nbx logs
186
+ ```
187
+
188
+ ## Themes
189
+
190
+ List available themes:
191
+
192
+ ```bash
193
+ nbx tui --theme
194
+ ```
195
+
196
+ Start with a specific theme:
197
+
198
+ ```bash
199
+ nbx tui --theme dracula
200
+ nbx tui --theme netbox-light
201
+ nbx dev tui --theme netbox-dark
202
+ ```
203
+
204
+ You can also change themes live from the top-left theme selector in the TUI.
205
+
206
+ ## Useful TUI Keys
207
+
208
+ - `/` focus search
209
+ - `g` focus navigation
210
+ - `s` focus results
211
+ - `r` refresh current resource
212
+ - `f` open filters
213
+ - `d` switch to details
214
+ - `q` quit
215
+
216
+ ## Custom Themes
217
+
218
+ Built-in themes include:
219
+
220
+ - `netbox-dark`
221
+ - `dracula`
222
+ - `netbox-light`
223
+
224
+ You can add your own theme by placing a JSON theme file in `netbox_cli/themes/`.
225
+
226
+ ## Tips
227
+
228
+ - `nbx demo ...` uses a separate demo profile from your normal `nbx ...` profile.
229
+ - If a command works in the CLI, there is usually a matching flow in the TUI.
230
+ - The Dev TUI is useful for exploring endpoints, request timing, and raw JSON responses.
@@ -0,0 +1,183 @@
1
+ # NetBox CLI and TUI
2
+
3
+ `netbox-cli` is a terminal client for NetBox with two ways to work:
4
+
5
+ - fast command-line operations such as `nbx dcim devices get --id 1`
6
+ - interactive terminal apps such as `nbx tui` and `nbx dev tui`
7
+
8
+ > Temporary naming note: the GitHub repository remains `netbox-cli`, but the
9
+ > published PyPI package is currently `netbox-console` due to PyPI naming policy
10
+ > constraints tracked in https://github.com/pypi/support/issues/9925. This will
11
+ > be reverted to `netbox-cli` on PyPI after that issue is resolved.
12
+
13
+ ## Quick Start with the Demo Instance
14
+
15
+ Install (official PyPI):
16
+
17
+ ```bash
18
+ sudo apt-get update && sudo apt-get install -y curl
19
+ curl -fsSL https://raw.githubusercontent.com/emersonfelipesp/netbox-cli/main/install.sh | bash
20
+ ```
21
+
22
+ Reload your shell:
23
+
24
+ ```bash
25
+ source ~/.bashrc # bash
26
+ source ~/.zshrc # zsh
27
+ ```
28
+
29
+ Authenticate against the public demo instance:
30
+
31
+ ```bash
32
+ nbx demo init
33
+ ```
34
+
35
+ Try a few commands:
36
+
37
+ ```bash
38
+ nbx demo dcim devices list
39
+ nbx demo ipam prefixes list
40
+ nbx demo tui
41
+ nbx demo dev tui
42
+ ```
43
+
44
+ ## Install
45
+
46
+ Install from official PyPI:
47
+
48
+ ```bash
49
+ pip install netbox-console
50
+ ```
51
+
52
+ or with `uv`:
53
+
54
+ ```bash
55
+ uv tool install --force netbox-console
56
+ ```
57
+
58
+ Install from a local checkout (developer workflow):
59
+
60
+ ```bash
61
+ cd <path-to-netbox-cli>
62
+ uv tool install --force .
63
+ ```
64
+
65
+ If `nbx` is not available after install, make sure `~/.local/bin` is in your `PATH`.
66
+
67
+ ## Configure
68
+
69
+ Set up your normal profile:
70
+
71
+ ```bash
72
+ nbx init
73
+ ```
74
+
75
+ Set up the demo profile:
76
+
77
+ ```bash
78
+ nbx demo init
79
+ ```
80
+
81
+ You can also pass credentials directly when needed:
82
+
83
+ ```bash
84
+ nbx demo init --username <your-demo-user> --password <your-demo-password>
85
+ ```
86
+
87
+ ## Common Commands
88
+
89
+ List and inspect resources:
90
+
91
+ ```bash
92
+ nbx dcim devices list
93
+ nbx dcim devices get --id 1
94
+ nbx ipam prefixes list
95
+ ```
96
+
97
+ Create or update objects:
98
+
99
+ ```bash
100
+ nbx ipam ip-addresses create --body-json '{"address":"192.0.2.10/24","status":"active"}'
101
+ nbx dcim devices patch --id 1 --body-json '{"name":"edge-sw01"}'
102
+ ```
103
+
104
+ Send direct HTTP requests:
105
+
106
+ ```bash
107
+ nbx call GET /api/status/
108
+ nbx call POST /api/ipam/ip-addresses/ --body-file ./payload.json
109
+ ```
110
+
111
+ Explore available groups, resources, and operations:
112
+
113
+ ```bash
114
+ nbx groups
115
+ nbx resources dcim
116
+ nbx ops dcim devices
117
+ ```
118
+
119
+ ## TUI Modes
120
+
121
+ Main TUI:
122
+
123
+ ```bash
124
+ nbx tui
125
+ nbx demo tui
126
+ ```
127
+
128
+ Developer workbench:
129
+
130
+ ```bash
131
+ nbx dev tui
132
+ nbx demo dev tui
133
+ ```
134
+
135
+ Log viewer:
136
+
137
+ ```bash
138
+ nbx logs
139
+ ```
140
+
141
+ ## Themes
142
+
143
+ List available themes:
144
+
145
+ ```bash
146
+ nbx tui --theme
147
+ ```
148
+
149
+ Start with a specific theme:
150
+
151
+ ```bash
152
+ nbx tui --theme dracula
153
+ nbx tui --theme netbox-light
154
+ nbx dev tui --theme netbox-dark
155
+ ```
156
+
157
+ You can also change themes live from the top-left theme selector in the TUI.
158
+
159
+ ## Useful TUI Keys
160
+
161
+ - `/` focus search
162
+ - `g` focus navigation
163
+ - `s` focus results
164
+ - `r` refresh current resource
165
+ - `f` open filters
166
+ - `d` switch to details
167
+ - `q` quit
168
+
169
+ ## Custom Themes
170
+
171
+ Built-in themes include:
172
+
173
+ - `netbox-dark`
174
+ - `dracula`
175
+ - `netbox-light`
176
+
177
+ You can add your own theme by placing a JSON theme file in `netbox_cli/themes/`.
178
+
179
+ ## Tips
180
+
181
+ - `nbx demo ...` uses a separate demo profile from your normal `nbx ...` profile.
182
+ - If a command works in the CLI, there is usually a matching flow in the TUI.
183
+ - The Dev TUI is useful for exploring endpoints, request timing, and raw JSON responses.
@@ -0,0 +1,4 @@
1
+ """netbox-cli package."""
2
+
3
+ __all__ = ["__version__"]
4
+ __version__ = "0.1.0"