@fnndsc/chell 4.2.8

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 (231) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +325 -0
  3. package/dist/builtins/debug.d.ts +6 -0
  4. package/dist/builtins/debug.js +47 -0
  5. package/dist/builtins/debug.js.map +1 -0
  6. package/dist/builtins/executable.d.ts +22 -0
  7. package/dist/builtins/executable.js +115 -0
  8. package/dist/builtins/executable.js.map +1 -0
  9. package/dist/builtins/fs/cat.d.ts +16 -0
  10. package/dist/builtins/fs/cat.js +249 -0
  11. package/dist/builtins/fs/cat.js.map +1 -0
  12. package/dist/builtins/fs/cd.d.ts +41 -0
  13. package/dist/builtins/fs/cd.js +178 -0
  14. package/dist/builtins/fs/cd.js.map +1 -0
  15. package/dist/builtins/fs/cp.d.ts +7 -0
  16. package/dist/builtins/fs/cp.js +73 -0
  17. package/dist/builtins/fs/cp.js.map +1 -0
  18. package/dist/builtins/fs/download.d.ts +6 -0
  19. package/dist/builtins/fs/download.js +41 -0
  20. package/dist/builtins/fs/download.js.map +1 -0
  21. package/dist/builtins/fs/du.d.ts +58 -0
  22. package/dist/builtins/fs/du.js +210 -0
  23. package/dist/builtins/fs/du.js.map +1 -0
  24. package/dist/builtins/fs/edit.d.ts +7 -0
  25. package/dist/builtins/fs/edit.js +86 -0
  26. package/dist/builtins/fs/edit.js.map +1 -0
  27. package/dist/builtins/fs/ls.d.ts +8 -0
  28. package/dist/builtins/fs/ls.js +68 -0
  29. package/dist/builtins/fs/ls.js.map +1 -0
  30. package/dist/builtins/fs/mkdir.d.ts +6 -0
  31. package/dist/builtins/fs/mkdir.js +38 -0
  32. package/dist/builtins/fs/mkdir.js.map +1 -0
  33. package/dist/builtins/fs/mv.d.ts +7 -0
  34. package/dist/builtins/fs/mv.js +75 -0
  35. package/dist/builtins/fs/mv.js.map +1 -0
  36. package/dist/builtins/fs/pull.args.d.ts +22 -0
  37. package/dist/builtins/fs/pull.args.js +30 -0
  38. package/dist/builtins/fs/pull.args.js.map +1 -0
  39. package/dist/builtins/fs/pull.d.ts +26 -0
  40. package/dist/builtins/fs/pull.js +413 -0
  41. package/dist/builtins/fs/pull.js.map +1 -0
  42. package/dist/builtins/fs/pwd.d.ts +7 -0
  43. package/dist/builtins/fs/pwd.js +75 -0
  44. package/dist/builtins/fs/pwd.js.map +1 -0
  45. package/dist/builtins/fs/rm.d.ts +31 -0
  46. package/dist/builtins/fs/rm.js +148 -0
  47. package/dist/builtins/fs/rm.js.map +1 -0
  48. package/dist/builtins/fs/touch.d.ts +6 -0
  49. package/dist/builtins/fs/touch.js +64 -0
  50. package/dist/builtins/fs/touch.js.map +1 -0
  51. package/dist/builtins/fs/tree.d.ts +15 -0
  52. package/dist/builtins/fs/tree.js +84 -0
  53. package/dist/builtins/fs/tree.js.map +1 -0
  54. package/dist/builtins/fs/upload.d.ts +6 -0
  55. package/dist/builtins/fs/upload.js +45 -0
  56. package/dist/builtins/fs/upload.js.map +1 -0
  57. package/dist/builtins/help.d.ts +74 -0
  58. package/dist/builtins/help.js +1217 -0
  59. package/dist/builtins/help.js.map +1 -0
  60. package/dist/builtins/index.d.ts +45 -0
  61. package/dist/builtins/index.js +45 -0
  62. package/dist/builtins/index.js.map +1 -0
  63. package/dist/builtins/net/connect.d.ts +7 -0
  64. package/dist/builtins/net/connect.js +42 -0
  65. package/dist/builtins/net/connect.js.map +1 -0
  66. package/dist/builtins/net/cubepath.d.ts +18 -0
  67. package/dist/builtins/net/cubepath.js +102 -0
  68. package/dist/builtins/net/cubepath.js.map +1 -0
  69. package/dist/builtins/net/logout.d.ts +6 -0
  70. package/dist/builtins/net/logout.js +24 -0
  71. package/dist/builtins/net/logout.js.map +1 -0
  72. package/dist/builtins/net/pacs.d.ts +24 -0
  73. package/dist/builtins/net/pacs.js +121 -0
  74. package/dist/builtins/net/pacs.js.map +1 -0
  75. package/dist/builtins/net/pacsUtils.d.ts +85 -0
  76. package/dist/builtins/net/pacsUtils.js +184 -0
  77. package/dist/builtins/net/pacsUtils.js.map +1 -0
  78. package/dist/builtins/net/query.d.ts +60 -0
  79. package/dist/builtins/net/query.js +304 -0
  80. package/dist/builtins/net/query.js.map +1 -0
  81. package/dist/builtins/parametersofplugin.d.ts +13 -0
  82. package/dist/builtins/parametersofplugin.js +43 -0
  83. package/dist/builtins/parametersofplugin.js.map +1 -0
  84. package/dist/builtins/pluginExecute.d.ts +27 -0
  85. package/dist/builtins/pluginExecute.js +165 -0
  86. package/dist/builtins/pluginExecute.js.map +1 -0
  87. package/dist/builtins/proc.d.ts +6 -0
  88. package/dist/builtins/proc.helpers.d.ts +68 -0
  89. package/dist/builtins/proc.helpers.js +102 -0
  90. package/dist/builtins/proc.helpers.js.map +1 -0
  91. package/dist/builtins/proc.js +289 -0
  92. package/dist/builtins/proc.js.map +1 -0
  93. package/dist/builtins/res/compute.d.ts +6 -0
  94. package/dist/builtins/res/compute.js +55 -0
  95. package/dist/builtins/res/compute.js.map +1 -0
  96. package/dist/builtins/res/feed.d.ts +6 -0
  97. package/dist/builtins/res/feed.js +244 -0
  98. package/dist/builtins/res/feed.js.map +1 -0
  99. package/dist/builtins/res/feed.notes.d.ts +28 -0
  100. package/dist/builtins/res/feed.notes.js +24 -0
  101. package/dist/builtins/res/feed.notes.js.map +1 -0
  102. package/dist/builtins/res/files.d.ts +18 -0
  103. package/dist/builtins/res/files.js +85 -0
  104. package/dist/builtins/res/files.js.map +1 -0
  105. package/dist/builtins/res/group.d.ts +6 -0
  106. package/dist/builtins/res/group.js +54 -0
  107. package/dist/builtins/res/group.js.map +1 -0
  108. package/dist/builtins/res/pipeline.args.d.ts +22 -0
  109. package/dist/builtins/res/pipeline.args.js +28 -0
  110. package/dist/builtins/res/pipeline.args.js.map +1 -0
  111. package/dist/builtins/res/pipeline.d.ts +20 -0
  112. package/dist/builtins/res/pipeline.js +252 -0
  113. package/dist/builtins/res/pipeline.js.map +1 -0
  114. package/dist/builtins/res/plugin.d.ts +13 -0
  115. package/dist/builtins/res/plugin.js +140 -0
  116. package/dist/builtins/res/plugin.js.map +1 -0
  117. package/dist/builtins/res/plugininstance.d.ts +6 -0
  118. package/dist/builtins/res/plugininstance.js +53 -0
  119. package/dist/builtins/res/plugininstance.js.map +1 -0
  120. package/dist/builtins/res/pluginmeta.d.ts +6 -0
  121. package/dist/builtins/res/pluginmeta.js +53 -0
  122. package/dist/builtins/res/pluginmeta.js.map +1 -0
  123. package/dist/builtins/res/tag.d.ts +6 -0
  124. package/dist/builtins/res/tag.js +53 -0
  125. package/dist/builtins/res/tag.js.map +1 -0
  126. package/dist/builtins/res/workflow.d.ts +6 -0
  127. package/dist/builtins/res/workflow.js +53 -0
  128. package/dist/builtins/res/workflow.js.map +1 -0
  129. package/dist/builtins/store.d.ts +6 -0
  130. package/dist/builtins/store.js +108 -0
  131. package/dist/builtins/store.js.map +1 -0
  132. package/dist/builtins/sys/context.d.ts +6 -0
  133. package/dist/builtins/sys/context.js +50 -0
  134. package/dist/builtins/sys/context.js.map +1 -0
  135. package/dist/builtins/sys/physicalmode.d.ts +6 -0
  136. package/dist/builtins/sys/physicalmode.js +41 -0
  137. package/dist/builtins/sys/physicalmode.js.map +1 -0
  138. package/dist/builtins/sys/prompt.d.ts +13 -0
  139. package/dist/builtins/sys/prompt.helpers.d.ts +31 -0
  140. package/dist/builtins/sys/prompt.helpers.js +36 -0
  141. package/dist/builtins/sys/prompt.helpers.js.map +1 -0
  142. package/dist/builtins/sys/prompt.js +182 -0
  143. package/dist/builtins/sys/prompt.js.map +1 -0
  144. package/dist/builtins/sys/timing.d.ts +6 -0
  145. package/dist/builtins/sys/timing.js +41 -0
  146. package/dist/builtins/sys/timing.js.map +1 -0
  147. package/dist/builtins/sys/whoami.d.ts +12 -0
  148. package/dist/builtins/sys/whoami.js +37 -0
  149. package/dist/builtins/sys/whoami.js.map +1 -0
  150. package/dist/builtins/utils.d.ts +55 -0
  151. package/dist/builtins/utils.js +145 -0
  152. package/dist/builtins/utils.js.map +1 -0
  153. package/dist/builtins/wildcard.d.ts +26 -0
  154. package/dist/builtins/wildcard.js +120 -0
  155. package/dist/builtins/wildcard.js.map +1 -0
  156. package/dist/chell.d.ts +16 -0
  157. package/dist/chell.js +1193 -0
  158. package/dist/chell.js.map +1 -0
  159. package/dist/command-keys.d.ts +8 -0
  160. package/dist/command-keys.js +32 -0
  161. package/dist/command-keys.js.map +1 -0
  162. package/dist/config/settings.d.ts +39 -0
  163. package/dist/config/settings.js +93 -0
  164. package/dist/config/settings.js.map +1 -0
  165. package/dist/core/bootFlags.d.ts +32 -0
  166. package/dist/core/bootFlags.js +25 -0
  167. package/dist/core/bootFlags.js.map +1 -0
  168. package/dist/core/cli.d.ts +58 -0
  169. package/dist/core/cli.js +251 -0
  170. package/dist/core/cli.js.map +1 -0
  171. package/dist/core/prompt/index.d.ts +80 -0
  172. package/dist/core/prompt/index.js +29 -0
  173. package/dist/core/prompt/index.js.map +1 -0
  174. package/dist/core/prompt/theme_default.d.ts +19 -0
  175. package/dist/core/prompt/theme_default.js +47 -0
  176. package/dist/core/prompt/theme_default.js.map +1 -0
  177. package/dist/core/prompt/theme_p10k.d.ts +22 -0
  178. package/dist/core/prompt/theme_p10k.js +164 -0
  179. package/dist/core/prompt/theme_p10k.js.map +1 -0
  180. package/dist/core/prompt/utils.d.ts +23 -0
  181. package/dist/core/prompt/utils.js +40 -0
  182. package/dist/core/prompt/utils.js.map +1 -0
  183. package/dist/core/question.d.ts +34 -0
  184. package/dist/core/question.js +76 -0
  185. package/dist/core/question.js.map +1 -0
  186. package/dist/core/repl.d.ts +31 -0
  187. package/dist/core/repl.js +146 -0
  188. package/dist/core/repl.js.map +1 -0
  189. package/dist/index.d.ts +7 -0
  190. package/dist/index.js +34 -0
  191. package/dist/index.js.map +1 -0
  192. package/dist/lib/bootsequence.d.ts +62 -0
  193. package/dist/lib/bootsequence.js +222 -0
  194. package/dist/lib/bootsequence.js.map +1 -0
  195. package/dist/lib/completer/index.d.ts +15 -0
  196. package/dist/lib/completer/index.js +212 -0
  197. package/dist/lib/completer/index.js.map +1 -0
  198. package/dist/lib/completer/pathComplete.helpers.d.ts +22 -0
  199. package/dist/lib/completer/pathComplete.helpers.js +49 -0
  200. package/dist/lib/completer/pathComplete.helpers.js.map +1 -0
  201. package/dist/lib/logo.d.ts +47 -0
  202. package/dist/lib/logo.js +313 -0
  203. package/dist/lib/logo.js.map +1 -0
  204. package/dist/lib/parser.d.ts +13 -0
  205. package/dist/lib/parser.js +52 -0
  206. package/dist/lib/parser.js.map +1 -0
  207. package/dist/lib/pipe.d.ts +11 -0
  208. package/dist/lib/pipe.js +90 -0
  209. package/dist/lib/pipe.js.map +1 -0
  210. package/dist/lib/prefetch.d.ts +25 -0
  211. package/dist/lib/prefetch.js +64 -0
  212. package/dist/lib/prefetch.js.map +1 -0
  213. package/dist/lib/semicolonParser.d.ts +22 -0
  214. package/dist/lib/semicolonParser.js +53 -0
  215. package/dist/lib/semicolonParser.js.map +1 -0
  216. package/dist/lib/spinner.d.ts +23 -0
  217. package/dist/lib/spinner.js +68 -0
  218. package/dist/lib/spinner.js.map +1 -0
  219. package/dist/lib/vfs/providers/static.d.ts +65 -0
  220. package/dist/lib/vfs/providers/static.js +164 -0
  221. package/dist/lib/vfs/providers/static.js.map +1 -0
  222. package/dist/lib/vfs/providers/static_content.d.ts +27 -0
  223. package/dist/lib/vfs/providers/static_content.js +180 -0
  224. package/dist/lib/vfs/providers/static_content.js.map +1 -0
  225. package/dist/lib/vfs/vfs.d.ts +59 -0
  226. package/dist/lib/vfs/vfs.js +198 -0
  227. package/dist/lib/vfs/vfs.js.map +1 -0
  228. package/dist/session/index.d.ts +76 -0
  229. package/dist/session/index.js +120 -0
  230. package/dist/session/index.js.map +1 -0
  231. package/package.json +65 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 FNNDSC / BCH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,325 @@
