vortex-cli 4.20.1__tar.gz → 5.0.0__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 (67) hide show
  1. vortex_cli-5.0.0/PKG-INFO +324 -0
  2. vortex_cli-5.0.0/README.md +280 -0
  3. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/pyproject.toml +17 -2
  4. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/cli.py +301 -17
  5. vortex_cli-5.0.0/vortex/commands/agent.py +27 -0
  6. vortex_cli-5.0.0/vortex/commands/clean.py +58 -0
  7. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/clone.py +69 -16
  8. vortex_cli-5.0.0/vortex/commands/code.py +36 -0
  9. vortex_cli-5.0.0/vortex/commands/compile.py +283 -0
  10. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/config.py +26 -1
  11. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/copy.py +5 -1
  12. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/db.py +11 -3
  13. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/delete.py +4 -1
  14. vortex_cli-5.0.0/vortex/commands/docs.py +82 -0
  15. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/execute.py +4 -0
  16. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/export.py +16 -13
  17. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/find.py +1 -1
  18. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/grep.py +6 -2
  19. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/import_.py +9 -0
  20. vortex_cli-5.0.0/vortex/commands/libs.py +71 -0
  21. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/list.py +1 -0
  22. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/log.py +4 -4
  23. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/new.py +65 -26
  24. vortex_cli-5.0.0/vortex/commands/schema.py +400 -0
  25. vortex_cli-5.0.0/vortex/commands/use.py +64 -0
  26. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/watch.py +181 -34
  27. vortex_cli-5.0.0/vortex/docs/Blackbook v2.md +2753 -0
  28. vortex_cli-5.0.0/vortex/docs/index.html +341 -0
  29. vortex_cli-5.0.0/vortex/docs/marked.min.js +6 -0
  30. vortex_cli-5.0.0/vortex/libs.py +313 -0
  31. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/main.py +180 -11
  32. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/models.py +135 -38
  33. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/soap.py +152 -6
  34. vortex_cli-5.0.0/vortex/templates/agent/AGENTS.md +66 -0
  35. vortex_cli-5.0.0/vortex/templates/agent/skills/puakma-database/SKILL.md +108 -0
  36. vortex_cli-5.0.0/vortex/templates/agent/skills/puakma-design-elements/SKILL.md +97 -0
  37. vortex_cli-5.0.0/vortex/templates/agent/skills/puakma-overview/SKILL.md +67 -0
  38. vortex_cli-5.0.0/vortex/templates/agent/skills/vortex-workflow/SKILL.md +148 -0
  39. vortex_cli-5.0.0/vortex/templates/agent/vortex.code-snippets +437 -0
  40. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/util.py +72 -13
  41. vortex_cli-5.0.0/vortex/webdesign.py +120 -0
  42. vortex_cli-5.0.0/vortex/workspace.py +830 -0
  43. vortex_cli-5.0.0/vortex_cli.egg-info/PKG-INFO +324 -0
  44. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex_cli.egg-info/SOURCES.txt +15 -0
  45. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex_cli.egg-info/requires.txt +3 -0
  46. vortex_cli-4.20.1/PKG-INFO +0 -165
  47. vortex_cli-4.20.1/README.md +0 -123
  48. vortex_cli-4.20.1/vortex/commands/clean.py +0 -22
  49. vortex_cli-4.20.1/vortex/commands/code.py +0 -22
  50. vortex_cli-4.20.1/vortex/commands/docs.py +0 -44
  51. vortex_cli-4.20.1/vortex/commands/use.py +0 -31
  52. vortex_cli-4.20.1/vortex/workspace.py +0 -382
  53. vortex_cli-4.20.1/vortex_cli.egg-info/PKG-INFO +0 -165
  54. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/LICENSE +0 -0
  55. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/setup.cfg +0 -0
  56. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/__init__.py +0 -0
  57. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/__main__.py +0 -0
  58. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/colour.py +0 -0
  59. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/commands/__init__.py +0 -0
  60. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/constants.py +0 -0
  61. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/docs/Blackbook.pdf +0 -0
  62. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/lib/puakma-6.0.40.jar +0 -0
  63. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/logging.py +0 -0
  64. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex/spinner.py +0 -0
  65. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex_cli.egg-info/dependency_links.txt +0 -0
  66. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex_cli.egg-info/entry_points.txt +0 -0
  67. {vortex_cli-4.20.1 → vortex_cli-5.0.0}/vortex_cli.egg-info/top_level.txt +0 -0
