aspera-cli 4.26.2 → 4.27.1

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 (159) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +310 -21
  4. data/CONTRIBUTING.md +99 -14
  5. data/TODO.md +50 -0
  6. data/bin/ascli +3 -3
  7. data/docs/README.md +10977 -0
  8. data/docs/test-mcp-with-ai.md +202 -0
  9. data/lib/aspera/agent/base.rb +29 -7
  10. data/lib/aspera/agent/connect.rb +58 -21
  11. data/lib/aspera/agent/desktop.rb +53 -18
  12. data/lib/aspera/agent/direct.rb +71 -40
  13. data/lib/aspera/agent/factory.rb +3 -3
  14. data/lib/aspera/agent/httpgw.rb +55 -14
  15. data/lib/aspera/agent/node.rb +34 -2
  16. data/lib/aspera/agent/transferd.rb +48 -12
  17. data/lib/aspera/api/alee.rb +1 -1
  18. data/lib/aspera/api/aoc.rb +42 -44
  19. data/lib/aspera/api/cos_node.rb +10 -9
  20. data/lib/aspera/api/faspex.rb +16 -15
  21. data/lib/aspera/api/httpgw.rb +23 -23
  22. data/lib/aspera/api/node.rb +51 -70
  23. data/lib/aspera/api/queries/bss_subscription_account.graphql +18 -0
  24. data/lib/aspera/api/queries/bss_subscription_usage.graphql +18 -0
  25. data/lib/aspera/ascmd.rb +32 -30
  26. data/lib/aspera/ascp/installation.rb +75 -69
  27. data/lib/aspera/ascp/management.rb +7 -8
  28. data/lib/aspera/assert.rb +12 -13
  29. data/lib/aspera/cli/ascp_actions.rb +155 -0
  30. data/lib/aspera/cli/async_transfer_store.rb +125 -0
  31. data/lib/aspera/cli/bootstrapper.rb +197 -0
  32. data/lib/aspera/cli/command_registry.rb +145 -0
  33. data/lib/aspera/cli/command_spec.rb +141 -0
  34. data/lib/aspera/cli/context.rb +19 -6
  35. data/lib/aspera/cli/error.rb +16 -0
  36. data/lib/aspera/cli/extended_value.rb +27 -26
  37. data/lib/aspera/cli/formatter.rb +95 -59
  38. data/lib/aspera/cli/gem_checker.rb +65 -0
  39. data/lib/aspera/cli/hints.rb +3 -3
  40. data/lib/aspera/cli/http.rb +74 -30
  41. data/lib/aspera/cli/info.rb +2 -0
  42. data/lib/aspera/cli/mailer.rb +97 -0
  43. data/lib/aspera/cli/mcp_tool.rb +225 -0
  44. data/lib/aspera/cli/option_declarator.rb +77 -0
  45. data/lib/aspera/cli/options.schema.yaml +634 -7
  46. data/lib/aspera/cli/parser.rb +1217 -0
  47. data/lib/aspera/cli/plugins/alee.rb +20 -22
  48. data/lib/aspera/cli/plugins/aoc.rb +1178 -881
  49. data/lib/aspera/cli/plugins/ats.rb +205 -162
  50. data/lib/aspera/cli/plugins/base.rb +703 -175
  51. data/lib/aspera/cli/plugins/basic_auth.rb +7 -9
  52. data/lib/aspera/cli/plugins/config.rb +434 -757
  53. data/lib/aspera/cli/plugins/console.rb +107 -65
  54. data/lib/aspera/cli/plugins/cos.rb +46 -33
  55. data/lib/aspera/cli/plugins/factory.rb +6 -6
  56. data/lib/aspera/cli/plugins/faspex5.rb +627 -388
  57. data/lib/aspera/cli/plugins/faspio.rb +54 -51
  58. data/lib/aspera/cli/plugins/httpgw.rb +18 -25
  59. data/lib/aspera/cli/plugins/mcp.rb +279 -0
  60. data/lib/aspera/cli/plugins/node.rb +988 -840
  61. data/lib/aspera/cli/plugins/oauth.rb +7 -10
  62. data/lib/aspera/cli/plugins/orchestrator.rb +112 -135
  63. data/lib/aspera/cli/plugins/preview.rb +195 -157
  64. data/lib/aspera/cli/plugins/server.rb +141 -91
  65. data/lib/aspera/cli/plugins/shares.rb +343 -110
  66. data/lib/aspera/cli/preset_actions.rb +159 -0
  67. data/lib/aspera/cli/preset_manager.rb +82 -39
  68. data/lib/aspera/cli/result.rb +78 -26
  69. data/lib/aspera/cli/runner.rb +323 -153
  70. data/lib/aspera/cli/secret_finder.rb +40 -0
  71. data/lib/aspera/cli/special_values.rb +1 -0
  72. data/lib/aspera/cli/sync_actions.rb +89 -64
  73. data/lib/aspera/cli/terminal_formatter.rb +3 -3
  74. data/lib/aspera/cli/transfer_actions.rb +90 -0
  75. data/lib/aspera/cli/transfer_agent.rb +129 -64
  76. data/lib/aspera/cli/transfer_progress.rb +9 -9
  77. data/lib/aspera/cli/vault_manager.rb +79 -0
  78. data/lib/aspera/cli/version.rb +1 -1
  79. data/lib/aspera/cli/wizard.rb +28 -30
  80. data/lib/aspera/colors.rb +3 -3
  81. data/lib/aspera/command_line_builder.rb +34 -34
  82. data/lib/aspera/command_line_converter.rb +1 -1
  83. data/lib/aspera/coverage.rb +1 -2
  84. data/lib/aspera/data_repository.rb +2 -1
  85. data/lib/aspera/dot_container.rb +12 -12
  86. data/lib/aspera/environment.rb +30 -23
  87. data/lib/aspera/exec_spec.rb +13 -0
  88. data/lib/aspera/faspex_gw.rb +5 -5
  89. data/lib/aspera/faspex_postproc.rb +16 -10
  90. data/lib/aspera/graphql.rb +37 -0
  91. data/lib/aspera/hash_ext.rb +8 -2
  92. data/lib/aspera/json_rpc/client.rb +62 -0
  93. data/lib/aspera/json_rpc/version.rb +7 -0
  94. data/lib/aspera/keychain/base.rb +10 -3
  95. data/lib/aspera/keychain/encrypted_hash.rb +92 -17
  96. data/lib/aspera/keychain/factory.rb +20 -8
  97. data/lib/aspera/keychain/hashicorp_vault.rb +1 -1
  98. data/lib/aspera/keychain/macos_security.rb +23 -25
  99. data/lib/aspera/keychain/one_password_api.rb +86 -0
  100. data/lib/aspera/keychain/one_password_base.rb +34 -0
  101. data/lib/aspera/keychain/one_password_cli.rb +98 -0
  102. data/lib/aspera/link_header.rb +82 -0
  103. data/lib/aspera/log.rb +29 -15
  104. data/lib/aspera/markdown.rb +90 -7
  105. data/lib/aspera/nagios.rb +8 -8
  106. data/lib/aspera/node_simulator.rb +35 -27
  107. data/lib/aspera/oauth/base.rb +9 -10
  108. data/lib/aspera/oauth/boot.rb +5 -5
  109. data/lib/aspera/oauth/factory.rb +12 -10
  110. data/lib/aspera/oauth/jwt.rb +9 -11
  111. data/lib/aspera/oauth/web.rb +6 -6
  112. data/lib/aspera/persistency_action_once.rb +12 -12
  113. data/lib/aspera/persistency_folder.rb +18 -11
  114. data/lib/aspera/preview/file_types.rb +5 -5
  115. data/lib/aspera/preview/generator.rb +52 -49
  116. data/lib/aspera/preview/options.rb +3 -2
  117. data/lib/aspera/preview/terminal.rb +5 -5
  118. data/lib/aspera/preview/utils.rb +66 -19
  119. data/lib/aspera/products/connect.rb +2 -2
  120. data/lib/aspera/products/desktop.rb +1 -1
  121. data/lib/aspera/products/other.rb +3 -3
  122. data/lib/aspera/products/transferd.rb +4 -4
  123. data/lib/aspera/proxy_auto_config.rb +15 -14
  124. data/lib/aspera/rest.rb +159 -151
  125. data/lib/aspera/rest_error_analyzer.rb +6 -6
  126. data/lib/aspera/rest_errors_aspera.rb +0 -10
  127. data/lib/aspera/rest_list.rb +11 -10
  128. data/lib/aspera/schema/IBM Aspera Node API-4.4.6.yaml +6232 -0
  129. data/lib/aspera/schema/IBM Aspera faspio Gateway API-1.0.0.yaml +249 -0
  130. data/lib/aspera/schema/IBM Aspera on Cloud API-0.2.6-enhanced.yaml +1853 -510
  131. data/lib/aspera/schema/IBM_Aspera_Shares.yaml +4653 -0
  132. data/lib/aspera/schema/documentation.rb +65 -28
  133. data/lib/aspera/schema/reader.rb +136 -13
  134. data/lib/aspera/schema/registry.rb +60 -8
  135. data/lib/aspera/secret_hider.rb +12 -7
  136. data/lib/aspera/ssh.rb +64 -31
  137. data/lib/aspera/ssl.rb +5 -5
  138. data/lib/aspera/sync/conf.schema.yaml +2 -2
  139. data/lib/aspera/sync/database.rb +2 -2
  140. data/lib/aspera/sync/operations.rb +22 -25
  141. data/lib/aspera/temp_file_manager.rb +25 -5
  142. data/lib/aspera/timer_limiter.rb +1 -1
  143. data/lib/aspera/transfer/faux_file.rb +24 -11
  144. data/lib/aspera/transfer/parameters.rb +36 -34
  145. data/lib/aspera/transfer/result.rb +74 -0
  146. data/lib/aspera/transfer/resumer.rb +10 -10
  147. data/lib/aspera/transfer/spec.rb +18 -1
  148. data/lib/aspera/transfer/spec.schema.yaml +12 -3
  149. data/lib/aspera/uri_reader.rb +52 -15
  150. data/lib/aspera/web_auth.rb +8 -7
  151. data/lib/aspera/web_server_simple.rb +15 -12
  152. data/lib/aspera/yaml.rb +5 -4
  153. data.tar.gz.sig +0 -0
  154. metadata +34 -6
  155. metadata.gz.sig +0 -0
  156. data/lib/aspera/cli/manager.rb +0 -766
  157. data/lib/aspera/cli/plugins/faspex.rb +0 -539
  158. data/lib/aspera/json_rpc.rb +0 -52
  159. data/lib/aspera/transfer/uri.rb +0 -56
