borescope 0.1.0b1__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 (138) hide show
  1. borescope-0.1.0b1/.gitignore +35 -0
  2. borescope-0.1.0b1/LICENSE +203 -0
  3. borescope-0.1.0b1/PKG-INFO +114 -0
  4. borescope-0.1.0b1/README.md +83 -0
  5. borescope-0.1.0b1/pyproject.toml +219 -0
  6. borescope-0.1.0b1/src/borescope/__init__.py +13 -0
  7. borescope-0.1.0b1/src/borescope/__main__.py +13 -0
  8. borescope-0.1.0b1/src/borescope/cli.py +143 -0
  9. borescope-0.1.0b1/src/borescope/discovery.py +264 -0
  10. borescope-0.1.0b1/src/borescope/errors.py +23 -0
  11. borescope-0.1.0b1/src/borescope/juju.py +88 -0
  12. borescope-0.1.0b1/src/borescope/shell/__init__.py +11 -0
  13. borescope-0.1.0b1/src/borescope/shell/commands/__init__.py +16 -0
  14. borescope-0.1.0b1/src/borescope/shell/commands/_args.py +57 -0
  15. borescope-0.1.0b1/src/borescope/shell/commands/base.py +82 -0
  16. borescope-0.1.0b1/src/borescope/shell/commands/basic.py +105 -0
  17. borescope-0.1.0b1/src/borescope/shell/commands/execcmd.py +37 -0
  18. borescope-0.1.0b1/src/borescope/shell/commands/filesystem.py +500 -0
  19. borescope-0.1.0b1/src/borescope/shell/commands/pebble.py +359 -0
  20. borescope-0.1.0b1/src/borescope/shell/completion.py +83 -0
  21. borescope-0.1.0b1/src/borescope/shell/context.py +38 -0
  22. borescope-0.1.0b1/src/borescope/shell/history.py +31 -0
  23. borescope-0.1.0b1/src/borescope/shell/parser.py +223 -0
  24. borescope-0.1.0b1/src/borescope/shell/pathutils.py +24 -0
  25. borescope-0.1.0b1/src/borescope/shell/repl.py +132 -0
  26. borescope-0.1.0b1/src/borescope/shell/sanitise.py +37 -0
  27. borescope-0.1.0b1/src/borescope/shell/theme.py +39 -0
  28. borescope-0.1.0b1/src/borescope/snapshot.py +102 -0
  29. borescope-0.1.0b1/src/borescope/transport/__init__.py +159 -0
  30. borescope-0.1.0b1/src/borescope/transport/cli_transport.py +66 -0
  31. borescope-0.1.0b1/src/borescope/transport/relay.py +80 -0
  32. borescope-0.1.0b1/src/borescope/transport/runner.py +152 -0
  33. borescope-0.1.0b1/src/borescope/transport/socket_transport.py +32 -0
  34. borescope-0.1.0b1/tests/cloud-config.yaml +10 -0
  35. borescope-0.1.0b1/tests/conftest.py +317 -0
  36. borescope-0.1.0b1/tests/fuzz/README.md +77 -0
  37. borescope-0.1.0b1/tests/fuzz/corpus/mixed_quoting +1 -0
  38. borescope-0.1.0b1/tests/fuzz/corpus/pipe_command +1 -0
  39. borescope-0.1.0b1/tests/fuzz/corpus/pipe_with_flags +1 -0
  40. borescope-0.1.0b1/tests/fuzz/corpus/simple_command +1 -0
  41. borescope-0.1.0b1/tests/fuzz/corpus/single_quoted_arg +1 -0
  42. borescope-0.1.0b1/tests/fuzz/corpus/tilde_expansion +1 -0
  43. borescope-0.1.0b1/tests/fuzz/corpus/variable_expansion +1 -0
  44. borescope-0.1.0b1/tests/fuzz/corpus/whitespace_only +1 -0
  45. borescope-0.1.0b1/tests/fuzz/fuzz_parser.py +60 -0
  46. borescope-0.1.0b1/tests/integration/__init__.py +3 -0
  47. borescope-0.1.0b1/tests/integration/conftest.py +59 -0
  48. borescope-0.1.0b1/tests/integration/test_socket.py +109 -0
  49. borescope-0.1.0b1/tests/spread/cat-missing-file-errors/task.yaml +23 -0
  50. borescope-0.1.0b1/tests/spread/cat-multiple-files-concatenated/task.yaml +28 -0
  51. borescope-0.1.0b1/tests/spread/cat-no-args-reads-stdin/task.yaml +18 -0
  52. borescope-0.1.0b1/tests/spread/cat-single-file/task.yaml +25 -0
  53. borescope-0.1.0b1/tests/spread/cd-absolute-path/task.yaml +16 -0
  54. borescope-0.1.0b1/tests/spread/cd-into-file-errors/task.yaml +25 -0
  55. borescope-0.1.0b1/tests/spread/cd-no-args-goes-home/task.yaml +20 -0
  56. borescope-0.1.0b1/tests/spread/cd-relative-path/task.yaml +18 -0
  57. borescope-0.1.0b1/tests/spread/cp-file-to-existing-dir/task.yaml +25 -0
  58. borescope-0.1.0b1/tests/spread/cp-file-to-file/task.yaml +23 -0
  59. borescope-0.1.0b1/tests/spread/cp-missing-source-errors/task.yaml +28 -0
  60. borescope-0.1.0b1/tests/spread/double-quoted-tilde-is-literal/task.yaml +21 -0
  61. borescope-0.1.0b1/tests/spread/double-quotes-expand-var/task.yaml +23 -0
  62. borescope-0.1.0b1/tests/spread/echo-empty-string-arg-divergence/task.yaml +22 -0
  63. borescope-0.1.0b1/tests/spread/echo-multiple-args/task.yaml +24 -0
  64. borescope-0.1.0b1/tests/spread/echo-no-args-divergence/task.yaml +25 -0
  65. borescope-0.1.0b1/tests/spread/env-lists-tracked-variables/task.yaml +23 -0
  66. borescope-0.1.0b1/tests/spread/exit-default-zero/task.yaml +27 -0
  67. borescope-0.1.0b1/tests/spread/exit-non-numeric-arg-divergence/task.yaml +25 -0
  68. borescope-0.1.0b1/tests/spread/exit-with-code/task.yaml +21 -0
  69. borescope-0.1.0b1/tests/spread/expand-no-expansion-in-single-quotes/task.yaml +20 -0
  70. borescope-0.1.0b1/tests/spread/expand-tilde-alone/task.yaml +19 -0
  71. borescope-0.1.0b1/tests/spread/expand-tilde-not-at-word-start/task.yaml +21 -0
  72. borescope-0.1.0b1/tests/spread/expand-tilde-prefix/task.yaml +17 -0
  73. borescope-0.1.0b1/tests/spread/expand-unknown-var-empty/task.yaml +23 -0
  74. borescope-0.1.0b1/tests/spread/expand-var-braces/task.yaml +19 -0
  75. borescope-0.1.0b1/tests/spread/expand-var-dollar/task.yaml +19 -0
  76. borescope-0.1.0b1/tests/spread/find-by-name-pattern/task.yaml +29 -0
  77. borescope-0.1.0b1/tests/spread/find-by-type-directory/task.yaml +25 -0
  78. borescope-0.1.0b1/tests/spread/find-by-type-file/task.yaml +25 -0
  79. borescope-0.1.0b1/tests/spread/grep-basic-match-exit-0/task.yaml +25 -0
  80. borescope-0.1.0b1/tests/spread/grep-case-insensitive-i/task.yaml +22 -0
  81. borescope-0.1.0b1/tests/spread/grep-count-c/task.yaml +22 -0
  82. borescope-0.1.0b1/tests/spread/grep-invalid-pattern-divergence/task.yaml +34 -0
  83. borescope-0.1.0b1/tests/spread/grep-invert-v/task.yaml +24 -0
  84. borescope-0.1.0b1/tests/spread/grep-line-numbers-n/task.yaml +24 -0
  85. borescope-0.1.0b1/tests/spread/grep-multiple-files-prefixed/task.yaml +26 -0
  86. borescope-0.1.0b1/tests/spread/grep-no-match-exit-1/task.yaml +27 -0
  87. borescope-0.1.0b1/tests/spread/head-default-10-lines/task.yaml +28 -0
  88. borescope-0.1.0b1/tests/spread/head-missing-file-errors/task.yaml +21 -0
  89. borescope-0.1.0b1/tests/spread/head-n-flag/task.yaml +25 -0
  90. borescope-0.1.0b1/tests/spread/lib.sh +81 -0
  91. borescope-0.1.0b1/tests/spread/ls-a-shows-hidden/task.yaml +25 -0
  92. borescope-0.1.0b1/tests/spread/ls-default-no-hidden/task.yaml +30 -0
  93. borescope-0.1.0b1/tests/spread/ls-multiple-operands-headered/task.yaml +30 -0
  94. borescope-0.1.0b1/tests/spread/mixed-quoting-within-word/task.yaml +23 -0
  95. borescope-0.1.0b1/tests/spread/mkdir-create/task.yaml +22 -0
  96. borescope-0.1.0b1/tests/spread/mkdir-existing-errors/task.yaml +30 -0
  97. borescope-0.1.0b1/tests/spread/mkdir-p-creates-parents/task.yaml +23 -0
  98. borescope-0.1.0b1/tests/spread/mkdir-p-existing-ok/task.yaml +24 -0
  99. borescope-0.1.0b1/tests/spread/mv-into-existing-dir/task.yaml +27 -0
  100. borescope-0.1.0b1/tests/spread/mv-rename/task.yaml +25 -0
  101. borescope-0.1.0b1/tests/spread/pipe-empty-stage-rejected/task.yaml +23 -0
  102. borescope-0.1.0b1/tests/spread/pipe-quoted-bar-is-literal/task.yaml +19 -0
  103. borescope-0.1.0b1/tests/spread/pipe-two-stage/task.yaml +24 -0
  104. borescope-0.1.0b1/tests/spread/pwd-default-root/task.yaml +20 -0
  105. borescope-0.1.0b1/tests/spread/quoted-operator-literal-arg/task.yaml +22 -0
  106. borescope-0.1.0b1/tests/spread/rm-existing-file/task.yaml +23 -0
  107. borescope-0.1.0b1/tests/spread/rm-missing-with-f-ok/task.yaml +36 -0
  108. borescope-0.1.0b1/tests/spread/rm-missing-without-f-errors/task.yaml +23 -0
  109. borescope-0.1.0b1/tests/spread/rm-non-empty-dir-without-r-errors/task.yaml +34 -0
  110. borescope-0.1.0b1/tests/spread/rm-recursive/task.yaml +23 -0
  111. borescope-0.1.0b1/tests/spread/sequencing-semicolon-divergence/task.yaml +26 -0
  112. borescope-0.1.0b1/tests/spread/tail-default-10-lines/task.yaml +24 -0
  113. borescope-0.1.0b1/tests/spread/tail-n-flag/task.yaml +26 -0
  114. borescope-0.1.0b1/tests/spread/tokenize-double-quotes/task.yaml +19 -0
  115. borescope-0.1.0b1/tests/spread/touch-creates-new-file/task.yaml +25 -0
  116. borescope-0.1.0b1/tests/spread/touch-existing-updates-mtime-divergence/task.yaml +36 -0
  117. borescope-0.1.0b1/tests/spread/unbalanced-quote-is-error/task.yaml +25 -0
  118. borescope-0.1.0b1/tests/spread/unsupported-and-divergence/task.yaml +25 -0
  119. borescope-0.1.0b1/tests/spread/unsupported-multi-pipe-divergence/task.yaml +24 -0
  120. borescope-0.1.0b1/tests/spread/unsupported-or-divergence/task.yaml +22 -0
  121. borescope-0.1.0b1/tests/spread/unsupported-redirect-append-divergence/task.yaml +23 -0
  122. borescope-0.1.0b1/tests/spread/unsupported-redirect-in-divergence/task.yaml +22 -0
  123. borescope-0.1.0b1/tests/spread/unsupported-redirect-out-divergence/task.yaml +26 -0
  124. borescope-0.1.0b1/tests/test_args.py +49 -0
  125. borescope-0.1.0b1/tests/test_cli.py +87 -0
  126. borescope-0.1.0b1/tests/test_commands.py +238 -0
  127. borescope-0.1.0b1/tests/test_completion.py +53 -0
  128. borescope-0.1.0b1/tests/test_discovery.py +196 -0
  129. borescope-0.1.0b1/tests/test_juju.py +95 -0
  130. borescope-0.1.0b1/tests/test_parser.py +104 -0
  131. borescope-0.1.0b1/tests/test_pathutils.py +33 -0
  132. borescope-0.1.0b1/tests/test_pebble_commands.py +191 -0
  133. borescope-0.1.0b1/tests/test_registry.py +68 -0
  134. borescope-0.1.0b1/tests/test_relay.py +31 -0
  135. borescope-0.1.0b1/tests/test_repl.py +49 -0
  136. borescope-0.1.0b1/tests/test_runner.py +92 -0
  137. borescope-0.1.0b1/tests/test_sanitise.py +26 -0
  138. borescope-0.1.0b1/tests/test_snapshot.py +75 -0