@@ -0,0 +1,324 @@
1
+ Metadata-Version: 2.4
2
+ Name: vortex_cli
3
+ Version: 5.0.0
4
+ Summary: Vortex CLI
5
+ Author-email: Jordan Amos <jordan.amos@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2023 jordanamos
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Keywords: vortex,cli,puakma,tornado
29
+ Classifier: Intended Audience :: Developers
30
+ Classifier: License :: OSI Approved :: MIT License
31
+ Classifier: Natural Language :: English
32
+ Classifier: Programming Language :: Python
33
+ Classifier: Programming Language :: Python :: 3
34
+ Classifier: Programming Language :: Python :: 3 :: Only
35
+ Requires-Python: >=3.10
36
+ Description-Content-Type: text/markdown
37
+ License-File: LICENSE
38
+ Requires-Dist: httpx==0.24.1
39
+ Requires-Dist: tabulate==0.9.0
40
+ Requires-Dist: watchfiles==0.19.0
41
+ Provides-Extra: keyring
42
+ Requires-Dist: keyring; extra == "keyring"
43
+ Dynamic: license-file
44
+
45
+ # Vortex CLI
46
+
47
+ [![Build Status](https://dev.azure.com/amostj/vortex-cli/_apis/build/status%2Fjordanamos.vortex-cli?branchName=main)](https://dev.azure.com/amostj/vortex-cli/_build/latest?definitionId=11&branchName=main) [![PyPI version](https://badge.fury.io/py/vortex-cli.svg)](https://badge.fury.io/py/vortex-cli)
48
+
49
+ Vortex CLI is a command line alternative to the [Puakma Vortex IDE](https://github.com/brendonupson/PuakmaVortex) that simplifies the process of developing Puakma Applications on a [Puakma Tornado Server](https://github.com/brendonupson/Puakma) using Visual Studio Code. It allows you to clone applications from the server to a local workspace, edit the files using Visual Studio Code, and automatically upload changes to the server as you work.
50
+
51
+ Vortex CLI also comes pre-packaged with the necessary Puakma .jar files for development.
52
+
53
+ #### Visual Studio Code and Extensions
54
+
55
+ While it is possible to use without it, this software has been purposefully designed for use with [Visual Studio Code](https://github.com/microsoft/vscode) and the [Project Manager For Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-dependency) or the [Extension Pack For Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack) extension. This software leverages [Workspaces](https://code.visualstudio.com/docs/editor/workspaces) in Visual Studio Code and manages a `vortex.code-workspace` file within the workspace.
56
+
57
+ ## Installation
58
+
59
+ 1. Install the tool using pip.
60
+
61
+ ```
62
+ pip install vortex-cli
63
+ ```
64
+
65
+ 2. It is recommended to set the workspace you would like to work out of via the `VORTEX_HOME` environment variable.
66
+
67
+ On Unix:
68
+
69
+ ```
70
+ export VORTEX_HOME=/path/to/workspace
71
+ ```
72
+
73
+ Otherwise, Vortex CLI will use a default **'vortex-cli-workspace'** directory inside your home directory.
74
+
75
+ 3. Run vortex with the `--init` flag to create your workspace (If it doesn't already exist) and the necessary config files:
76
+ ```
77
+ vortex --init
78
+ ```
79
+
80
+ 4. Define the servers you will be working with in the `servers.ini` file inside the `.config` directory within your workspace. You can quickly access this using the `code` command to view your workspace in VSCode.
81
+
82
+ ```
83
+ vortex code
84
+ ```
85
+
86
+ In the `servers.ini` file, you can define as many servers as you need, each with their own unique name. For example:
87
+
88
+ ```
89
+ [DEFAULT] ; This section is optional and only useful if you have multiple definitions
90
+ port = 80 ; Options provided under DEFAULT will be applied to all definitions if not provided
91
+ soap_path = system/SOAPDesigner.pma
92
+ default = server1 ; Useful when you have multiple definitions
93
+
94
+
95
+ [server1] ; This can be called whatever you want and can be referenced using the '--server' flag
96
+ host = example.com
97
+ port = 8080 ; we can overwrite the DEFAULT value
98
+ puakma_db_conn_id = 13
99
+ username = myuser ; Optional - Prompted at runtime if not provided
100
+ password = mypassword ; Optional - Prompted at runtime if not provided
101
+ ; Optional
102
+ clone_with_resources = html,css,js ; resources with these extensions are always cloned - 'clone --get-resources' still clones ALL resources
103
+ lib_path = ; optional extra jars to add to the classpath (the server's own jars are downloaded automatically - see 'vortex libs')
104
+ java_home = /usr/lib/jvm/java-17-openjdk-amd64/ ; The local path to the JRE to use. Should be the same version running on your server
105
+ java_environment_name = JavaSE-17 ; Java Execution Environment name https://docs.osgi.org/reference/eenames.html
106
+ ```
107
+
108
+ ## Upgrading to 5.0
109
+
110
+ 5.0 changes some defaults you may rely on:
111
+
112
+ - **`resource_ext_only` is replaced by `clone_with_resources` - and the meaning flipped.**
113
+ Previously the extensions *restricted* what `--get-resources` cloned. Now resources with the
114
+ listed extensions are **always** cloned, and `--get-resources` clones every resource
115
+ unfiltered. Rename the key in `servers.ini` (vortex warns while the old key is present).
116
+ - **`vortex watch` now watches every cloned app across all servers** and uploads each change to
117
+ the server it was cloned from. Use `--server` for the old single-server behaviour, and mark
118
+ production definitions `protected = true` so they are never watched by accident.
119
+ - **`vortex compile` now uses the Eclipse compiler (ecj)** - the same compiler the VS Code Java
120
+ extension uses - downloaded once per workspace. `--javac PATH` forces javac. `compile
121
+ --upload` is now a full refresh (uploads every compiled class, not just changed ones).
122
+ - `find`, `grep` and `vortex list --local` now search all cloned apps unless `--server` is
123
+ given, and ID-taking commands infer their server from local clones (see below).
124
+
125
+ ## Usage
126
+
127
+ For a full list of commands see `--help`.
128
+
129
+ ### Command Overview
130
+
131
+ - `code`: Open the workspace in Visual Studio Code (`-s <server>` opens that server's own workspace with exactly its jars on the Java classpath).
132
+ - `use`: Set the default server so you don't need to pass `--server` on every command. e.g. `vortex use production`
133
+ - `list` (or `ls`): List Puakma Applications on the server or cloned locally. (`ls` is an alias for `vortex list --local`)
134
+ - `clone`: Clone Puakma Applications and their design objects into the workspace. Apps can be referenced by ID (`vortex clone 13`), by TemplateName (`vortex clone bettrackr_app`), or by group/name (`vortex clone bettrackr/app`) - all optionally server-qualified (`dev:13`, `dev:bettrackr/app`).
135
+ - `watch`: Watch the workspace for changes to Design Objects and automatically upload them to the server each app was cloned from. Watches all servers at once unless `--server` is given.
136
+ - `clean`: Delete the locally cloned Puakma Application directories in the workspace.
137
+ - `config`: View and manage configuration.
138
+ - `log`: View the server log.
139
+ - `find`: Find Design Objects of cloned applications by name.
140
+ - `grep`: Search the contents of cloned Design Objects using a Regular Expression.
141
+ - `new`: Create new Design Objects, Applications, or Keywords. Use `--update <ID>` to update instead. Run without flags to launch an interactive wizard.
142
+ - `copy`: Copy a Design Object from one application to another.
143
+ - `delete`: Delete Design Objects by ID.
144
+ - `db`: Interact with Database Connections. Accepts `--server`/`-s` like other commands for one-off queries against another server.
145
+ - `schema`: Manage the Puakma data dictionary (PMATABLE/ATTRIBUTE): record table/column definitions and print the DDL to run by hand. Never executes DDL.
146
+ - `compile` (or `build`): Compile an application's Java Design Objects into `zbin/` using the Eclipse compiler (ecj).
147
+ - `libs`: Show or refresh the per-server Java library cache (each server's `puakma.jar` and shared libraries, downloaded from the server itself).
148
+ - `agent`: Generate agent/editor support files (CLAUDE.md, Puakma skills, code snippets) in the workspace.
149
+ - `docs`: Open the Tornado Server Blackbook.
150
+ - `execute`: Execute a command on the server.
151
+
152
+ ### Working with Multiple Servers
153
+
154
+ Each section in `servers.ini` defines a server (hosts must be unique across
155
+ sections). Cloned apps remember which server they came from, so you can work on
156
+ apps from several servers at the same time:
157
+
158
+ - `vortex watch` watches **every** cloned app and uploads each change to the
159
+ server it was cloned from. One terminal, all servers. Log lines are prefixed
160
+ with the server name (e.g. `[dev] Upload DATA of ...`). Use `--server` to
161
+ watch a single server only.
162
+ - Commands that take IDs (`clone`, `export`, `compile`, `delete`, `copy`) work
163
+ out the server on their own: IDs can be qualified as `SERVER:ID`
164
+ (e.g. `vortex export dev:123`), and unqualified IDs are resolved against your
165
+ locally cloned apps. If an ID exists on more than one server, vortex stops
166
+ and asks rather than guessing.
167
+ - `find`, `grep` and `vortex list --local` search across all cloned apps unless
168
+ `--server` is given.
169
+ - `watch`, `clone` and `clean` take a workspace-wide lock: only one watch at
170
+ a time, and cloning or cleaning is refused while a watch is running (stop
171
+ the watch first - a clone under a running watch adds directories the
172
+ watcher doesn't know about). Finer-grained commands that alter design
173
+ elements (`delete`, `copy`, `new`, `compile --upload`) lock
174
+ per-application: they are refused for apps a watch is watching and run
175
+ concurrently otherwise.
176
+ - In VS Code, app folders are listed in per-server blocks (`dev: group/app`,
177
+ ...) with the server's jars on the Java classpath (see them in the Java
178
+ Projects view). vscode-java's classpath settings are
179
+ **window-scoped** - folder-level settings are ignored - so the global
180
+ workspace unions every server's jars (version clashes between servers are
181
+ possible there). For a guaranteed-correct classpath, open a single server's
182
+ own workspace with `vortex code -s <server>` (generated as
183
+ `.vscode/<server>.code-workspace`, containing only that server's apps and
184
+ exactly its jars).
185
+
186
+ `vortex use <server>` still sets the default server for commands that have no
187
+ IDs to infer from (`list`, `log`, `db`, `execute`, `new`):
188
+
189
+ ```
190
+ vortex use production
191
+ vortex list
192
+ ```
193
+
194
+ #### Credentials
195
+
196
+ `username`/`password` can be left out of `servers.ini`. Each server's
197
+ credentials resolve in this order and are only requested when a command
198
+ actually connects to that server:
199
+
200
+ 1. The system keyring - store with `vortex config --set-password -s <server>`
201
+ (requires `pip install keyring`)
202
+ 2. Per-server environment variables `VORTEX_USERNAME_<SERVER>` /
203
+ `VORTEX_PASSWORD_<SERVER>` (e.g. `VORTEX_PASSWORD_DEV`)
204
+ 3. `VORTEX_USERNAME` / `VORTEX_PASSWORD`
205
+ 4. An interactive prompt naming the server
206
+
207
+ #### Protected Servers
208
+
209
+ Set `protected = true` on a server definition (e.g. production) to make it
210
+ hard to change by accident:
211
+
212
+ - Write operations (`delete`, `copy`, `new`, `import`, `db --update`,
213
+ `execute`, `schema` changes, `compile --upload`) require the server name to
214
+ be typed back to continue. This is deliberately **not** bypassed by `--yes`.
215
+ - `vortex watch` skips protected servers unless `--include-protected` is
216
+ given, so saving a file can never hot-deploy to production by accident.
217
+
218
+ ### Interactive Wizards
219
+
220
+ Run `vortex new object` or `vortex new app` without any flags to launch a step-by-step wizard:
221
+
222
+ ```
223
+ vortex new object
224
+ # → pick app from locally cloned list
225
+ # → pick design type
226
+ # → enter name
227
+ # → enter content type (resource/documentation only)
228
+ # → enter parent page, open action, save action (page only)
229
+ # → preview and confirm
230
+
231
+ vortex new app
232
+ # → enter name
233
+ # → pick from existing groups or enter a new one
234
+ # → enter description (optional)
235
+ # → preview and confirm
236
+ ```
237
+
238
+ ### Skipping Confirmation Prompts
239
+
240
+ Pass `--yes` (or `-y`) to skip Y/y confirmation prompts, useful for scripting:
241
+
242
+ ```
243
+ vortex --yes delete 123 456
244
+ vortex -y new object --name MyAction --app-id 10 --type action
245
+ ```
246
+
247
+ Note: `--yes` never bypasses the typed confirmation for servers marked
248
+ `protected = true`.
249
+
250
+ ### Compiling Java Design Objects
251
+
252
+ `vortex compile` (alias `build`) compiles an application's Java Design Objects into `zbin/`
253
+ with the **Eclipse compiler (ecj)** - the same compiler the VS Code Java extension uses,
254
+ downloaded once per workspace into `config/.tools/`. It runs via the `java` from `java_home`
255
+ in the server config, then `$JAVA_HOME`, then `PATH`; `--release` is derived from the
256
+ application's Java class version. ecj matters because Tornado loads each class from its own
257
+ design element: `'$'` **classes (`Foo$1.class`) are never uploaded to the server**, and unlike
258
+ javac, ecj compiles a `switch` over an enum into the class itself rather than a synthetic
259
+ `Foo$1.class`. Classes that still produce `$` files (genuine anonymous/inner classes) are
260
+ reported and **excluded from upload** - they would throw `NoClassDefFoundError` on the server.
261
+ If ecj can't be downloaded (offline), javac is used with a warning; `--javac PATH` forces
262
+ javac explicitly.
263
+
264
+ ```
265
+ vortex compile # compile all locally cloned apps for the server
266
+ vortex compile 13 # compile one app
267
+ vortex compile 13 --upload # also upload ALL compiled classes (full server refresh)
268
+ ```
269
+
270
+ While `vortex watch` is running, `--upload` isn't needed: saving a Java source uploads the
271
+ SOURCE, and the VS Code Java extension's incremental build (which **is** the Eclipse
272
+ compiler, ecj - the same compiler `vortex compile` downloads) writes the class files into
273
+ `zbin/`, where watch picks them up and uploads the DATA - always, even when the bytes are
274
+ unchanged, so a source change is always paired with its class on the server. `'$'`
275
+ nested-class files are never uploaded - a class compiled alongside `$` siblings is refused
276
+ with an error since it would fail on the server.
277
+ Use `vortex compile` for full-application rebuilds without the IDE.
278
+
279
+ ### Server-Provided Java Libraries
280
+
281
+ Compilation and IDE IntelliSense need the Puakma framework jar and the server's shared
282
+ libraries on the classpath. Instead of maintaining local copies, vortex downloads them from
283
+ each server's `webdesign` application (the `vortex` API's `systemjar` and `libraries`
284
+ endpoints) and caches them per server under `<workspace>/<host>/.lib/`:
285
+
286
+ - The cache is filled automatically the first time it's needed - on `clone`, `watch` and
287
+ `compile` - and never re-downloaded unless you ask.
288
+ - `vortex libs` shows what's cached for each server; `vortex libs --refresh` re-downloads
289
+ (add `-s <server>` for one server), e.g. after a server upgrade.
290
+ - `javac` (via `vortex compile`) and each app folder's VS Code Java settings use the app's
291
+ own server's cached jars, so identical class names on different servers/versions never
292
+ cross-contaminate.
293
+ - Servers whose `webdesign` app doesn't provide the `vortex` API yet fall back to the
294
+ `puakma.jar` bundled with vortex-cli plus any `lib_path` entries, with a warning.
295
+ - `vortex clean` keeps each host's `.lib` cache so the jars don't need
296
+ re-downloading; pass `--include-libs` to remove them as well.
297
+
298
+ ### Managing the Data Dictionary
299
+
300
+ `vortex schema` records design-time table and column definitions in the Puakma data
301
+ dictionary (the PMATABLE/ATTRIBUTE tables, which also back `vortex db --schema`) and prints
302
+ the matching DDL for you to run by hand. It never executes DDL, and deletes only remove
303
+ dictionary rows - never real tables or columns.
304
+
305
+ ```
306
+ vortex schema mydb --add-table invoice --description "Customer invoices"
307
+ vortex schema mydb --add-column invoice invoice_id --type BIGINT --pk --auto-increment
308
+ vortex schema mydb --add-column invoice total --type NUMERIC --size 10,2 --not-null
309
+ vortex schema mydb --add-column invoice customer_id --type BIGINT --ref customer.customer_id
310
+ vortex schema mydb --ddl invoice # print CREATE TABLE from the dictionary
311
+ ```
312
+
313
+ ### Agent Support Files
314
+
315
+ `vortex agent` copies bundled support files into the workspace `.vscode` directory so they are
316
+ included in the generated code-workspace: an `AGENTS.md` with Puakma ground rules for coding
317
+ agents (including pointers to the bundled Blackbook v2 architecture reference), a `CLAUDE.md`
318
+ that points Claude Code at `AGENTS.md`, a `.claude/skills/` library covering Puakma development
319
+ and the vortex workflow, and a `vortex.code-snippets` file with common Puakma Java/HTML
320
+ snippets. Existing files are never overwritten, so they are safe to customise. These files are
321
+ also generated automatically on `vortex --init` and before `vortex code` opens the workspace.
322
+
323
+ Workspaces created before AGENTS.md existed keep their full `CLAUDE.md` (existing files are
324
+ never touched); the new `AGENTS.md` is simply added alongside it.
@@ -0,0 +1,280 @@
1
+ # Vortex CLI
2
+
3
+ [![Build Status](https://dev.azure.com/amostj/vortex-cli/_apis/build/status%2Fjordanamos.vortex-cli?branchName=main)](https://dev.azure.com/amostj/vortex-cli/_build/latest?definitionId=11&branchName=main) [![PyPI version](https://badge.fury.io/py/vortex-cli.svg)](https://badge.fury.io/py/vortex-cli)
4
+
5
+ Vortex CLI is a command line alternative to the [Puakma Vortex IDE](https://github.com/brendonupson/PuakmaVortex) that simplifies the process of developing Puakma Applications on a [Puakma Tornado Server](https://github.com/brendonupson/Puakma) using Visual Studio Code. It allows you to clone applications from the server to a local workspace, edit the files using Visual Studio Code, and automatically upload changes to the server as you work.
6
+
7
+ Vortex CLI also comes pre-packaged with the necessary Puakma .jar files for development.
8
+
9
+ #### Visual Studio Code and Extensions
10
+
11
+ While it is possible to use without it, this software has been purposefully designed for use with [Visual Studio Code](https://github.com/microsoft/vscode) and the [Project Manager For Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-dependency) or the [Extension Pack For Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack) extension. This software leverages [Workspaces](https://code.visualstudio.com/docs/editor/workspaces) in Visual Studio Code and manages a `vortex.code-workspace` file within the workspace.
12
+
13
+ ## Installation
14
+
15
+ 1. Install the tool using pip.
16
+
17
+ ```
18
+ pip install vortex-cli
19
+ ```
20
+
21
+ 2. It is recommended to set the workspace you would like to work out of via the `VORTEX_HOME` environment variable.
22
+
23
+ On Unix:
24
+
25
+ ```
26
+ export VORTEX_HOME=/path/to/workspace
27
+ ```
28
+
29
+ Otherwise, Vortex CLI will use a default **'vortex-cli-workspace'** directory inside your home directory.
30
+
31
+ 3. Run vortex with the `--init` flag to create your workspace (If it doesn't already exist) and the necessary config files:
32
+ ```
33
+ vortex --init
34
+ ```
35
+
36
+ 4. Define the servers you will be working with in the `servers.ini` file inside the `.config` directory within your workspace. You can quickly access this using the `code` command to view your workspace in VSCode.
37
+
38
+ ```
39
+ vortex code
40
+ ```
41
+
42
+ In the `servers.ini` file, you can define as many servers as you need, each with their own unique name. For example:
43
+
44
+ ```
45
+ [DEFAULT] ; This section is optional and only useful if you have multiple definitions
46
+ port = 80 ; Options provided under DEFAULT will be applied to all definitions if not provided
47
+ soap_path = system/SOAPDesigner.pma
48
+ default = server1 ; Useful when you have multiple definitions
49
+
50
+
51
+ [server1] ; This can be called whatever you want and can be referenced using the '--server' flag
52
+ host = example.com
53
+ port = 8080 ; we can overwrite the DEFAULT value
54
+ puakma_db_conn_id = 13
55
+ username = myuser ; Optional - Prompted at runtime if not provided
56
+ password = mypassword ; Optional - Prompted at runtime if not provided
57
+ ; Optional
58
+ clone_with_resources = html,css,js ; resources with these extensions are always cloned - 'clone --get-resources' still clones ALL resources
59
+ lib_path = ; optional extra jars to add to the classpath (the server's own jars are downloaded automatically - see 'vortex libs')
60
+ java_home = /usr/lib/jvm/java-17-openjdk-amd64/ ; The local path to the JRE to use. Should be the same version running on your server
61
+ java_environment_name = JavaSE-17 ; Java Execution Environment name https://docs.osgi.org/reference/eenames.html
62
+ ```
63
+
64
+ ## Upgrading to 5.0
65
+
66
+ 5.0 changes some defaults you may rely on:
67
+
68
+ - **`resource_ext_only` is replaced by `clone_with_resources` - and the meaning flipped.**
69
+ Previously the extensions *restricted* what `--get-resources` cloned. Now resources with the
70
+ listed extensions are **always** cloned, and `--get-resources` clones every resource
71
+ unfiltered. Rename the key in `servers.ini` (vortex warns while the old key is present).
72
+ - **`vortex watch` now watches every cloned app across all servers** and uploads each change to
73
+ the server it was cloned from. Use `--server` for the old single-server behaviour, and mark
74
+ production definitions `protected = true` so they are never watched by accident.
75
+ - **`vortex compile` now uses the Eclipse compiler (ecj)** - the same compiler the VS Code Java
76
+ extension uses - downloaded once per workspace. `--javac PATH` forces javac. `compile
77
+ --upload` is now a full refresh (uploads every compiled class, not just changed ones).
78
+ - `find`, `grep` and `vortex list --local` now search all cloned apps unless `--server` is
79
+ given, and ID-taking commands infer their server from local clones (see below).
80
+
81
+ ## Usage
82
+
83
+ For a full list of commands see `--help`.
84
+
85
+ ### Command Overview
86
+
87
+ - `code`: Open the workspace in Visual Studio Code (`-s <server>` opens that server's own workspace with exactly its jars on the Java classpath).
88
+ - `use`: Set the default server so you don't need to pass `--server` on every command. e.g. `vortex use production`
89
+ - `list` (or `ls`): List Puakma Applications on the server or cloned locally. (`ls` is an alias for `vortex list --local`)
90
+ - `clone`: Clone Puakma Applications and their design objects into the workspace. Apps can be referenced by ID (`vortex clone 13`), by TemplateName (`vortex clone bettrackr_app`), or by group/name (`vortex clone bettrackr/app`) - all optionally server-qualified (`dev:13`, `dev:bettrackr/app`).
91
+ - `watch`: Watch the workspace for changes to Design Objects and automatically upload them to the server each app was cloned from. Watches all servers at once unless `--server` is given.
92
+ - `clean`: Delete the locally cloned Puakma Application directories in the workspace.
93
+ - `config`: View and manage configuration.
94
+ - `log`: View the server log.
95
+ - `find`: Find Design Objects of cloned applications by name.
96
+ - `grep`: Search the contents of cloned Design Objects using a Regular Expression.
97
+ - `new`: Create new Design Objects, Applications, or Keywords. Use `--update <ID>` to update instead. Run without flags to launch an interactive wizard.
98
+ - `copy`: Copy a Design Object from one application to another.
99
+ - `delete`: Delete Design Objects by ID.
100
+ - `db`: Interact with Database Connections. Accepts `--server`/`-s` like other commands for one-off queries against another server.
101
+ - `schema`: Manage the Puakma data dictionary (PMATABLE/ATTRIBUTE): record table/column definitions and print the DDL to run by hand. Never executes DDL.
102
+ - `compile` (or `build`): Compile an application's Java Design Objects into `zbin/` using the Eclipse compiler (ecj).
103
+ - `libs`: Show or refresh the per-server Java library cache (each server's `puakma.jar` and shared libraries, downloaded from the server itself).
104
+ - `agent`: Generate agent/editor support files (CLAUDE.md, Puakma skills, code snippets) in the workspace.
105
+ - `docs`: Open the Tornado Server Blackbook.
106
+ - `execute`: Execute a command on the server.
107
+
108
+ ### Working with Multiple Servers
109
+
110
+ Each section in `servers.ini` defines a server (hosts must be unique across
111
+ sections). Cloned apps remember which server they came from, so you can work on
112
+ apps from several servers at the same time:
113
+
114
+ - `vortex watch` watches **every** cloned app and uploads each change to the
115
+ server it was cloned from. One terminal, all servers. Log lines are prefixed
116
+ with the server name (e.g. `[dev] Upload DATA of ...`). Use `--server` to
117
+ watch a single server only.
118
+ - Commands that take IDs (`clone`, `export`, `compile`, `delete`, `copy`) work
119
+ out the server on their own: IDs can be qualified as `SERVER:ID`
120
+ (e.g. `vortex export dev:123`), and unqualified IDs are resolved against your
121
+ locally cloned apps. If an ID exists on more than one server, vortex stops
122
+ and asks rather than guessing.
123
+ - `find`, `grep` and `vortex list --local` search across all cloned apps unless
124
+ `--server` is given.
125
+ - `watch`, `clone` and `clean` take a workspace-wide lock: only one watch at
126
+ a time, and cloning or cleaning is refused while a watch is running (stop
127
+ the watch first - a clone under a running watch adds directories the
128
+ watcher doesn't know about). Finer-grained commands that alter design
129
+ elements (`delete`, `copy`, `new`, `compile --upload`) lock
130
+ per-application: they are refused for apps a watch is watching and run
131
+ concurrently otherwise.
132
+ - In VS Code, app folders are listed in per-server blocks (`dev: group/app`,
133
+ ...) with the server's jars on the Java classpath (see them in the Java
134
+ Projects view). vscode-java's classpath settings are
135
+ **window-scoped** - folder-level settings are ignored - so the global
136
+ workspace unions every server's jars (version clashes between servers are
137
+ possible there). For a guaranteed-correct classpath, open a single server's
138
+ own workspace with `vortex code -s <server>` (generated as
139
+ `.vscode/<server>.code-workspace`, containing only that server's apps and
140
+ exactly its jars).
141
+
142
+ `vortex use <server>` still sets the default server for commands that have no
143
+ IDs to infer from (`list`, `log`, `db`, `execute`, `new`):
144
+
145
+ ```
146
+ vortex use production
147
+ vortex list
148
+ ```
149
+
150
+ #### Credentials
151
+
152
+ `username`/`password` can be left out of `servers.ini`. Each server's
153
+ credentials resolve in this order and are only requested when a command
154
+ actually connects to that server:
155
+
156
+ 1. The system keyring - store with `vortex config --set-password -s <server>`
157
+ (requires `pip install keyring`)
158
+ 2. Per-server environment variables `VORTEX_USERNAME_<SERVER>` /
159
+ `VORTEX_PASSWORD_<SERVER>` (e.g. `VORTEX_PASSWORD_DEV`)
160
+ 3. `VORTEX_USERNAME` / `VORTEX_PASSWORD`
161
+ 4. An interactive prompt naming the server
162
+
163
+ #### Protected Servers
164
+
165
+ Set `protected = true` on a server definition (e.g. production) to make it
166
+ hard to change by accident:
167
+
168
+ - Write operations (`delete`, `copy`, `new`, `import`, `db --update`,
169
+ `execute`, `schema` changes, `compile --upload`) require the server name to
170
+ be typed back to continue. This is deliberately **not** bypassed by `--yes`.
171
+ - `vortex watch` skips protected servers unless `--include-protected` is
172
+ given, so saving a file can never hot-deploy to production by accident.
173
+
174
+ ### Interactive Wizards
175
+
176
+ Run `vortex new object` or `vortex new app` without any flags to launch a step-by-step wizard:
177
+
178
+ ```
179
+ vortex new object
180
+ # → pick app from locally cloned list
181
+ # → pick design type
182
+ # → enter name
183
+ # → enter content type (resource/documentation only)
184
+ # → enter parent page, open action, save action (page only)
185
+ # → preview and confirm
186
+
187
+ vortex new app
188
+ # → enter name
189
+ # → pick from existing groups or enter a new one
190
+ # → enter description (optional)
191
+ # → preview and confirm
192
+ ```
193
+
194
+ ### Skipping Confirmation Prompts
195
+
196
+ Pass `--yes` (or `-y`) to skip Y/y confirmation prompts, useful for scripting:
197
+
198
+ ```
199
+ vortex --yes delete 123 456
200
+ vortex -y new object --name MyAction --app-id 10 --type action
201
+ ```
202
+
203
+ Note: `--yes` never bypasses the typed confirmation for servers marked
204
+ `protected = true`.
205
+
206
+ ### Compiling Java Design Objects
207
+
208
+ `vortex compile` (alias `build`) compiles an application's Java Design Objects into `zbin/`
209
+ with the **Eclipse compiler (ecj)** - the same compiler the VS Code Java extension uses,
210
+ downloaded once per workspace into `config/.tools/`. It runs via the `java` from `java_home`
211
+ in the server config, then `$JAVA_HOME`, then `PATH`; `--release` is derived from the
212
+ application's Java class version. ecj matters because Tornado loads each class from its own
213
+ design element: `'$'` **classes (`Foo$1.class`) are never uploaded to the server**, and unlike
214
+ javac, ecj compiles a `switch` over an enum into the class itself rather than a synthetic
215
+ `Foo$1.class`. Classes that still produce `$` files (genuine anonymous/inner classes) are
216
+ reported and **excluded from upload** - they would throw `NoClassDefFoundError` on the server.
217
+ If ecj can't be downloaded (offline), javac is used with a warning; `--javac PATH` forces
218
+ javac explicitly.
219
+
220
+ ```
221
+ vortex compile # compile all locally cloned apps for the server
222
+ vortex compile 13 # compile one app
223
+ vortex compile 13 --upload # also upload ALL compiled classes (full server refresh)
224
+ ```
225
+
226
+ While `vortex watch` is running, `--upload` isn't needed: saving a Java source uploads the
227
+ SOURCE, and the VS Code Java extension's incremental build (which **is** the Eclipse
228
+ compiler, ecj - the same compiler `vortex compile` downloads) writes the class files into
229
+ `zbin/`, where watch picks them up and uploads the DATA - always, even when the bytes are
230
+ unchanged, so a source change is always paired with its class on the server. `'$'`
231
+ nested-class files are never uploaded - a class compiled alongside `$` siblings is refused
232
+ with an error since it would fail on the server.
233
+ Use `vortex compile` for full-application rebuilds without the IDE.
234
+
235
+ ### Server-Provided Java Libraries
236
+
237
+ Compilation and IDE IntelliSense need the Puakma framework jar and the server's shared
238
+ libraries on the classpath. Instead of maintaining local copies, vortex downloads them from
239
+ each server's `webdesign` application (the `vortex` API's `systemjar` and `libraries`
240
+ endpoints) and caches them per server under `<workspace>/<host>/.lib/`:
241
+
242
+ - The cache is filled automatically the first time it's needed - on `clone`, `watch` and
243
+ `compile` - and never re-downloaded unless you ask.
244
+ - `vortex libs` shows what's cached for each server; `vortex libs --refresh` re-downloads
245
+ (add `-s <server>` for one server), e.g. after a server upgrade.
246
+ - `javac` (via `vortex compile`) and each app folder's VS Code Java settings use the app's
247
+ own server's cached jars, so identical class names on different servers/versions never
248
+ cross-contaminate.
249
+ - Servers whose `webdesign` app doesn't provide the `vortex` API yet fall back to the
250
+ `puakma.jar` bundled with vortex-cli plus any `lib_path` entries, with a warning.
251
+ - `vortex clean` keeps each host's `.lib` cache so the jars don't need
252
+ re-downloading; pass `--include-libs` to remove them as well.
253
+
254
+ ### Managing the Data Dictionary
255
+
256
+ `vortex schema` records design-time table and column definitions in the Puakma data
257
+ dictionary (the PMATABLE/ATTRIBUTE tables, which also back `vortex db --schema`) and prints
258
+ the matching DDL for you to run by hand. It never executes DDL, and deletes only remove
259
+ dictionary rows - never real tables or columns.
260
+
261
+ ```
262
+ vortex schema mydb --add-table invoice --description "Customer invoices"
263
+ vortex schema mydb --add-column invoice invoice_id --type BIGINT --pk --auto-increment
264
+ vortex schema mydb --add-column invoice total --type NUMERIC --size 10,2 --not-null
265
+ vortex schema mydb --add-column invoice customer_id --type BIGINT --ref customer.customer_id
266
+ vortex schema mydb --ddl invoice # print CREATE TABLE from the dictionary
267
+ ```
268
+
269
+ ### Agent Support Files
270
+
271
+ `vortex agent` copies bundled support files into the workspace `.vscode` directory so they are
272
+ included in the generated code-workspace: an `AGENTS.md` with Puakma ground rules for coding
273
+ agents (including pointers to the bundled Blackbook v2 architecture reference), a `CLAUDE.md`
274
+ that points Claude Code at `AGENTS.md`, a `.claude/skills/` library covering Puakma development
275
+ and the vortex workflow, and a `vortex.code-snippets` file with common Puakma Java/HTML
276
+ snippets. Existing files are never overwritten, so they are safe to customise. These files are
277
+ also generated automatically on `vortex --init` and before `vortex code` opens the workspace.
278
+
279
+ Workspaces created before AGENTS.md existed keep their full `CLAUDE.md` (existing files are
280
+ never touched); the new `AGENTS.md` is simply added alongside it.
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "vortex_cli"
8
- version = "4.20.1"
8
+ version = "5.0.0"
9
9
  description = "Vortex CLI"
10
10
  requires-python = ">=3.10"
11
11
  readme = { file = "README.md", content-type = "text/markdown" }
@@ -28,11 +28,22 @@ classifiers = [
28
28
  "Programming Language :: Python :: 3 :: Only"
29
29
  ]
30
30
 
31
+ [project.optional-dependencies]
32
+ keyring = ["keyring"]
33
+
31
34
  [project.entry-points."console_scripts"]
32
35
  vortex = "vortex.__main__:main"
33
36
 
34
37
  [tool.setuptools.package-data]
35
- vortex = ["lib/puakma-6.0.40.jar", "docs/Blackbook.pdf"]
38
+ vortex = [
39
+ "lib/puakma-6.0.40.jar",
40
+ "docs/Blackbook.pdf",
41
+ "docs/Blackbook v2.md",
42
+ "docs/index.html",
43
+ "docs/marked.min.js",
44
+ "templates/agent/*",
45
+ "templates/agent/skills/*/*",
46
+ ]
36
47
 
37
48
  [tool.mypy]
38
49
  check_untyped_defs = true
@@ -46,6 +57,10 @@ warn_unused_ignores = true
46
57
  module = ["tests.*", "testing.*"]
47
58
  disallow_untyped_defs = false
48
59
 
60
+ [[tool.mypy.overrides]]
61
+ module = ["keyring", "keyring.*"]
62
+ ignore_missing_imports = true
63
+
49
64
  [tool.ruff]
50
65
  # Exclude a variety of commonly ignored directories.
51
66
  exclude = [