@fnndsc/chili 3.2.5
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.
- package/LICENSE +21 -0
- package/README.md +113 -0
- package/dist/chefs/chefs.d.ts +15 -0
- package/dist/chefs/chefs.js +195 -0
- package/dist/commands/compute/fields.d.ts +6 -0
- package/dist/commands/compute/fields.js +13 -0
- package/dist/commands/compute/list.d.ts +19 -0
- package/dist/commands/compute/list.js +20 -0
- package/dist/commands/connect/login.d.ts +16 -0
- package/dist/commands/connect/login.js +18 -0
- package/dist/commands/connect/logout.d.ts +6 -0
- package/dist/commands/connect/logout.js +16 -0
- package/dist/commands/feed/comments.d.ts +41 -0
- package/dist/commands/feed/comments.js +45 -0
- package/dist/commands/feed/create.d.ts +13 -0
- package/dist/commands/feed/create.js +40 -0
- package/dist/commands/feed/note.d.ts +21 -0
- package/dist/commands/feed/note.js +24 -0
- package/dist/commands/feeds/delete.d.ts +14 -0
- package/dist/commands/feeds/delete.js +34 -0
- package/dist/commands/feeds/fields.d.ts +6 -0
- package/dist/commands/feeds/fields.js +17 -0
- package/dist/commands/feeds/list.d.ts +17 -0
- package/dist/commands/feeds/list.js +38 -0
- package/dist/commands/feeds/share.d.ts +17 -0
- package/dist/commands/feeds/share.js +19 -0
- package/dist/commands/file/view.d.ts +8 -0
- package/dist/commands/file/view.js +25 -0
- package/dist/commands/files/delete.d.ts +16 -0
- package/dist/commands/files/delete.js +36 -0
- package/dist/commands/files/fields.d.ts +7 -0
- package/dist/commands/files/fields.js +18 -0
- package/dist/commands/files/list.d.ts +11 -0
- package/dist/commands/files/list.js +23 -0
- package/dist/commands/fs/cat.d.ts +15 -0
- package/dist/commands/fs/cat.js +26 -0
- package/dist/commands/fs/cp.d.ts +17 -0
- package/dist/commands/fs/cp.js +26 -0
- package/dist/commands/fs/create.d.ts +15 -0
- package/dist/commands/fs/create.js +83 -0
- package/dist/commands/fs/download.d.ts +25 -0
- package/dist/commands/fs/download.js +235 -0
- package/dist/commands/fs/edit.d.ts +16 -0
- package/dist/commands/fs/edit.js +25 -0
- package/dist/commands/fs/ls.d.ts +18 -0
- package/dist/commands/fs/ls.js +142 -0
- package/dist/commands/fs/mkdir.d.ts +8 -0
- package/dist/commands/fs/mkdir.js +21 -0
- package/dist/commands/fs/mv.d.ts +13 -0
- package/dist/commands/fs/mv.js +73 -0
- package/dist/commands/fs/rm.d.ts +24 -0
- package/dist/commands/fs/rm.js +108 -0
- package/dist/commands/fs/touch.d.ts +16 -0
- package/dist/commands/fs/touch.js +62 -0
- package/dist/commands/fs/upload.d.ts +55 -0
- package/dist/commands/fs/upload.js +221 -0
- package/dist/commands/groups/fields.d.ts +6 -0
- package/dist/commands/groups/fields.js +13 -0
- package/dist/commands/groups/list.d.ts +16 -0
- package/dist/commands/groups/list.js +26 -0
- package/dist/commands/man/doc.d.ts +16 -0
- package/dist/commands/man/doc.js +32 -0
- package/dist/commands/man/topics.d.ts +6 -0
- package/dist/commands/man/topics.js +27 -0
- package/dist/commands/pipeline/fields.d.ts +6 -0
- package/dist/commands/pipeline/fields.js +13 -0
- package/dist/commands/pipeline/run.d.ts +18 -0
- package/dist/commands/pipeline/run.js +33 -0
- package/dist/commands/plugin/readme.d.ts +14 -0
- package/dist/commands/plugin/readme.js +49 -0
- package/dist/commands/plugin/run.d.ts +10 -0
- package/dist/commands/plugin/run.js +29 -0
- package/dist/commands/plugin/search.d.ts +7 -0
- package/dist/commands/plugin/search.js +18 -0
- package/dist/commands/plugininstances/fields.d.ts +6 -0
- package/dist/commands/plugininstances/fields.js +13 -0
- package/dist/commands/plugininstances/list.d.ts +16 -0
- package/dist/commands/plugininstances/list.js +26 -0
- package/dist/commands/pluginmetas/fields.d.ts +6 -0
- package/dist/commands/pluginmetas/fields.js +13 -0
- package/dist/commands/pluginmetas/list.d.ts +16 -0
- package/dist/commands/pluginmetas/list.js +26 -0
- package/dist/commands/plugins/add.d.ts +34 -0
- package/dist/commands/plugins/add.js +374 -0
- package/dist/commands/plugins/delete.d.ts +14 -0
- package/dist/commands/plugins/delete.js +34 -0
- package/dist/commands/plugins/fields.d.ts +6 -0
- package/dist/commands/plugins/fields.js +17 -0
- package/dist/commands/plugins/list.d.ts +17 -0
- package/dist/commands/plugins/list.js +40 -0
- package/dist/commands/plugins/overview.d.ts +6 -0
- package/dist/commands/plugins/overview.js +17 -0
- package/dist/commands/store/list.d.ts +23 -0
- package/dist/commands/store/list.js +48 -0
- package/dist/commands/tags/fields.d.ts +6 -0
- package/dist/commands/tags/fields.js +13 -0
- package/dist/commands/tags/list.d.ts +16 -0
- package/dist/commands/tags/list.js +26 -0
- package/dist/commands/workflows/fields.d.ts +6 -0
- package/dist/commands/workflows/fields.js +13 -0
- package/dist/commands/workflows/list.d.ts +16 -0
- package/dist/commands/workflows/list.js +26 -0
- package/dist/config/colorConfig.d.ts +56 -0
- package/dist/config/colorConfig.js +161 -0
- package/dist/connect/connectHandler.d.ts +15 -0
- package/dist/connect/connectHandler.js +48 -0
- package/dist/context/contextCommand.d.ts +13 -0
- package/dist/context/contextCommand.js +193 -0
- package/dist/controllers/baseController.d.ts +43 -0
- package/dist/controllers/baseController.js +67 -0
- package/dist/controllers/feedController.d.ts +35 -0
- package/dist/controllers/feedController.js +53 -0
- package/dist/controllers/fileController.d.ts +56 -0
- package/dist/controllers/fileController.js +93 -0
- package/dist/controllers/pluginContextController.d.ts +24 -0
- package/dist/controllers/pluginContextController.js +49 -0
- package/dist/controllers/pluginController.d.ts +70 -0
- package/dist/controllers/pluginController.js +98 -0
- package/dist/controllers/pluginMetaController.d.ts +41 -0
- package/dist/controllers/pluginMetaController.js +52 -0
- package/dist/feeds/feedHandler.d.ts +64 -0
- package/dist/feeds/feedHandler.js +203 -0
- package/dist/filesystem/fileGroupHandler.d.ts +92 -0
- package/dist/filesystem/fileGroupHandler.js +318 -0
- package/dist/filesystem/filesystemHandler.d.ts +12 -0
- package/dist/filesystem/filesystemHandler.js +135 -0
- package/dist/filesystem/inodeCommand.d.ts +12 -0
- package/dist/filesystem/inodeCommand.js +37 -0
- package/dist/handlers/baseGroupHandler.d.ts +103 -0
- package/dist/handlers/baseGroupHandler.js +342 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +239 -0
- package/dist/lfs/lfs.d.ts +25 -0
- package/dist/lfs/lfs.js +74 -0
- package/dist/man/man.d.ts +15 -0
- package/dist/man/man.js +31 -0
- package/dist/man/renderer.d.ts +26 -0
- package/dist/man/renderer.js +187 -0
- package/dist/models/feed.d.ts +18 -0
- package/dist/models/feed.js +8 -0
- package/dist/models/listing.d.ts +33 -0
- package/dist/models/listing.js +9 -0
- package/dist/models/plugin.d.ts +27 -0
- package/dist/models/plugin.js +1 -0
- package/dist/models/resource.d.ts +39 -0
- package/dist/models/resource.js +9 -0
- package/dist/pacs/pacsQueryHandler.d.ts +55 -0
- package/dist/pacs/pacsQueryHandler.js +196 -0
- package/dist/pacs/pacsQueryPayload.d.ts +19 -0
- package/dist/pacs/pacsQueryPayload.js +44 -0
- package/dist/pacs/pacsResultRender.d.ts +20 -0
- package/dist/pacs/pacsResultRender.js +141 -0
- package/dist/pacs/pacsRetrieveHandler.d.ts +87 -0
- package/dist/pacs/pacsRetrieveHandler.js +272 -0
- package/dist/pacs/pacsServerHandler.d.ts +15 -0
- package/dist/pacs/pacsServerHandler.js +32 -0
- package/dist/path/pathCommand.d.ts +64 -0
- package/dist/path/pathCommand.js +805 -0
- package/dist/path/pathMapper.d.ts +189 -0
- package/dist/path/pathMapper.js +382 -0
- package/dist/plugins/pluginGroupHandler.d.ts +42 -0
- package/dist/plugins/pluginGroupHandler.js +90 -0
- package/dist/plugins/pluginHandler.d.ts +87 -0
- package/dist/plugins/pluginHandler.js +303 -0
- package/dist/plugins/pluginMetaHandler.d.ts +21 -0
- package/dist/plugins/pluginMetaHandler.js +27 -0
- package/dist/screen/screen.d.ts +214 -0
- package/dist/screen/screen.js +478 -0
- package/dist/utils/admin_prompt.d.ts +42 -0
- package/dist/utils/admin_prompt.js +105 -0
- package/dist/utils/cli.d.ts +67 -0
- package/dist/utils/cli.js +112 -0
- package/dist/utils/docker.d.ts +74 -0
- package/dist/utils/docker.js +155 -0
- package/dist/utils/input_format.d.ts +77 -0
- package/dist/utils/input_format.js +135 -0
- package/dist/utils/sort.d.ts +29 -0
- package/dist/utils/sort.js +63 -0
- package/dist/utils/ui.d.ts +7 -0
- package/dist/utils/ui.js +26 -0
- package/dist/utils.d.ts +15 -0
- package/dist/utils.js +14 -0
- package/dist/views/compute.d.ts +17 -0
- package/dist/views/compute.js +40 -0
- package/dist/views/connect.d.ts +13 -0
- package/dist/views/connect.js +35 -0
- package/dist/views/feed.d.ts +44 -0
- package/dist/views/feed.js +110 -0
- package/dist/views/file.d.ts +25 -0
- package/dist/views/file.js +71 -0
- package/dist/views/fs.d.ts +51 -0
- package/dist/views/fs.js +105 -0
- package/dist/views/ls.d.ts +37 -0
- package/dist/views/ls.js +190 -0
- package/dist/views/plugin.d.ts +28 -0
- package/dist/views/plugin.js +71 -0
- package/dist/views/pluginParameters.d.ts +17 -0
- package/dist/views/pluginParameters.js +79 -0
- package/docs/00_intro.adoc +25 -0
- package/docs/01_setup.adoc +63 -0
- package/docs/02_context.adoc +128 -0
- package/docs/03_searchable.adoc +134 -0
- package/docs/10_everyday_examples.adoc +9 -0
- package/docs/11_upload_data.adoc +146 -0
- package/docs/12_create_a_feed.adoc +9 -0
- package/docs/13_run_a_plugin.adoc +271 -0
- package/docs/20_plugins.adoc +16 -0
- package/docs/21_pluginReadme.adoc +123 -0
- package/docs/30_filesystem.adoc +93 -0
- package/docs/31_fileops.adoc +51 -0
- package/docs/32_file_content.adoc +471 -0
- package/docs/_architecture.adoc +48 -0
- package/docs/_deepContext.adoc +84 -0
- package/docs/_roadmap.adoc +42 -0
- package/docs/_searchable.adoc +187 -0
- package/docs/_state.adoc +68 -0
- package/docs/pacs.adoc +101 -0
- package/docs/pathMapper.md +246 -0
- package/package.json +92 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
= context
|
|
2
|
+
|
|
3
|
+
== intro
|
|
4
|
+
|
|
5
|
+
An important idea in `chili` is the concept of _context_. The _context_ of a command can be thought of as the scope of its activity -- or alternatively the possible set of implicit data which the command can access as it performs its actions.
|
|
6
|
+
|
|
7
|
+
== context operates at two levels
|
|
8
|
+
|
|
9
|
+
To truly understand context, it helps to see it operating on two distinct levels. One determines *where* you are connecting, and the other determines *what* you are doing inside that connection.
|
|
10
|
+
|
|
11
|
+
=== level 1: the environment (global context)
|
|
12
|
+
|
|
13
|
+
This is the highest level. It defines the "universe" you are operating in.
|
|
14
|
+
|
|
15
|
+
|===
|
|
16
|
+
| Pillar | Concept | Description
|
|
17
|
+
|
|
18
|
+
| **The CUBE**
|
|
19
|
+
| Server
|
|
20
|
+
| The physical ChRIS server address (URL). You might have a "Production" CUBE and a "Local Testing" CUBE. Switching this context completely changes the universe of available data.
|
|
21
|
+
|
|
22
|
+
| **The User**
|
|
23
|
+
| Identity
|
|
24
|
+
| Who you are on that server. You might be `admin` on Local and `jane` on Production. `chili` remembers your login token for each identity independently.
|
|
25
|
+
|===
|
|
26
|
+
|
|
27
|
+
=== level 2: the resource (local session)
|
|
28
|
+
|
|
29
|
+
Once you are inside an environment (User + CUBE), you need a way to navigate. This level acts like your "working directory" or "focus."
|
|
30
|
+
|
|
31
|
+
|===
|
|
32
|
+
| Pillar | Concept | Description
|
|
33
|
+
|
|
34
|
+
| **The Folder**
|
|
35
|
+
| Filesystem
|
|
36
|
+
| Your current path in the ChRIS storage (e.g., `/home/jane/data`). Commands like `ls` look here.
|
|
37
|
+
|
|
38
|
+
| **The Feed**
|
|
39
|
+
| Workflow
|
|
40
|
+
| A specific analysis execution (Feed ID). Commands related to logs or status check this feed.
|
|
41
|
+
|
|
42
|
+
| **The Plugin**
|
|
43
|
+
| Tool
|
|
44
|
+
| A specific plugin instance or definition. Commands listing parameters or instances use this scope.
|
|
45
|
+
|===
|
|
46
|
+
|
|
47
|
+
Imagine a standard shell. Level 1 is like choosing which computer to SSH into. Level 2 is what you do (`cd`, `ls`) once you are logged in. `chili` handles both layers seamlessly.
|
|
48
|
+
|
|
49
|
+
== viewing your context
|
|
50
|
+
|
|
51
|
+
At any time, you can ask `chili` "where am I?" by simply typing:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
chili context get
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
This will show you your current active URL, your username, and any specific "working directories" you have set.
|
|
58
|
+
|
|
59
|
+
If you want to see the bigger picture -- all the users and servers `chili` knows about -- you can ask for the full view:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
chili context get --full
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
== changing your context
|
|
66
|
+
|
|
67
|
+
Moving around is easy and can be done at either level.
|
|
68
|
+
|
|
69
|
+
=== switching resources (level 2)
|
|
70
|
+
|
|
71
|
+
Let's say you want to switch your focus to a specific directory in your ChRIS storage so you can explore files there. You can "cd" into it like this:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
chili context set --ChRISfolder /home/jane.doe/data
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Now, any file operations you perform will happen in `/home/jane.doe/data` automatically.
|
|
78
|
+
|
|
79
|
+
=== switching environments (level 1)
|
|
80
|
+
|
|
81
|
+
You can also switch your identity or server completely. If you have previously logged in as user `bob` on a different server, you can switch back to him with a single command, and `chili` will remember exactly where `bob` left off (his Level 2 context):
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
chili context set --ChRISuser bob
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
== scoped execution (inline context)
|
|
88
|
+
|
|
89
|
+
Sometimes you don't want to change your "global" settings just to run one command. You want to peek into a directory or run a plugin in a specific feed without "cd-ing" there permanently.
|
|
90
|
+
|
|
91
|
+
`chili` allows you to define a **temporary scope** right in the command itself. It looks almost like a simplified URL or query string.
|
|
92
|
+
|
|
93
|
+
=== the syntax
|
|
94
|
+
|
|
95
|
+
You can prepend any command with `key=value` arguments. `chili` interprets these as a temporary context override for *just that command*.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
chili scope=<value> [scope=<value>...] <command>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
=== examples
|
|
102
|
+
|
|
103
|
+
**Peeking into a folder (Level 2 override):**
|
|
104
|
+
Instead of changing your directory, just tell `chili` to look at `/home/rudolph` for this one command:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
chili folder=/home/rudolph files list
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Acting on a specific feed (Level 2 override):**
|
|
111
|
+
Run a note listing on feed ID 105, regardless of your current context:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
chili feed=105 note list
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**The Full URI Power (Level 1 & 2 override):**
|
|
118
|
+
You can even specify the user and server inline! This allows you to run a command on a completely different server as a different user without logging out:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
chili "rudolph@https://cube.chrisproject.org?folder=/home/rudolph" files list
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
In this example, `chili` temporarily connects to the remote CUBE as user `rudolph`, sets the working directory to `/home/rudolph`, lists the files, and then immediately returns you to your previous local session. It is incredibly powerful for scripting or cross-server management.
|
|
125
|
+
|
|
126
|
+
== persistence
|
|
127
|
+
|
|
128
|
+
The best part about context is that it is persistent. You can close your terminal, reboot your computer, or go on vacation. When you come back and open `chili` again, you will be exactly where you were. This makes managing long-running workflows or jumping between complex tasks much less of a headache.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
= searchable
|
|
2
|
+
|
|
3
|
+
== intro
|
|
4
|
+
|
|
5
|
+
In `chili`, you often need to tell a command _what_ to operate on. "Run _this_ plugin." "Delete _that_ feed." "List files in _this_ directory."
|
|
6
|
+
|
|
7
|
+
Usually, computer programs want cryptic ID numbers for this. "Run plugin #42." But humans are bad at remembering numbers. We prefer names. `chili` understands this and provides a powerful feature we call _searchables_.
|
|
8
|
+
|
|
9
|
+
A _searchable_ is just a text string you give to a command. `chili` looks at that string and figures out what you mean.
|
|
10
|
+
|
|
11
|
+
== simple search
|
|
12
|
+
|
|
13
|
+
Most of the time, you just want to find something by its name. Let's say you want to run the `pl-dircopy` plugin. You don't need to look up its ID number. You just tell `chili`:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
chili plugin run pl-dircopy
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`chili` sees "pl-dircopy", realizes it's a name, finds the plugin for you, and runs it. Simple.
|
|
20
|
+
|
|
21
|
+
== explicit search
|
|
22
|
+
|
|
23
|
+
Sometimes, "just the name" isn't enough. Maybe there are five different versions of `pl-dircopy` and you need a specific one. Or maybe you are looking for a feed created by a specific person.
|
|
24
|
+
|
|
25
|
+
In these cases, you can use a special key-value syntax. It looks like `key: value`.
|
|
26
|
+
|
|
27
|
+
For example, to find a plugin with a specific version:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
chili plugin run "name: pl-dircopy, version: 2.1.1"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Notice how we separated the two facts we know (the name and the version) with a comma. `chili` will find the single plugin that matches _both_ of these rules.
|
|
34
|
+
|
|
35
|
+
You can use any filter that the ChRIS API supports. If you want to find a feed created by user `bob`:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
chili feed delete "owner_username: bob"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
NOTE: If your searchable matches multiple items, `chili` will warn you but continue using the first match. To avoid ambiguity, be as specific as possible (e.g., use `name_exact` instead of `name`, or add version constraints).
|
|
42
|
+
|
|
43
|
+
== batch operations
|
|
44
|
+
|
|
45
|
+
Some commands (like `delete`) support operating on multiple resources at once. Use the `++` separator to combine multiple searchables:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
chili plugins delete "id:77++id:33++name:pl-test"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This will delete all three plugins in sequence. Each searchable is resolved independently, and if you don't use `--force`, you'll get a confirmation prompt for each one.
|
|
52
|
+
|
|
53
|
+
This is useful for cleaning up multiple test resources or deleting several related items at once.
|
|
54
|
+
|
|
55
|
+
== using searchables in context
|
|
56
|
+
|
|
57
|
+
This gets really powerful when combined with context. Imagine you want to start a session working on a specific plugin, but you don't know its ID. You can set your context using a searchable!
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
chili context set --ChRISplugin "name: pl-dircopy"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Now `chili` finds the plugin, gets its ID, and locks your session to it. Any subsequent commands that ask "which plugin?" will automatically use `pl-dircopy`.
|
|
64
|
+
|
|
65
|
+
This flexibility means you almost never have to memorize an ID number again. Just describe what you want, and let `chili` find it.
|
|
66
|
+
|
|
67
|
+
== advanced: the Searchable class
|
|
68
|
+
|
|
69
|
+
_For developers and advanced users:_
|
|
70
|
+
|
|
71
|
+
Starting with cumin v0.4.1, searchables are implemented as a formal TypeScript class. While `chili` automatically handles string-based searchables, you can use the `Searchable` class directly for type safety and validation:
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { Searchable } from '@fnndsc/cumin';
|
|
75
|
+
|
|
76
|
+
// Create searchables explicitly
|
|
77
|
+
const simple = Searchable.simple("pl-dircopy");
|
|
78
|
+
const compound = Searchable.compound("name:pl-dircopy,version:1.3.2");
|
|
79
|
+
const batch = Searchable.batch("id:77++id:33");
|
|
80
|
+
|
|
81
|
+
// Auto-detect type
|
|
82
|
+
const auto = Searchable.from("name:pl-dircopy");
|
|
83
|
+
|
|
84
|
+
// Check type
|
|
85
|
+
if (auto.isCompound()) {
|
|
86
|
+
console.log("This is a compound searchable");
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Get query parameters
|
|
90
|
+
const params = compound.toQueryParams();
|
|
91
|
+
// { name: "pl-dircopy", version: "1.3.2" }
|
|
92
|
+
|
|
93
|
+
// Split batch into parts
|
|
94
|
+
const parts = batch.toBatchSearchables();
|
|
95
|
+
// [Searchable(id:77), Searchable(id:33)]
|
|
96
|
+
|
|
97
|
+
// Validate format
|
|
98
|
+
if (simple.validate()) {
|
|
99
|
+
console.log("Valid searchable!");
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
All ChRIS operations accept both strings and `Searchable` objects, so you can use whichever is more convenient for your use case.
|
|
104
|
+
|
|
105
|
+
== examples cheat sheet
|
|
106
|
+
|
|
107
|
+
Here are some common ways to use searchables:
|
|
108
|
+
|
|
109
|
+
|===
|
|
110
|
+
| Goal | Searchable String
|
|
111
|
+
|
|
112
|
+
| **Find by Name**
|
|
113
|
+
| `"pl-dircopy"`
|
|
114
|
+
|
|
115
|
+
| **Find by ID**
|
|
116
|
+
| `"id: 14"`
|
|
117
|
+
|
|
118
|
+
| **Exact Name Match**
|
|
119
|
+
| `"name_exact: pl-dircopy"`
|
|
120
|
+
|
|
121
|
+
| **Specific Version**
|
|
122
|
+
| `"name: pl-dircopy, version: 2.0"`
|
|
123
|
+
|
|
124
|
+
| **Recent Feeds**
|
|
125
|
+
| `"limit: 5"` (implicitly sorts by default)
|
|
126
|
+
|
|
127
|
+
| **Feed by Creator**
|
|
128
|
+
| `"owner_username: bob"`
|
|
129
|
+
|
|
130
|
+
| **Delete Multiple Items**
|
|
131
|
+
| `"id:77++id:33++name:pl-test"`
|
|
132
|
+
|===
|
|
133
|
+
|
|
134
|
+
_-30-_
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
= intro
|
|
2
|
+
|
|
3
|
+
== welcome
|
|
4
|
+
|
|
5
|
+
Welome to the inline `chili` documentation system! This set of documents provides help text for each `chili` command. Additionally several important concepts like _searchable_ and _context_ are discussed.
|
|
6
|
+
|
|
7
|
+
== how to use
|
|
8
|
+
|
|
9
|
+
To use this documentation system, simply read it!
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
= uploading data to ChRIS
|
|
2
|
+
|
|
3
|
+
== intro
|
|
4
|
+
|
|
5
|
+
The `path upload` command provides a powerful way to upload entire directory trees from your local filesystem to ChRIS. Unlike single-file uploads with `file create --from-file`, `path upload` recursively scans directories and preserves their structure in the ChRIS filesystem.
|
|
6
|
+
|
|
7
|
+
== basic usage
|
|
8
|
+
|
|
9
|
+
To upload a local directory to ChRIS:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
chili folder=/home/user/uploads path upload ~/Downloads/dataset
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This command:
|
|
16
|
+
1. Validates that `/home/user/uploads` exists in ChRIS (fails if it doesn't)
|
|
17
|
+
2. Uploads the `dataset` directory and all its contents
|
|
18
|
+
3. Creates `/home/user/uploads/dataset/` in ChRIS with the full directory tree preserved
|
|
19
|
+
|
|
20
|
+
== how it works
|
|
21
|
+
|
|
22
|
+
=== folder validation
|
|
23
|
+
|
|
24
|
+
The `folder=` context parameter specifies the *parent directory* in ChRIS where your upload will be placed. This directory **must already exist** in ChRIS—the command will fail if it doesn't.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# This works if /home/jane.doe/data exists in ChRIS
|
|
28
|
+
chili folder=/home/jane.doe/data path upload ./experiment_results
|
|
29
|
+
|
|
30
|
+
# This fails if /home/jane.doe/nonexistent does not exist
|
|
31
|
+
chili folder=/home/jane.doe/nonexistent path upload ./experiment_results
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
=== directory structure preservation
|
|
35
|
+
|
|
36
|
+
The basename of the source directory is preserved in the target path. For example:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
chili folder=/home/user/uploads path upload ~/Downloads/experiment1
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Creates the following structure in ChRIS:
|
|
43
|
+
```
|
|
44
|
+
/home/user/uploads/experiment1/
|
|
45
|
+
├── data.csv
|
|
46
|
+
├── notes.txt
|
|
47
|
+
└── results/
|
|
48
|
+
└── output.json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The `experiment1` directory itself becomes part of the ChRIS filesystem path.
|
|
52
|
+
|
|
53
|
+
=== recursive upload
|
|
54
|
+
|
|
55
|
+
All subdirectories and files are uploaded recursively:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Local structure:
|
|
59
|
+
~/project/
|
|
60
|
+
├── src/
|
|
61
|
+
│ ├── main.py
|
|
62
|
+
│ └── utils.py
|
|
63
|
+
└── data/
|
|
64
|
+
└── input.csv
|
|
65
|
+
|
|
66
|
+
# After: chili folder=/home/user/work path upload ~/project
|
|
67
|
+
# ChRIS structure:
|
|
68
|
+
/home/user/work/project/
|
|
69
|
+
├── src/
|
|
70
|
+
│ ├── main.py
|
|
71
|
+
│ └── utils.py
|
|
72
|
+
└── data/
|
|
73
|
+
└── input.csv
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
== progress tracking
|
|
77
|
+
|
|
78
|
+
During upload, `chili` displays a progress bar showing:
|
|
79
|
+
- Current file count and total files
|
|
80
|
+
- Percentage completion
|
|
81
|
+
- Estimated time remaining
|
|
82
|
+
- Data transferred
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
Transferring [████████░░] 45% | ETA: 12s | 23/50 files | 1.2 MB/2.8 MB
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
== common patterns
|
|
89
|
+
|
|
90
|
+
=== uploading experiment data
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Upload today's experiment results
|
|
94
|
+
chili folder=/home/researcher/experiments/2025-11-29 path upload ~/lab_data/run_42
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
=== organizing by project
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Create project directory first
|
|
101
|
+
chili chefs mkdir /home/user/projects/projectX
|
|
102
|
+
|
|
103
|
+
# Upload data into it
|
|
104
|
+
chili folder=/home/user/projects/projectX path upload ~/local_work/dataset
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
=== multiple uploads to same parent
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Upload multiple datasets to the same parent directory
|
|
111
|
+
chili folder=/home/user/raw_data path upload ~/data/batch1
|
|
112
|
+
chili folder=/home/user/raw_data path upload ~/data/batch2
|
|
113
|
+
chili folder=/home/user/raw_data path upload ~/data/batch3
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Results in:
|
|
117
|
+
```
|
|
118
|
+
/home/user/raw_data/
|
|
119
|
+
├── batch1/
|
|
120
|
+
├── batch2/
|
|
121
|
+
└── batch3/
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
== error handling
|
|
125
|
+
|
|
126
|
+
The command will fail with a clear error if:
|
|
127
|
+
|
|
128
|
+
1. **Target folder doesn't exist:**
|
|
129
|
+
```
|
|
130
|
+
Folder context '/home/user/nonexistent' does not exist in CUBE.
|
|
131
|
+
Please specify an existing directory.
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
2. **Source path doesn't exist:**
|
|
135
|
+
```
|
|
136
|
+
Error: Source path '~/Downloads/missing' not found
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
3. **Permission issues:**
|
|
140
|
+
ChRIS will reject the upload if you don't have write permissions to the target folder.
|
|
141
|
+
|
|
142
|
+
== see also
|
|
143
|
+
|
|
144
|
+
- `chefs ls` - List directory contents to verify uploads
|
|
145
|
+
- `chefs mkdir` - Create target directories before uploading
|
|
146
|
+
- `file create --from-file` - Upload single files
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
= intro
|
|
2
|
+
|
|
3
|
+
== welcome
|
|
4
|
+
|
|
5
|
+
Welome to the inline `chili` documentation system! This set of documents provides help text for each `chili` command. Additionally several important concepts like _searchable_ and _context_ are discussed.
|
|
6
|
+
|
|
7
|
+
== how to use
|
|
8
|
+
|
|
9
|
+
To use this documentation system, simply read it!
|