1
+ # ChELL: ChELL Executes Layered Logic
2
+
3
+ **The Interactive Shell for ChRIS**
4
+
5
+ ChELL is a command-line shell that presents a ChRIS distributed-computing platform as a familiar Unix filesystem. If you know `bash` or `zsh`, you already know most of ChELL.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install -g @fnndsc/chell
11
+ ```
12
+
13
+ Requires Node.js ≥ 20.12. This installs the `chell` command — see [Getting Started](#getting-started) to connect to a CUBE.
14
+
15
+ ## The Concept
16
+
17
+ ChRIS stores data, analysis tools, and results behind a REST API. ChELL maps all of that onto paths:
18
+
19
+ - your data lives under `/home/<user>/`
20
+ - every registered plugin is a virtual executable in `/bin`
21
+ - system configuration is readable at `/etc`
22
+ - PACS query results surface under `/net/pacs/queries/`
23
+
24
+ You navigate with `cd`, inspect with `ls`, read files with `cat`, and run analyses by invoking plugin names — the same muscle memory you use on any Unix system.
25
+
26
+ ---
27
+
28
+ ## The Virtual Filesystem
29
+
30
+ The ChELL filesystem has two kinds of paths:
31
+
32
+ - **CFS (CubeFS)** — real ChRIS storage: files you upload, feed outputs, symlink files. Readable, writable, persistent.
33
+ - **VFS (Virtual)** — synthesised on the fly from API resources: plugins, config, PACS results. Read-only views, no stored bytes.
34
+
35
+ | Path | Type | What you see |
36
+ |------|:----:|-------------|
37
+ | `/home/<user>/` | CFS | Your uploaded files and directories |
38
+ | `/home/<user>/feeds/` | CFS | Your analysis feeds and their output trees |
39
+ | `/PIPELINES/` | CFS | Shared pipeline output data |
40
+ | `/PUBLIC/` | CFS | Publicly accessible files |
41
+ | `/SERVICES/` | CFS | Service-level data |
42
+ | `/SHARED/` | CFS | Cross-user shared data |
43
+ | `*.chrislink` | CFS | Symbolic links to other ChRIS paths |
44
+ | `/bin` | VFS | Every plugin registered in this CUBE |
45
+ | `/usr/bin` | VFS | Built-in shell commands (`whoami`, `whereami`, …) |
46
+ | `/etc/` | VFS | Config: compute environments, groups, users, CUBE info |
47
+ | `/net/pacs/queries/` | VFS | PACS query result sets |
48
+ | `/proc/feeds/` | VFS | Job monitoring — live status of all plugin instances |
49
+
50
+ ```bash
51
+ cd /etc
52
+ cat compute.yaml # inspect available compute environments
53
+ cat group # list groups
54
+
55
+ cd /bin
56
+ ls pl-mri* # browse MRI-related plugins
57
+
58
+ cd /home/chris/feeds
59
+ ls -l # see your analysis feeds
60
+ ```
61
+
62
+ ### Symlinks (`.chrislink` files)
63
+
64
+ ChRIS uses `.chrislink` files as symbolic links. `ls -l` renders them as `l` entries; `cd` and `cat` follow them transparently. The link target is resolved through the VFS dispatcher — it can point anywhere in the virtual tree.
65
+
66
+ ---
67
+
68
+ ## Running Plugins
69
+
70
+ Because plugins live in `/bin` as virtual executables, you invoke them **directly by name** — exactly like running a local binary. ChELL uses your **current working directory** to determine context automatically, so you never need to supply a `--previous_id` by hand.
71
+
72
+ ### Case 1 — Starting a new analysis from a data directory
73
+
74
+ ```bash
75
+ cd /home/chris/uploads/SAG-anon
76
+ pl-fshack-v1.2.0 --inputFile brain.mgz --outputFile brain.nii
77
+ ```
78
+
79
+ ChELL detects you are **outside a feed**. It:
80
+ 1. Automatically runs `pl-dircopy` on the current directory to stage the data into a new feed
81
+ 2. Attaches your plugin to that dircopy instance as the next step
82
+
83
+ A new feed is created for you — no boilerplate.
84
+
85
+ ### Case 2 — Continuing an existing analysis
86
+
87
+ ```bash
88
+ cd /home/chris/feeds/feed_123/pl-fshack_456/data
89
+ pl-segmentation-v1.0.0 --threshold 0.5
90
+ ```
91
+
92
+ ChELL detects you are **inside a feed**. It extracts the plugin instance ID from the path (`456`) and uses it as `previous_id` automatically. The new plugin node is wired into the existing computation DAG.
93
+
94
+ ### Naming feeds and instances
95
+
96
+ Use `--` to separate plugin parameters from feed-level context:
97
+
98
+ ```bash
99
+ pl-fshack-v1.2.0 --inputFile brain.mgz -- feed_title="Brain MRI Study" instance_title="FreeSurfer recon"
100
+ ```
101
+
102
+ Everything before `--` goes to the plugin; everything after sets ChRIS metadata.
103
+
104
+ ### Monitoring
105
+
106
+ ```bash
107
+ job inspect <instance_id>
108
+ jobs list --feed <feed_id>
109
+ ```
110
+
111
+ ### Installing new plugins
112
+
113
+ ```bash
114
+ # Search the public peer store
115
+ store search simplefs
116
+
117
+ # Install (auto-discovers compute resources)
118
+ store install pl-simplefsapp
119
+
120
+ # Install pinned to specific compute
121
+ store install pl-simplefsapp --compute ares,argentum
122
+ ```
123
+
124
+ `store install` runs a three-phase resolution:
125
+ 1. Already in this CUBE → reports `[INFO] already registered`
126
+ 2. Found in peer store (cube.chrisproject.org) → imports via admin API (prompts for admin credentials if needed)
127
+ 3. Not found → Docker extraction and registration
128
+
129
+ ---
130
+
131
+ ## Running Pipelines
132
+
133
+ A **pipeline** is a registered template — a named, reusable graph of plugins with their parameter defaults wired together. Pipelines are static definitions; they do not run on their own.
134
+
135
+ A **workflow** is a live instantiation of a pipeline, attached to a specific feed node. Creating a workflow is the act of "running" a pipeline: ChRIS schedules each plugin step in order, feeding outputs of one into the inputs of the next.
136
+
137
+ ```bash
138
+ # Browse registered pipeline templates
139
+ pipeline list
140
+ pipeline inspect <id>
141
+
142
+ # Instantiate a pipeline on an existing feed node → creates a workflow
143
+ workflow create <pipeline_id> --previous_id <instance_id>
144
+
145
+ # Monitor all the jobs it spawns
146
+ jobs list --feed <feed_id>
147
+ ```
148
+
149
+ The `--previous_id` here is the feed node to attach the first pipeline step to — the same context that ChELL resolves automatically when you invoke a single plugin directly.
150
+
151
+ ---
152
+
153
+ ## Monitoring Jobs: `/proc/feeds/`
154
+
155
+ Because every plugin runs asynchronously in ChRIS, `/proc/feeds/` is where you come back to see what happened. It exposes all your visible feeds and their plugin instances as a navigable DAG — the same tree structure the computation actually ran in.
156
+
157
+ ```
158
+ /proc/feeds/
159
+ └── feed_123/
160
+ ├── status ← aggregate feed status
161
+ ├── title ← feed name
162
+ └── pl-dircopy_456/ ← root node (j = job type in ls -l)
163
+ ├── status ← finishedSuccessfully
164
+ ├── params
165
+ ├── log
166
+ └── pl-fshack_789/
167
+ ├── status ← started
168
+ └── pl-segmentation_1011/
169
+ └── status ← scheduled
170
+ ```
171
+
172
+ ```bash
173
+ ls -l /proc/feeds/feed_123 # see all nodes with colour-coded status
174
+ cat /proc/feeds/feed_123/pl-fshack_789/status # live status fetch
175
+ cat /proc/feeds/feed_123/pl-fshack_789/log # stdout/stderr
176
+ cat /proc/feeds/feed_123/pl-fshack_789/params # what it ran with
177
+
178
+ # Search across all jobs
179
+ tree /proc/feeds | grep 789 # find instance 789 and see its full lineage
180
+
181
+ # Cancel a running job
182
+ rm /proc/feeds/feed_123/pl-fshack_789
183
+
184
+ # Cancel all jobs in a feed (requires -r)
185
+ rm -r /proc/feeds/feed_123
186
+ ```
187
+
188
+ Status colours in `ls -l`: green = `finishedSuccessfully`, yellow = `started`/`running`, gray = `scheduled`/`cancelled`, red = `finishedWithError`.
189
+
190
+ The cache is built lazily on first access to `/proc`. Rebuild explicitly after external activity (other users, web GUI):
191
+
192
+ ```bash
193
+ proc refresh # rebuild all
194
+ proc refresh feed_123 # scope to one feed
195
+ ```
196
+
197
+ Since `/proc` paths encode the instance ID, you can also **continue an analysis from any node** just by `cd`-ing into it:
198
+
199
+ ```bash
200
+ cd /proc/feeds/feed_123/pl-dircopy_456
201
+ pl-fshack-v1.2.0 --inputFile brain.mgz # attaches here, no --previous_id needed
202
+ ```
203
+
204
+ ---
205
+
206
+ ## Key Commands
207
+
208
+ ### Filesystem
209
+ ```bash
210
+ ls [-l] [-h] [-a] # list directory
211
+ cd <path> # change directory (follows .chrislinks)
212
+ cat <file> # print file content
213
+ edit <file> # open in $EDITOR, save back to ChRIS
214
+ cp / mv / rm # copy, move, delete
215
+ mkdir / touch # create directory or empty file
216
+ upload <local> <remote> # upload local file or directory tree
217
+ download <remote> <local>
218
+ tree # recursive listing
219
+ du # disk usage
220
+ ```
221
+
222
+ ### Resources
223
+ ```bash
224
+ plugin list / search / inspect / run
225
+ plugins list [--search <term>] [--all]
226
+ feed list / inspect
227
+ feeds list [--user <name>] [--all]
228
+ feed note <id> # read feed note
229
+ feed note edit <id> # edit feed note in $EDITOR
230
+ feed comments <id> # list comments
231
+ pipeline list / inspect
232
+ workflow list / create
233
+ job inspect <id>
234
+ compute list # list compute environments
235
+ ```
236
+
237
+ ### Store
238
+ ```bash
239
+ store list # browse peer store
240
+ store search <query>
241
+ store install <plugin> # install with admin escalation if needed
242
+ store inspect # show current peer store URL
243
+ store set <url> # override peer store
244
+ ```
245
+
246
+ ### System
247
+ ```bash
248
+ whoami # current user and CUBE URL
249
+ whereami # current working directory
250
+ connect --user <u> --password <p> <url>
251
+ logout
252
+ proc refresh # rebuild /proc job cache
253
+ proc refresh feed_123 # scope rebuild to one feed
254
+ ```
255
+
256
+ ---
257
+
258
+ ## Getting Started
259
+
260
+ ```bash
261
+ # Start the shell, then connect interactively
262
+ chell
263
+ > connect --user chris --password chris1234 http://localhost:8000/api/v1/
264
+
265
+ # Connect via flags
266
+ chell -u chris -p chris1234 http://localhost:8000/api/v1/
267
+
268
+ # Compact user@host form (password prompted if omitted)
269
+ chell chris@localhost:8000/api/v1/
270
+ chell -p chris1234 chris@localhost:8000/api/v1/
271
+ ```
272
+
273
+ ### Scripting
274
+
275
+ ```bash
276
+ # Non-interactive: single command via -c
277
+ chell -c "ls -l /home/user/study" > study_contents.txt
278
+ chell -c "store install pl-dircopy"
279
+
280
+ # Run a script file
281
+ chell -f my_workflow.chell
282
+ ```
283
+
284
+ ---
285
+
286
+ ## Architecture
287
+
288
+ ChELL is the presentation layer of the "Sandwich Model":
289
+
290
+ 1. **ChELL** — REPL, builtins, tab completion, prompt
291
+ 2. **ChILI** — typed commands, views, CLI controllers
292
+ 3. **Salsa** — business logic, VFS dispatcher, intent layer
293
+ 4. **Cumin** — connection, context persistence, state
294
+ 5. **`@fnndsc/chrisapi`** — raw ChRIS REST client
295
+
296
+ ---
297
+
298
+ ## Further Reading
299
+
300
+ | Document | Topic |
301
+ |----------|-------|
302
+ | [docs/vfs.adoc](docs/vfs.adoc) | VFS architecture — providers, dispatch, path resolution |
303
+ | [docs/pluginrun.adoc](docs/pluginrun.adoc) | Plugin execution in depth — new feed vs continue feed |
304
+ | [docs/plugin-run-summary.md](docs/plugin-run-summary.md) | Quick-reference summary of plugin run modes |
305
+ | [docs/store.adoc](docs/store.adoc) | Store install — three-phase resolution, admin escalation |
306
+ | [docs/login.adoc](docs/login.adoc) | Connection and authentication options |
307
+ | [docs/execution.adoc](docs/execution.adoc) | Command execution, scripting, and pipeline mode |
308
+ | [docs/commands.adoc](docs/commands.adoc) | Full command reference |
309
+ | [docs/pacsqr.adoc](docs/pacsqr.adoc) | PACS query and retrieve |
310
+ | [docs/physicalMode.adoc](docs/physicalMode.adoc) | Physical vs logical filesystem mode |
311
+ | [docs/gotchas.adoc](docs/gotchas.adoc) | Known edge cases and workarounds |
312
+ | [docs/architecture.adoc](docs/architecture.adoc) | Full architecture deep-dive |
313
+ | [CONTEXT.md](CONTEXT.md) | Domain glossary — ChRIS concepts, permission model, resource contract |
314
+
315
+ ---
316
+
317
+ ## License
318
+
319
+ Part of the [ChRIS Project](https://chrisproject.org).
320
+
321
+ ---
322
+ *ChELL is part of the ChRIS Project.*
323
+
324
+ ---
325
+ _-30-_
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Toggles or displays debug mode status.
3
+ *
4
+ * @param args - Command line arguments: 'on', 'off', or empty to display status.
5
+ */
6
+ export declare function builtin_debug(args: string[]): Promise<void>;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @file Debug Command
3
+ *
4
+ * Toggles debug mode for the application, enabling verbose error logging.
5
+ */
6
+ import chalk from 'chalk';
7
+ import { session } from '../session/index.js';
8
+ /**
9
+ * Toggles or displays debug mode status.
10
+ *
11
+ * @param args - Command line arguments: 'on', 'off', or empty to display status.
12
+ */
13
+ export async function builtin_debug(args) {
14
+ const subcommand = args[0];
15
+ const config = session.connection.config;
16
+ if (!config) {
17
+ console.error(chalk.red('Error: Connection configuration not initialized.'));
18
+ return;
19
+ }
20
+ if (!subcommand) {
21
+ const status = config.debug ? 'enabled' : 'disabled';
22
+ console.log(`Debug mode: ${chalk.yellow(status)}`);
23
+ if (config.debug) {
24
+ console.log(chalk.gray(' Verbose error logging is enabled.'));
25
+ }
26
+ else {
27
+ console.log(chalk.gray(' Verbose error logging is disabled.'));
28
+ }
29
+ console.log(chalk.gray('\nUsage: debug [on|off]'));
30
+ return;
31
+ }
32
+ if (subcommand === 'on') {
33
+ config.debug = true;
34
+ console.log(chalk.yellow('[!] Debug mode enabled'));
35
+ console.log(chalk.gray(' Verbose error logging activated.'));
36
+ }
37
+ else if (subcommand === 'off') {
38
+ config.debug = false;
39
+ console.log(chalk.green('[+] Debug mode disabled'));
40
+ console.log(chalk.gray(' Verbose error logging deactivated.'));
41
+ }
42
+ else {
43
+ console.log(chalk.red(`Unknown argument: ${subcommand}`));
44
+ console.log(chalk.gray('Usage: debug [on|off]'));
45
+ }
46
+ }
47
+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C,wBAAwB,CAAC,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC,CAAC;IAClE,CAAC;SAAM,IAAI,UAAU,KAAK,KAAK,EAAE,CAAC;QAChC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC,CAAC;IACpE,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,qBAAqB,UAAU,EAAE,CAAC,CAAC,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @file Builtin handler for executing a plugin as a shell command.
3
+ *
4
+ * @module
5
+ */
6
+ type PluginExecutableOptions = {
7
+ piped?: boolean;
8
+ };
9
+ /**
10
+ * Handles simulated execution of plugins (e.g., "pl-simpledsapp-v1.2.3 --parameters").
11
+ *
12
+ * This acts as an interceptor for the main shell loop. If the user input matches a
13
+ * known plugin name format, it routes the request to the appropriate ChRIS/ChILI logic,
14
+ * simulating a native executable experience.
15
+ *
16
+ * @param command - The command string (potentially a plugin name).
17
+ * @param args - The arguments passed to the command.
18
+ * @param options - Optional flags for piped/non-interactive handling.
19
+ * @returns A Promise resolving to true if the command was handled as a plugin execution, false otherwise.
20
+ */
21
+ export declare function pluginExecutable_handle(command: string, args: string[], options?: PluginExecutableOptions): Promise<boolean>;
22
+ export {};
@@ -0,0 +1,115 @@
1
+ /**
2
+ * @file Builtin handler for executing a plugin as a shell command.
3
+ *
4
+ * @module
5
+ */
6
+ import chalk from 'chalk';
7
+ import { spinner } from '../lib/spinner.js';
8
+ import { builtin_parametersofplugin } from './parametersofplugin.js';
9
+ import { plugins_list, plugins_listAll } from '@fnndsc/salsa';
10
+ import { pluginReadme_fetch, pluginReadme_render } from '@fnndsc/chili/commands/plugin/readme.js';
11
+ /**
12
+ * Handles simulated execution of plugins (e.g., "pl-simpledsapp-v1.2.3 --parameters").
13
+ *
14
+ * This acts as an interceptor for the main shell loop. If the user input matches a
15
+ * known plugin name format, it routes the request to the appropriate ChRIS/ChILI logic,
16
+ * simulating a native executable experience.
17
+ *
18
+ * @param command - The command string (potentially a plugin name).
19
+ * @param args - The arguments passed to the command.
20
+ * @param options - Optional flags for piped/non-interactive handling.
21
+ * @returns A Promise resolving to true if the command was handled as a plugin execution, false otherwise.
22
+ */
23
+ export async function pluginExecutable_handle(command, args, options) {
24
+ // Expected format: name-vVersion (e.g., "pl-simpledsapp-v2.1.3")
25
+ const versionSeparatorIndex = command.lastIndexOf('-v');
26
+ if (versionSeparatorIndex === -1) {
27
+ return false;
28
+ }
29
+ const name = command.substring(0, versionSeparatorIndex);
30
+ const version = command.substring(versionSeparatorIndex + 2);
31
+ if (!name || !version) {
32
+ return false;
33
+ }
34
+ const showHelp = args.includes('--help') || args.includes('-h');
35
+ const isPipedOutput = !!options?.piped || !process.stdout.isTTY;
36
+ if (showHelp) {
37
+ console.log(chalk.cyan(`Plugin executable flags for ${name}-v${version}:`));
38
+ console.log(' --parameters Show parameter definitions for this plugin version');
39
+ console.log(' --readme Show README (rendered) from plugin metadata repository URL');
40
+ console.log(' --readme --raw Output raw markdown, suitable for piping to glow or bat');
41
+ return true;
42
+ }
43
+ const plugin_resolveExact = async () => {
44
+ try {
45
+ const resultsExactUnknown = await plugins_list({
46
+ search: {
47
+ name_exact: name,
48
+ version: version
49
+ }
50
+ });
51
+ const resultsExact = resultsExactUnknown;
52
+ let candidate = resultsExact?.tableData?.[0];
53
+ if (!candidate || candidate.name !== name || candidate.version !== version) {
54
+ const allVersionsUnknown = await plugins_listAll({
55
+ search: { name: name }
56
+ });
57
+ const allVersions = allVersionsUnknown;
58
+ candidate = allVersions?.tableData?.find((p) => p.name === name && p.version === version);
59
+ }
60
+ if (!candidate ||
61
+ typeof candidate.id !== 'number' ||
62
+ typeof candidate.name !== 'string' ||
63
+ typeof candidate.version !== 'string') {
64
+ return null;
65
+ }
66
+ return { id: candidate.id, name: candidate.name, version: candidate.version };
67
+ }
68
+ catch (error) {
69
+ console.error(chalk.red(`Error resolving plugin: ${error instanceof Error ? error.message : String(error)}`));
70
+ return null;
71
+ }
72
+ };
73
+ if (args.includes('--readme')) {
74
+ const rawMode = args.includes('--raw');
75
+ console.log(chalk.cyan(`Resolving plugin ${name} v${version} for README...`));
76
+ const resolved = await plugin_resolveExact();
77
+ if (!resolved) {
78
+ console.log(chalk.red(`Plugin ${name} v${version} not found.`));
79
+ return true;
80
+ }
81
+ spinner.start(`Fetching README for ${resolved.name} v${resolved.version}...`);
82
+ try {
83
+ const content = await pluginReadme_fetch(String(resolved.id));
84
+ spinner.stop();
85
+ if (content) {
86
+ console.log(rawMode ? content : pluginReadme_render(content));
87
+ }
88
+ else {
89
+ console.log(chalk.yellow(`No README found for ${resolved.name} v${resolved.version}.`));
90
+ }
91
+ }
92
+ catch (error) {
93
+ spinner.stop();
94
+ const message = error instanceof Error ? error.message : String(error);
95
+ console.log(chalk.red(`Failed to fetch README: ${message}`));
96
+ }
97
+ return true;
98
+ }
99
+ if (args.includes('--parameters')) {
100
+ console.log(chalk.cyan(`Fetching parameters for plugin ${name} v${version}...`));
101
+ const resolved = await plugin_resolveExact();
102
+ if (!resolved) {
103
+ console.log(chalk.red(`Plugin ${name} v${version} not found.`));
104
+ return true; // Handled (attempted), but failed
105
+ }
106
+ console.log(chalk.cyan(`Resolved Plugin: ${resolved.name} v${resolved.version} (ID: ${resolved.id})`));
107
+ // Delegate to parametersofplugin builtin with the resolved context
108
+ await builtin_parametersofplugin(['list', '--plugin-id', String(resolved.id)]);
109
+ return true;
110
+ }
111
+ // If command matches plugin format but no handled flags are present,
112
+ // return false to let the main loop handle it (or show unknown command).
113
+ return false;
114
+ }
115
+ //# sourceMappingURL=executable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executable.js","sourceRoot":"","sources":["../../src/builtins/executable.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAclG;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CACzC,OAAe,EACf,IAAc,EACd,OAAiC;IAEjC,iEAAiE;IACjE,MAAM,qBAAqB,GAAW,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChE,IAAI,qBAAqB,KAAK,CAAC,CAAC,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,IAAI,GAAW,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC;IACjE,MAAM,OAAO,GAAW,OAAO,CAAC,SAAS,CAAC,qBAAqB,GAAG,CAAC,CAAC,CAAC;IAErE,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,QAAQ,GAAY,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzE,MAAM,aAAa,GAAY,CAAC,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;IACzE,IAAI,QAAQ,EAAE,CAAC;QACX,OAAO,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,CAAC,CAAC,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,qEAAqE;IACrE,yEAAyE;IACzE,OAAO,KAAK,CAAC;AACjB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Displays the content of one or more files.
3
+ *
4
+ * Supports multiple files and concatenates their output. Binary mode is applied
5
+ * consistently to all files if any file is detected as binary or --binary is specified.
6
+ *
7
+ * @param args - Command line arguments (file paths and optional --binary flag).
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * await builtin_cat(['file1.txt', 'file2.txt']);
12
+ * await builtin_cat(['--binary', 'image.dcm']);
13
+ * await builtin_cat(['*.json']); // After wildcard expansion
14
+ * ```
15
+ */
16
+ export declare function builtin_cat(args: string[]): Promise<void>;