data/CONTRIBUTING.md CHANGED
@@ -50,18 +50,111 @@ To submit a contribution, follow these steps:
50
50
  1. **Create a feature branch** specifically for your changes.
51
51
 
52
52
  1. **Implement** your feature or bug fix.
53
-
54
- 1. **Write tests** to ensure your changes are robust and prevent regressions.
55
-
56
- 1. **Run** `rubocop` to ensure your code adheres to the Ruby style guide.
57
-
58
- 1. **Update** `CHANGELOG.md` with a concise summary of your changes.
53
+ See [Development Cycle for a New CLI Command](#development-cycle-for-a-new-cli-command) for the complete checklist.
59
54
 
60
55
  1. **Submit a pull request** with a detailed description of your work.
61
56
 
62
57
  > [!TIP]
63
58
  > Keep pull requests focused; include only changes relevant to the specific feature or fix.
64
59
 
60
+ ### Development Cycle for a New CLI Command
61
+
62
+ When adding or modifying a CLI command, complete **every step** in the following order.
63
+ Each step is self-contained so that an automated agent can apply them independently.
64
+
65
+ #### 1 — Implement
66
+
67
+ - Add the command logic in the relevant plugin file under `lib/aspera/cli/plugins/`.
68
+ - If the command belongs to a mixin (e.g. `AscpActions`, `PresetActions`), add the method in the corresponding file under `lib/aspera/cli/`.
69
+ - Declare the new command with `command(...)` at class level and implement the corresponding `handle_<path>` method.
70
+ - For agent-related schemas, declare parameters in `lib/aspera/cli/options.schema.yaml` under `components/schemas/`.
71
+
72
+ #### 2 — Add tests in `tests/tests.yml`
73
+
74
+ Every new command needs at least one entry in `tests/tests.yml`.
75
+ Follow the naming convention `<plugin>_<sub>_<action>` (e.g. `conf_agents_list`).
76
+
77
+ - Add a **happy-path** test (no extra tags).
78
+ - Add a **failure test** for invalid input with tags `must_fail` and `nodoc`, and set `expect:` to a substring of the expected error message.
79
+ - Tests that should not appear in generated documentation get the `nodoc` tag.
80
+ - Insert the new entries near related tests (same plugin/sub-command group).
81
+
82
+ Minimal example:
83
+
84
+ ```yaml
85
+ conf_agents_list:
86
+ args:
87
+ - config
88
+ - agents
89
+ - list
90
+ conf_agents_show_bad:
91
+ tags:
92
+ - must_fail
93
+ - nodoc
94
+ expect: "unknown value"
95
+ args:
96
+ - config
97
+ - agents
98
+ - show
99
+ - badagent
100
+ ```
101
+
102
+ Run only the new tests to validate quickly:
103
+
104
+ ```shell
105
+ bundle exec rake test:run'[conf_agents_list conf_agents_show_bad]'
106
+ ```
107
+
108
+ #### 3 — Update `docs/README.erb.md`
109
+
110
+ `docs/README.erb.md` is the source for the generated documentation (`docs/README.md` and the PDF manual).
111
+ **Never edit `docs/README.md` directly.**
112
+
113
+ - Find the section closest to the new command (search for the parent command or a sibling).
114
+ - Add a short prose paragraph and one or more fenced `shell` blocks showing usage.
115
+ - Use ERB variables: `<%=cmd%>` for the tool name, `<%=tool%>` for the display name, `<%=ph :name%>` for placeholders.
116
+ - For parameter tables generated from JSON schema, use `<%=schema_to_table(Aspera::Schema::Registry::MY_SCHEMA_KEY)%>`.
117
+
118
+ Regenerate and verify:
119
+
120
+ ```shell
121
+ bundle exec rake doc:prep
122
+ ```
123
+
124
+ #### 4 — Update `CHANGELOG.md`
125
+
126
+ Add one bullet under `### New Features` (or `### Issues Fixed` / `### Breaking Changes`) in the current `.pre` section at the top of `CHANGELOG.md`.
127
+
128
+ Style rules:
129
+
130
+ - Plugin name in backticks: `` `config` ``, `` `aoc` ``, or `**global**` for cross-cutting changes.
131
+ - Command path and argument names in backticks.
132
+ - One sentence per bullet; end without a period.
133
+
134
+ Example:
135
+
136
+ ```markdown
137
+ * `config`: New commands `agents list`, `agents show <name>` and `agents parameters <name>` to discover available transfer agents, their short identifier and their configurable parameters
138
+ ```
139
+
140
+ #### 5 — Static analysis
141
+
142
+ ```shell
143
+ bundle exec rake tools:rubocop # Ruby style guide
144
+ bundle exec rake tools:reek # code smell detection
145
+ ```
146
+
147
+ Fix any new offence introduced by your changes before committing.
148
+ Pre-existing offences listed in `.rubocop_todo.yml` can be left as-is.
149
+
150
+ #### 6 — Full test suite
151
+
152
+ ```shell
153
+ bundle exec rake test:run
154
+ ```
155
+
156
+ All tests must pass (status `passed`) before opening a pull request.
157
+
65
158
  ## Architecture
66
159
 
67
160
  The `aspera-cli` architecture is designed to be modular and extensible.
@@ -312,11 +405,3 @@ bundle exec rake release_tag
312
405
  This triggers the `.github/workflows/deploy.yml` action to publish to RubyGems.
313
406
 
314
407
  - Update `version.rb` to the next `.pre` development version.
315
-
316
- ## Future Improvements
317
-
318
- - Evaluate replacing custom REST and OAuth implementations with standard gems:
319
- - [rest-client](https://github.com/rest-client/rest-client)
320
- - [oauth2](https://github.com/oauth-xx/oauth2)
321
- - Integrate `thor` <http://whatisthor.com/> or another standard Ruby CLI framework.
322
- - Explore [Traveling Ruby](https://github.com/phusion/traveling-ruby) for distribution, or [truby Traveling Ruby](https://github.com/trubygems/traveling-ruby).
data/TODO.md ADDED
@@ -0,0 +1,50 @@
1
+ # TODO
2
+
3
+ Ideas and TODO list.
4
+ Add improvement ideas here.
5
+
6
+ ## Preview: deletion of orphaned preview files
7
+
8
+ Deletion of preview files for deleted source files is not yet implemented.
9
+
10
+ ## Architecture: replace custom REST client with `rest-client` gem
11
+
12
+ Evaluate replacing the custom REST implementation with the standard
13
+ [`rest-client`](https://github.com/rest-client/rest-client) gem.
14
+
15
+ ## Architecture: replace custom OAuth client with `oauth2` gem
16
+
17
+ Evaluate replacing the custom OAuth 2.0 implementation with the standard
18
+ [`oauth2`](https://github.com/oauth-xx/oauth2) gem.
19
+
20
+ ## Architecture: explore Traveling Ruby for single-executable distribution
21
+
22
+ Explore [Traveling Ruby](https://github.com/phusion/traveling-ruby)
23
+ (or [truby Traveling Ruby](https://github.com/trubygems/traveling-ruby)) as an alternative
24
+ single-executable distribution method.
25
+
26
+ ## OCRAN packaging
27
+
28
+ ## Add `description:` to all `ArgumentSpec` declarations
29
+
30
+ The `description` field is user-facing (shown in `--help` output) and should be present on
31
+ every `ArgumentSpec`. Arguments that already carry a `schema:` key or whose name is
32
+ self-explanatory are lower priority, but all should have explicit descriptions eventually.
33
+
34
+ Example fix:
35
+
36
+ ```ruby
37
+ # Before
38
+ {name: :async_id, type: :identifier, lookup: :async_lookup}
39
+
40
+ # After
41
+ {name: :async_id, description: 'Async operation identifier', type: :identifier, lookup: :async_lookup}
42
+ ```
43
+
44
+ ## DSL: Scoped options declaration and contextual documentation
45
+
46
+ Improve the DSL to distinguish between global CLI options, plugin-level options, and command-scoped options:
47
+
48
+ - **DSL declaration**: Allow options to be declared with reduced/specific scopes (e.g., at command/subtree level via `command(..., options: [...])` or `scope:` parameter on `option`) in addition to global and plugin-wide options.
49
+ - **Contextual `--help`**: In `--help` output, display only options relevant to the targeted command/path (command-specific, plugin-wide, and global sections).
50
+ - **Documentation generation**: Enhance documentation generator to display scoped options only under the concerned commands.
data/bin/ascli CHANGED
@@ -20,9 +20,9 @@ Aspera::Log.instance.program_name = Aspera::Cli::Info::CMD_NAME
20
20
  ARGV.each do |arg|
21
21
  case arg
22
22
  when '--' then break
23
- when /^--log-level=(.*)/ then Aspera::Log.instance.level = Regexp.last_match(1).to_sym
24
- when /^--log-format=(.*)/ then Aspera::Log.instance.formatter = Regexp.last_match(1) unless Regexp.last_match(1).start_with?('@ruby:')
25
- when /^--logger=(.*)/ then Aspera::Log.instance.logger_type = Regexp.last_match(1).to_sym
23
+ when /^--log-level=(.*)/, /^--log\.level=(.*)/ then Aspera::Log.instance.level = Regexp.last_match(1).to_sym
24
+ when /^--log-format=(.*)/, /^--log\.format=(.*)/ then Aspera::Log.instance.formatter = Regexp.last_match(1) unless Regexp.last_match(1).start_with?('@ruby:')
25
+ when /^--logger=(.*)/, /^--log\.type=(.*)/ then Aspera::Log.instance.logger_type = Regexp.last_match(1).to_sym
26
26
  end
27
27
  rescue => e
28
28
  $stderr.puts("Error: #{e}") # rubocop:disable Style/StderrPuts