@@ -0,0 +1,35 @@
1
+ __pycache__
2
+ /sandbox
3
+ .idea
4
+ *~
5
+ .venv
6
+ venv
7
+ .vscode
8
+ .coverage
9
+ coverage.xml
10
+ htmlcov
11
+ /.tox
12
+ .*.swp
13
+ .ruff_cache
14
+ .pytest_cache
15
+
16
+ # Tokens and settings for `act` to run GHA locally
17
+ .env
18
+ .envrc
19
+ .secrets
20
+
21
+ # Build artifacts
22
+ /cascade.egg-info
23
+ /dist
24
+ /build
25
+
26
+ # Agents
27
+ .claude/*local*
28
+
29
+ # Local docs-preview tooling writes this when viewing the page
30
+ /docs/localStorage.json
31
+
32
+ # libFuzzer-generated corpus entries (SHA1-named).
33
+ # The hand-written seeds use descriptive names and stay tracked; ignore the
34
+ # auto-discovered ones that accumulate during local fuzz runs.
35
+ tests/fuzz/corpus/[0-9a-f]*
@@ -0,0 +1,203 @@
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
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
203
+
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: borescope
3
+ Version: 0.1.0b1
4
+ Summary: A natural shell for debugging Juju Kubernetes workload containers via Pebble
5
+ Project-URL: Homepage, https://github.com/tonyandrewmeyer/borescope
6
+ Project-URL: Repository, https://github.com/tonyandrewmeyer/borescope
7
+ Project-URL: Bug Tracker, https://github.com/tonyandrewmeyer/borescope/issues
8
+ Author-email: Tony Meyer <borescope@aotearoa.dev>
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: charm,debugging,juju,kubernetes,pebble,shell
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: System Administrators
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: System :: Systems Administration
24
+ Classifier: Topic :: Utilities
25
+ Requires-Python: >=3.11
26
+ Requires-Dist: ops<4,>=2.0.0
27
+ Requires-Dist: pebble-shimmer>=1.0.0b2
28
+ Requires-Dist: prompt-toolkit>=3.0
29
+ Requires-Dist: pyyaml>=6.0
30
+ Description-Content-Type: text/markdown
31
+
32
+ # borescope
33
+
34
+ A natural shell for debugging Juju Kubernetes **workload** containers.
35
+
36
+ Kubernetes charm workload containers usually run a [rock](https://documentation.ubuntu.com/rockcraft/)
37
+ with no shell — so when something breaks, `juju ssh --container=workload …` drops
38
+ you nowhere useful. borescope gives you a prompt that *feels* like `bash` but talks to
39
+ the container's [Pebble](https://documentation.ubuntu.com/pebble/) instead of a real shell:
40
+
41
+ ```console
42
+ $ borescope myapp/0
43
+ pebble:/# ls /var/log/myapp
44
+ pebble:/# tail -f /var/log/myapp/error.log
45
+ pebble:/# services
46
+ pebble:/# logs --follow myapp
47
+ pebble:/# plan
48
+ pebble:/# exit
49
+ ```
50
+
51
+ No setup ceremony: borescope picks up your current Juju controller/model and uses your
52
+ existing `juju` authority — if you can `juju ssh` to the unit, borescope works; if you
53
+ can't, it fails the same way.
54
+
55
+ ## Install
56
+
57
+ > v1 is under active development. For now, from a checkout:
58
+
59
+ ```console
60
+ uv tool install . # or: pipx install .
61
+ ```
62
+
63
+ ## Usage
64
+
65
+ ```console
66
+ borescope <unit> # default (first) workload container
67
+ borescope <unit> --container=<name> # a specific workload container
68
+ borescope --model <model> <unit>
69
+ borescope <unit> --command "services" # one-shot, no REPL (for scripts)
70
+ borescope <unit> --snapshot # dump container state as JSON
71
+ ```
72
+
73
+ ## Documentation
74
+
75
+ Full documentation — a tutorial, how-to guides, and CLI/command reference — is
76
+ at **<https://tonyandrewmeyer.github.io/borescope/>**.
77
+
78
+ The docs are plain Markdown under [`docs/src/`](docs/src/), built into static
79
+ HTML with a small script (no docs framework). To build them locally:
80
+
81
+ ```console
82
+ uv run python docs/src/_build.py # or: tox -e docs
83
+ ```
84
+
85
+ See [`docs/README.md`](docs/README.md) for the authoring rules.
86
+
87
+ ## How it works
88
+
89
+ borescope is three thin, independently-testable layers:
90
+
91
+ - **Transport** — talks to a Pebble. The primary backend (`CliTransport`) reaches the
92
+ workload's Pebble *through the charm container* — `juju ssh <unit>` (the charm
93
+ container always has a shell) pointed at the workload's socket, which Juju mounts
94
+ there at `/charm/containers/<name>/pebble.socket`. This works even against rocks
95
+ with **no shell** (the shell lives in the charm container, not the rock) and stays
96
+ entirely within your Juju authority — no `kubectl` or cluster-admin. It drives
97
+ `pebble` via [shimmer](https://github.com/tonyandrewmeyer/shimmer) (a drop-in
98
+ `ops.pebble.Client` over the Pebble CLI). When the Pebble socket is directly
99
+ reachable (running inside the charm, or a local Pebble), `SocketTransport` uses the
100
+ real `ops.pebble.Client` HTTP API instead.
101
+ - **Discovery** — turns a unit reference into the right Pebble: confirms the unit,
102
+ reads the charm's `metadata.yaml` for workload container names, and sanity-checks
103
+ the container is alive. Everything uses your Juju model access — no `kubectl` /
104
+ cluster-admin.
105
+ - **Shell** — a small REPL: `cd`/`pwd`, path-aware tab completion, history, and a
106
+ minimal command set. Pebble's own vocabulary (`services`, `logs`, `plan`, …) is
107
+ first-class, not hidden behind a `pebble` prefix. For anything else, `exec <cmd>`
108
+ runs a binary that's already in the container.
109
+
110
+ ## Scope
111
+
112
+ borescope is for **Kubernetes** charms (which run Pebble). Machine charms already have
113
+ a real shell and are out of scope. It deliberately ships a *minimal* command set and
114
+ grows on request — if a tool exists in the container, reach it with `exec`.
@@ -0,0 +1,83 @@
1
+ # borescope
2
+
3
+ A natural shell for debugging Juju Kubernetes **workload** containers.
4
+
5
+ Kubernetes charm workload containers usually run a [rock](https://documentation.ubuntu.com/rockcraft/)
6
+ with no shell — so when something breaks, `juju ssh --container=workload …` drops
7
+ you nowhere useful. borescope gives you a prompt that *feels* like `bash` but talks to
8
+ the container's [Pebble](https://documentation.ubuntu.com/pebble/) instead of a real shell:
9
+
10
+ ```console
11
+ $ borescope myapp/0
12
+ pebble:/# ls /var/log/myapp
13
+ pebble:/# tail -f /var/log/myapp/error.log
14
+ pebble:/# services
15
+ pebble:/# logs --follow myapp
16
+ pebble:/# plan
17
+ pebble:/# exit
18
+ ```
19
+
20
+ No setup ceremony: borescope picks up your current Juju controller/model and uses your
21
+ existing `juju` authority — if you can `juju ssh` to the unit, borescope works; if you
22
+ can't, it fails the same way.
23
+
24
+ ## Install
25
+
26
+ > v1 is under active development. For now, from a checkout:
27
+
28
+ ```console
29
+ uv tool install . # or: pipx install .
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ```console
35
+ borescope <unit> # default (first) workload container
36
+ borescope <unit> --container=<name> # a specific workload container
37
+ borescope --model <model> <unit>
38
+ borescope <unit> --command "services" # one-shot, no REPL (for scripts)
39
+ borescope <unit> --snapshot # dump container state as JSON
40
+ ```
41
+
42
+ ## Documentation
43
+
44
+ Full documentation — a tutorial, how-to guides, and CLI/command reference — is
45
+ at **<https://tonyandrewmeyer.github.io/borescope/>**.
46
+
47
+ The docs are plain Markdown under [`docs/src/`](docs/src/), built into static
48
+ HTML with a small script (no docs framework). To build them locally:
49
+
50
+ ```console
51
+ uv run python docs/src/_build.py # or: tox -e docs
52
+ ```
53
+
54
+ See [`docs/README.md`](docs/README.md) for the authoring rules.
55
+
56
+ ## How it works
57
+
58
+ borescope is three thin, independently-testable layers:
59
+
60
+ - **Transport** — talks to a Pebble. The primary backend (`CliTransport`) reaches the
61
+ workload's Pebble *through the charm container* — `juju ssh <unit>` (the charm
62
+ container always has a shell) pointed at the workload's socket, which Juju mounts
63
+ there at `/charm/containers/<name>/pebble.socket`. This works even against rocks
64
+ with **no shell** (the shell lives in the charm container, not the rock) and stays
65
+ entirely within your Juju authority — no `kubectl` or cluster-admin. It drives
66
+ `pebble` via [shimmer](https://github.com/tonyandrewmeyer/shimmer) (a drop-in
67
+ `ops.pebble.Client` over the Pebble CLI). When the Pebble socket is directly
68
+ reachable (running inside the charm, or a local Pebble), `SocketTransport` uses the
69
+ real `ops.pebble.Client` HTTP API instead.
70
+ - **Discovery** — turns a unit reference into the right Pebble: confirms the unit,
71
+ reads the charm's `metadata.yaml` for workload container names, and sanity-checks
72
+ the container is alive. Everything uses your Juju model access — no `kubectl` /
73
+ cluster-admin.
74
+ - **Shell** — a small REPL: `cd`/`pwd`, path-aware tab completion, history, and a
75
+ minimal command set. Pebble's own vocabulary (`services`, `logs`, `plan`, …) is
76
+ first-class, not hidden behind a `pebble` prefix. For anything else, `exec <cmd>`
77
+ runs a binary that's already in the container.
78
+
79
+ ## Scope
80
+
81
+ borescope is for **Kubernetes** charms (which run Pebble). Machine charms already have
82
+ a real shell and are out of scope. It deliberately ships a *minimal* command set and
83
+ grows on request — if a tool exists in the container, reach it with `exec`.
@@ -0,0 +1,219 @@
1
+ [project]
2
+ name = "borescope"
3
+ version = "0.1.0b1"
4
+ description = "A natural shell for debugging Juju Kubernetes workload containers via Pebble"
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "Apache-2.0"
8
+ authors = [
9
+ {name = "Tony Meyer", email = "borescope@aotearoa.dev"},
10
+ ]
11
+ keywords = ["juju", "pebble", "kubernetes", "charm", "shell", "debugging"]
12
+ classifiers = [
13
+ "Development Status :: 4 - Beta",
14
+ "Environment :: Console",
15
+ "Intended Audience :: Developers",
16
+ "Intended Audience :: System Administrators",
17
+ "License :: OSI Approved :: Apache Software License",
18
+ "Operating System :: POSIX :: Linux",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Programming Language :: Python :: 3.14",
24
+ "Topic :: System :: Systems Administration",
25
+ "Topic :: Utilities",
26
+ ]
27
+ dependencies = [
28
+ "ops>=2.0.0,<4",
29
+ "pebble-shimmer>=1.0.0b2",
30
+ "prompt_toolkit>=3.0",
31
+ "PyYAML>=6.0",
32
+ ]
33
+
34
+ [dependency-groups]
35
+ dev = [
36
+ "atheris>=2.3.0",
37
+ "pytest>=7.0.0",
38
+ "pytest-cov>=4.0.0",
39
+ "pytest-mock>=3.10.0",
40
+ "ruff==0.15.14",
41
+ "ty==0.0.38",
42
+ "tox>=4.22.0",
43
+ "pre-commit>=3.0.0",
44
+ ]
45
+ docs = [
46
+ "jinja2>=3.1",
47
+ "markdown-it-py>=3.0",
48
+ "mdit-py-plugins>=0.4",
49
+ "PyYAML>=6.0",
50
+ ]
51
+
52
+ [project.scripts]
53
+ borescope = "borescope.cli:main"
54
+
55
+ [project.urls]
56
+ Homepage = "https://github.com/tonyandrewmeyer/borescope"
57
+ Repository = "https://github.com/tonyandrewmeyer/borescope"
58
+ "Bug Tracker" = "https://github.com/tonyandrewmeyer/borescope/issues"
59
+
60
+ [build-system]
61
+ requires = ["hatchling"]
62
+ build-backend = "hatchling.build"
63
+
64
+ [tool.hatch.build.targets.wheel]
65
+ packages = ["src/borescope"]
66
+
67
+ [tool.hatch.build.targets.sdist]
68
+ include = [
69
+ "/src",
70
+ "/tests",
71
+ "/README.md",
72
+ "/LICENSE",
73
+ ]
74
+
75
+ # Ruff configuration
76
+ [tool.ruff]
77
+ line-length = 99
78
+ target-version = "py311"
79
+ src = ["src", "tests"]
80
+
81
+ [tool.ruff.format]
82
+ quote-style = "single"
83
+
84
+ [tool.ruff.lint]
85
+ # CPY (flake8-copyright) currently requires preview mode.
86
+ preview = true
87
+ explicit-preview-rules = true
88
+ select = [
89
+ # Pyflakes
90
+ "F",
91
+ # Pycodestyle
92
+ "E",
93
+ "W",
94
+ # isort
95
+ "I001",
96
+ # pep8-naming
97
+ "N",
98
+ # flake8-builtins
99
+ "A",
100
+ # flake8-copyright
101
+ "CPY001",
102
+ # pyupgrade
103
+ "UP",
104
+ # flake8-2020
105
+ "YTT",
106
+ # flake8-bandit
107
+ "S",
108
+ # flake8-bugbear
109
+ "B",
110
+ # flake8-simplify
111
+ "SIM",
112
+ # Ruff-specific
113
+ "RUF",
114
+ # Perflint
115
+ "PERF",
116
+ # pydocstyle
117
+ "D",
118
+ # flake8-future-annotations
119
+ "FA",
120
+ # flake8-type-checking
121
+ "TC",
122
+ ]
123
+ ignore = [
124
+ # Line too long: handled by the formatter.
125
+ "E501",
126
+ # Don't force imports into TYPE_CHECKING blocks.
127
+ "TC001",
128
+ "TC002",
129
+ "TC003",
130
+ # assert is fine.
131
+ "S101",
132
+ # Magic methods and __init__ don't need docstrings.
133
+ "D105",
134
+ "D107",
135
+ # subprocess call: check for execution of untrusted input. False-positive heavy.
136
+ "S603",
137
+ ]
138
+
139
+ [tool.ruff.lint.pydocstyle]
140
+ convention = "google"
141
+
142
+ [tool.ruff.lint.flake8-builtins]
143
+ builtins-ignorelist = ["id", "min", "map", "range", "type", "input", "format", "exit", "help"]
144
+
145
+ [tool.ruff.lint.flake8-copyright]
146
+ notice-rgx = "(?i)Copyright \\d{4} Tony Meyer"
147
+
148
+ [tool.ruff.lint.per-file-ignores]
149
+ # Command classes are self-documenting via their ``name``/``summary``/``usage``
150
+ # attributes; a docstring would only restate ``summary``.
151
+ "src/borescope/shell/commands/*.py" = [
152
+ "D101",
153
+ "D102",
154
+ ]
155
+ # Transport is a structural ``Protocol`` mirroring ``ops.pebble.Client``; the
156
+ # upstream API is the docstring.
157
+ "src/borescope/transport/__init__.py" = [
158
+ "D102",
159
+ ]
160
+ "tests/*" = [
161
+ # Docstrings aren't required in tests.
162
+ "D",
163
+ # Hard-coded "secrets" are fine in tests.
164
+ "S105",
165
+ "S106",
166
+ ]
167
+ "tests/**/*" = [
168
+ "D",
169
+ "S105",
170
+ "S106",
171
+ ]
172
+ # The docs build script intentionally keeps two things ruff would flag:
173
+ "docs/src/_build.py" = [
174
+ # The entity-rewrite table maps literal "ambiguous" Unicode characters
175
+ # (en dash, curly quotes, ...) to HTML entities — they must stay as-is.
176
+ "RUF001",
177
+ # Jinja2 autoescape is deliberately off: the body is trusted, already-
178
+ # rendered HTML, and escaping it would double-encode the docs.
179
+ "S701",
180
+ ]
181
+
182
+ [tool.ruff.lint.isort]
183
+ known-first-party = ["borescope"]
184
+
185
+ # Pytest configuration
186
+ [tool.pytest.ini_options]
187
+ minversion = "7.0"
188
+ addopts = [
189
+ "--strict-markers",
190
+ "--strict-config",
191
+ ]
192
+ testpaths = ["tests"]
193
+ markers = [
194
+ "integration: marks tests that require a real pebble binary (deselect with '-m \"not integration\"')",
195
+ "requires_juju: marks tests that require a live Juju controller",
196
+ ]
197
+
198
+ [tool.coverage.run]
199
+ source = ["src"]
200
+ branch = true
201
+ omit = [
202
+ "tests/*",
203
+ "*/__pycache__/*",
204
+ ]
205
+
206
+ [tool.coverage.report]
207
+ exclude_lines = [
208
+ "pragma: no cover",
209
+ "def __repr__",
210
+ "raise AssertionError",
211
+ "raise NotImplementedError",
212
+ "if False:",
213
+ "if __name__ == .__main__.:",
214
+ "class .*\\bProtocol\\):",
215
+ "@(abc\\.)?abstractmethod",
216
+ "if TYPE_CHECKING:",
217
+ ]
218
+ show_missing = true
219
+ precision = 2
@@ -0,0 +1,13 @@
1
+ # Copyright 2026 Tony Meyer
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """borescope - a natural shell for debugging Juju Kubernetes workload containers."""
5
+
6
+ from importlib.metadata import PackageNotFoundError, version
7
+
8
+ try:
9
+ __version__ = version('borescope')
10
+ except PackageNotFoundError: # pragma: no cover - running from an uninstalled tree
11
+ __version__ = '0.0.0+unknown'
12
+
13
+ __all__ = ['__version__']
@@ -0,0 +1,13 @@
1
+ # Copyright 2026 Tony Meyer
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """``python -m borescope`` entry point."""
5
+
6
+ from __future__ import annotations
7
+
8
+ import sys
9
+
10
+ from .cli import main
11
+
12
+ if __name__ == '__main__':
13
+ sys.exit(main())