@appland/appmap 3.133.0 → 3.134.0

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 (83) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/built/cmds/index/index.js +3 -3
  3. package/built/cmds/index/index.js.map +1 -1
  4. package/built/cmds/index/rpc.js +18 -7
  5. package/built/cmds/index/rpc.js.map +1 -1
  6. package/built/cmds/navie/help.js +122 -0
  7. package/built/cmds/navie/help.js.map +1 -0
  8. package/built/docs/CLA Instructions.pdf +0 -0
  9. package/built/docs/Code of Conduct for Contributors.pdf +0 -0
  10. package/built/docs/analysis/rules-reference.html +27 -0
  11. package/built/docs/appmap-overview.md +54 -0
  12. package/built/docs/community.md +27 -0
  13. package/built/docs/diagrams/dependency-map.md +63 -0
  14. package/built/docs/diagrams/flamegraph.md +91 -0
  15. package/built/docs/diagrams/how-it-works.md +60 -0
  16. package/built/docs/diagrams/index.md +20 -0
  17. package/built/docs/diagrams/sequence-diagram.md +75 -0
  18. package/built/docs/diagrams/trace-view.md +55 -0
  19. package/built/docs/guides/configuring-analysis.md +157 -0
  20. package/built/docs/guides/handling-large-appmaps.md +43 -0
  21. package/built/docs/guides/index.md +17 -0
  22. package/built/docs/guides/openapi.md +104 -0
  23. package/built/docs/guides/reading-sql-in-appmaps.md +67 -0
  24. package/built/docs/guides/refine-appmaps.md +186 -0
  25. package/built/docs/guides/reverse-engineering.md +375 -0
  26. package/built/docs/guides/runtime-code-review.md +108 -0
  27. package/built/docs/integrations/atlassian-compass.md +24 -0
  28. package/built/docs/integrations/atlassian-confluence.md +50 -0
  29. package/built/docs/integrations/docker.md +108 -0
  30. package/built/docs/integrations/github-actions.md +24 -0
  31. package/built/docs/integrations/index.md +17 -0
  32. package/built/docs/integrations/plantuml.md +65 -0
  33. package/built/docs/integrations/postman.md +29 -0
  34. package/built/docs/integrations/readme.md +38 -0
  35. package/built/docs/integrations/smartbear-swaggerhub.md +125 -0
  36. package/built/docs/navie/bring-your-own-key.md +98 -0
  37. package/built/docs/navie/demo.md +49 -0
  38. package/built/docs/navie/how-navie-works.md +26 -0
  39. package/built/docs/navie/how-to-use-navie.md +152 -0
  40. package/built/docs/navie/index.md +20 -0
  41. package/built/docs/reference/analysis-labels.md +48 -0
  42. package/built/docs/reference/analysis-rules.md +60 -0
  43. package/built/docs/reference/appmap-agent-js.md +215 -0
  44. package/built/docs/reference/appmap-client-cli.md +527 -0
  45. package/built/docs/reference/appmap-gradle-plugin.md +140 -0
  46. package/built/docs/reference/appmap-java.md +310 -0
  47. package/built/docs/reference/appmap-maven-plugin.md +163 -0
  48. package/built/docs/reference/appmap-node.md +185 -0
  49. package/built/docs/reference/appmap-python.md +395 -0
  50. package/built/docs/reference/appmap-ruby.md +514 -0
  51. package/built/docs/reference/github-action.md +164 -0
  52. package/built/docs/reference/index.md +23 -0
  53. package/built/docs/reference/jetbrains.md +119 -0
  54. package/built/docs/reference/license-key-install.md +73 -0
  55. package/built/docs/reference/remote-recording-api.md +97 -0
  56. package/built/docs/reference/uninstalling-appmap.md +109 -0
  57. package/built/docs/reference/vscode.md +125 -0
  58. package/built/docs/setup-appmap-in-ci/example-projects.md +20 -0
  59. package/built/docs/setup-appmap-in-ci/how-it-works.md +42 -0
  60. package/built/docs/setup-appmap-in-ci/in-circleci.md +422 -0
  61. package/built/docs/setup-appmap-in-ci/in-github-actions.md +176 -0
  62. package/built/docs/setup-appmap-in-ci/index.md +21 -0
  63. package/built/docs/setup-appmap-in-ci/matrix-builds.md +224 -0
  64. package/built/docs/setup-appmap-in-ci/troubleshooting.md +70 -0
  65. package/built/docs/setup-appmap-in-your-code-editor/add-appmap-to-your-code-editor.md +43 -0
  66. package/built/docs/setup-appmap-in-your-code-editor/appmap-analysis.md +76 -0
  67. package/built/docs/setup-appmap-in-your-code-editor/generate-appmaps-from-tests.md +92 -0
  68. package/built/docs/setup-appmap-in-your-code-editor/generate-appmaps-with-remote-recording.md +111 -0
  69. package/built/docs/setup-appmap-in-your-code-editor/generate-appmaps-with-request-recording.md +79 -0
  70. package/built/docs/setup-appmap-in-your-code-editor/how-appmap-works.md +165 -0
  71. package/built/docs/setup-appmap-in-your-code-editor/index.md +23 -0
  72. package/built/docs/setup-appmap-in-your-code-editor/navigating-appmaps.md +58 -0
  73. package/built/docs/setup-appmap-in-your-code-editor/navigating-code-objects.md +66 -0
  74. package/built/docs/unused_for_now_index.html +11 -0
  75. package/built/rpc/appmap/stats.js +1 -1
  76. package/built/rpc/appmap/stats.js.map +1 -1
  77. package/built/rpc/explain/explain.js +6 -1
  78. package/built/rpc/explain/explain.js.map +1 -1
  79. package/built/rpc/explain/navie/navie-local.js +6 -2
  80. package/built/rpc/explain/navie/navie-local.js.map +1 -1
  81. package/built/rpc/explain/navie/navie-remote.js +5 -1
  82. package/built/rpc/explain/navie/navie-remote.js.map +1 -1
  83. package/package.json +3 -3
@@ -0,0 +1,527 @@
1
+ ---
2
+ layout: docs
3
+ title: Docs - Reference
4
+ toc: true
5
+ reference: true
6
+ step: 9
7
+ name: Command line interface (CLI)
8
+ redirect_from: [docs/reference/appmap-swagger-ruby]
9
+ ---
10
+
11
+ # Command line interface (CLI)
12
+
13
+ - [Command line interface (CLI)](#command-line-interface-cli)
14
+ - [Overview](#overview)
15
+ - [Prerequisites](#prerequisites)
16
+ - [Install AppMap CLI Precompiled Binary](#install-appmap-cli-precompiled-binary)
17
+ - [Usage](#usage)
18
+ - [`install`](#install)
19
+ - [`inspect`](#inspect)
20
+ - [`sequence-diagram`](#sequence-diagram)
21
+ - [`sequence-diagram-diff`](#sequence-diagram-diff)
22
+ - [`openapi`](#openapi)
23
+ - [`prune`](#prune)
24
+ - [`archive`](#archive)
25
+ - [`restore`](#restore)
26
+ - [`compare`](#compare)
27
+ - [`compare-report`](#compare-report)
28
+ - [GitHub repository](#github-repository)
29
+
30
+ ## Overview
31
+
32
+ The AppMap CLI provides utility commands to install AppMap client libraries and work with AppMaps.
33
+
34
+ ## Prerequisites
35
+
36
+ ### Install AppMap CLI Precompiled Binary
37
+
38
+ AppMap publishes binaries of the command-line installer for various operating systems, you can find the most recent version of the [AppMap command-line installer on GitHub](https://github.com/getappmap/appmap-js/releases?q=%40appland%2Fappmap*&expanded=true). Expand the "Assets" section to find binaries for Windows, Mac, and Linux.
39
+
40
+ Save this file locally and rename it to `appmap` (or `appmap.exe` for Windows). If you intend to access it from the command-line, ensure that you place the binary somewhere on your `PATH`.
41
+
42
+ The AppMap binary is all that is necessary to run the AppMap CLI (or `appmap.exe` for Windows).
43
+
44
+ ## Usage
45
+
46
+ Run the precompiled binary on the command line.
47
+
48
+ ```console
49
+ $ appmap --help
50
+ ```
51
+ {: .example-code}
52
+
53
+ ## `install`
54
+
55
+ Open a terminal window in the top level folder of your project and run this command:
56
+
57
+ ```console
58
+ $ appmap install
59
+ ```
60
+ {: .example-code}
61
+
62
+ You will be guided through a series of steps for installing and configuring AppMap. Additionally, you'll have an option to auto-commit the library and configuration file to your repo, so that the rest of your team can use AppMap without having to repeat the setup process.
63
+
64
+ ```
65
+ Installing AppMap agent for ....
66
+ ? AppMap is about to be installed. Confirm the details below.
67
+ Project type: Bundler
68
+ Project directory: /Users/username/repos/sample_rails_app
69
+ Git remote: origin git@github.com:land-of-apps/sample_rails_app.git (fetch)
70
+ Ruby version: 3.1.2p20
71
+ Gem home: /Users/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0
72
+
73
+ ? AppMap is about to be installed. Confirm the details below.
74
+ ? Commit these files to your repo so that everyone on your team can use AppMap
75
+ without them having to repeat the setup process. Bring runtime code analysis
76
+ to your whole team!
77
+ Gemfile
78
+ Gemfile.lock
79
+ appmap.yml
80
+
81
+ Commit? Yes
82
+ ✔ Validating the AppMap agent...
83
+
84
+ ╭─────────────────────────────────────────────────────────────────────╮
85
+ │ │
86
+ │ Success! AppMap has finished installing. │
87
+ │ │
88
+ │ NEXT STEP: Record AppMaps │
89
+ │ │
90
+ │ You can consult the AppMap documentation, or continue with the │
91
+ │ instructions provided in the AppMap code editor extension. │
92
+ │ │
93
+ ╰─────────────────────────────────────────────────────────────────────╯
94
+ ```
95
+
96
+ The installer changes your project's build process (yarn.lock for
97
+ JavaScript, Gemfile for Ruby, etc) to run AppMap when the tests run
98
+ and when developing locally. It will not be added to your production system.
99
+
100
+ ## `inspect`
101
+
102
+ Search AppMaps for references to a code object (package, function, class, query, route, etc) and print available event info.
103
+
104
+ ```console
105
+ $ appmap inspect --help
106
+ ```
107
+ {: .example-code}
108
+
109
+ ```
110
+ appmap inspect <code-object>
111
+
112
+ Positionals:
113
+
114
+ code-object identifies the code-object to inspect [required]
115
+
116
+ Options:
117
+ --version Show version number [boolean]
118
+ -v, --verbose Run with verbose logging [boolean]
119
+ --help Show help [boolean]
120
+ --appmap-dir directory to recursively inspect for AppMaps
121
+ [default: "tmp/appmap"]
122
+ -i, --interactive interact with the output via CLI [boolean]
123
+ ```
124
+
125
+ You can use this command to search and display events and associated data from across all the AppMaps in a directory (recursively explored).
126
+
127
+ The `code-object` argument is a required argument, composed of a type and identifier. The inspect command will find all events that match this code object across all the AppMaps. Whether an event matches the `code-object` argument is defined as follows:
128
+
129
+ | code-object type | match criteria |
130
+ | -----------------|----------------|
131
+ | function | The event is a call to the specified function |
132
+ | class | The event is a call to any function on the specified class |
133
+ | package |The event is a call to any function on any class in the specified package |
134
+ | database | The event is a SQL query |
135
+ | table | The event is a SQL query which includes the specified table |
136
+ | query | The event is a SQL query which, when normalized, matches the specified query |
137
+ | route | The event is an HTTP server request which matches the specified route method and normalized path. |
138
+
139
+ Examples of supported search syntax:
140
+
141
+ * `function:my/package/My::Class#instance_method`
142
+ * `function:my/package/My::Class.static_method`
143
+ * `class:my/package/My::Class`
144
+ * `package:my/package`
145
+ * `table:table_name`
146
+ * `database:`
147
+ * `route:REQUEST_METHOD /route/:id` (HTTP request method followed by normalized path)
148
+ * `query:SELECT * FROM tables WHERE some_column = ?` (normalized SQL)
149
+
150
+ ### Interactive mode
151
+
152
+ With the `--interactive` option, the results are presented in table form, and you can refine and drill into the data using the command line.
153
+
154
+ ```console
155
+ $ appmap inspect --interactive
156
+ ```
157
+ {: .example-code}
158
+
159
+ Without the `--interactive` option, all matching results are printed as JSON. This mode is suitable for searching AppMaps and printing results that can be piped into other scripts (e.g. using [jq](https://stedolan.github.io/jq/)) for further processing.
160
+
161
+ **Interactive mode arguments**
162
+
163
+ #### (h)ome
164
+
165
+ The home screen is displayed at the beginning of interactive mode. The `(h)ome` command will generally return you to the home screen, when you are in other parts of the app.
166
+
167
+ The home screen presents the following data:
168
+
169
+ | Field index | Field name | Description |
170
+ |-------------|------------|-------------|
171
+ | 1 | Events | A list of AppMaps and event indices that match the initial search term and filters. |
172
+ | 2 | Return values | Enumeration of all the different values returned by the matching object (most applicable when searching for a function). |
173
+ | 3 | HTTP server requests | Distinct routes in which the code object is found. Each listed result is a unique request method, normalized path, and status code. |
174
+ | 4 | SQL queries | Unique normalized SQL which is a descendant (or self) of the matching code object. |
175
+ | 5 | SQL tables | Unique tables which are found in the SQL queries, as defined in field 4. |
176
+ | 6 | Callers | Unique functions which are the parent of each matching code object. |
177
+ | 7 | Ancestors | Unique HTTP server requests and labeled functions which appear as an ancestor of a matching code object. |
178
+ | 8 | Descendants | Unique labeled functions which appear as a descendant of a matching code object. |
179
+ | 9 | Package trigrams | Unique combinations of caller → code-object → calee, converted to package names. |
180
+ | 10 | Class trigrams | Unique combinations of caller → code-object → calee, converted to class names. |
181
+ | 11 | Function trigrams | Unique combinations of caller → code-object → calee, as functions, SQL, or HTTP client requests. |
182
+
183
+ On the home screen, a field is displayed if there are only a small number of distinct values. Otherwise, the number of distinct values is shown, and you can use the `(p)rint` command to see the full details.
184
+
185
+ #### (p)rint
186
+
187
+ Prints the full details of a numbered field. Unlike the `(h)ome` view, which will summarize fields with many values, the `(p)rint` command will always print out all the distinct values of a field (even if there are thousands of them…).
188
+
189
+ #### (f)ilter
190
+
191
+ Applies a filter to the result set. You can use this command to reduce the number of search matches that are displayed, both on the `(h)ome` screen and in the `(p)rint` views.
192
+
193
+ When you choose the `(f)ilter` command, you’re first prompted to select which field you want to choose the filter value from. For example, you may see a table that includes `(2) Return values (3) HTTP server requests (6) Callers`. On choosing one of these fields, you are then prompted to select a value. The values will be the same as if you chose to `(p)rint` the selected field. Each field value is numbered; enter the number of the field value to activate it as a filter.
194
+
195
+ The result set is then recomputed, matching only events that match BOTH the main code-object argument that you initially provided to the search command, AND the filter.
196
+
197
+ For example, if you searched for `table:users` and then filtered by `request:GET /user 200`, the search would match every query that accesses the users table within an HTTP `GET` request to `/user` that returns status code `200`.
198
+
199
+ If you apply another filter, then BOTH filter conditions must match each result.
200
+
201
+ #### (u)ndo filter
202
+
203
+ Un-apply the most recently applied filter.
204
+
205
+ #### (r)eset filters
206
+
207
+ Remove all filters.
208
+
209
+ #### (q)uit
210
+
211
+ Quit the interactive program.
212
+
213
+ ## `sequence-diagram`
214
+
215
+ ```
216
+ appmap sequence-diagram <appmap...>
217
+
218
+ Generate a sequence diagram for an AppMap
219
+
220
+ Positionals:
221
+ appmap [array] [required] [default: []]
222
+
223
+ Options:
224
+ --version Show version number [boolean]
225
+ -v, --verbose Run with verbose logging [boolean]
226
+ --help Show help [boolean]
227
+ -d, --directory program working directory [string]
228
+ --output-dir directory in which to save the sequence diagrams
229
+ --show-browser when using a browser to render the diagram, show the
230
+ browser window [boolean] [default: false]
231
+ --loops identify loops and collect under a Loop object
232
+ [boolean] [default: true]
233
+ -f, --format output format
234
+ [choices: "png", "plantuml", "json"] [default: "png"]
235
+ --filter Filter to use to prune the map [string]
236
+ --exclude code objects to exclude from the diagram [deprecated]
237
+ --expand code objects to expand in the diagram
238
+ ```
239
+
240
+ For example, to generate a PNG of an AppMap named `example`, but with two packages named `com.techcom.models` and `com.techcom.views` expanded into their constituent classes on separate lifelines:
241
+
242
+ ```
243
+ appmap sequence-diagram --expand package:com/techcom/models --expand package:com/techcom/views example.appmap.json
244
+ ```
245
+
246
+ ### sequence-diagram-diff
247
+
248
+ ```
249
+ appmap sequence-diagram-diff base-diagram head-diagram
250
+
251
+ Diff sequence diagrams that are represented as JSON
252
+
253
+ Positionals:
254
+ base-diagram base diagram file or directory to compare [required]
255
+ head-diagram head diagram file or directory to compare [required]
256
+
257
+ Options:
258
+ --version Show version number [boolean]
259
+ -v, --verbose Run with verbose logging [boolean]
260
+ --help Show help [boolean]
261
+ -d, --directory program working directory [string]
262
+ --output-dir directory in which to save the sequence diagrams
263
+ [default: "."]
264
+ --format output format
265
+ [choices: "plantuml", "json"] [default: "plantuml"]
266
+ ```
267
+
268
+
269
+ ## `openapi`
270
+
271
+ ```console
272
+ $ appmap openapi --help
273
+ ```
274
+ {: .example-code}
275
+
276
+ ```
277
+ appmap openapi
278
+
279
+ Generate OpenAPI from AppMaps in a directory
280
+
281
+ Options:
282
+ --version Show version number [boolean]
283
+ -v, --verbose Run with verbose logging [boolean]
284
+ --help Show help [boolean]
285
+ --appmap-dir directory to recursively inspect for AppMaps
286
+ [default: "tmp/appmap"]
287
+ -o, --output-file output file name
288
+ --openapi-template template YAML; generated content will be placed in the
289
+ paths and components sections
290
+ --openapi-title info/title field of the OpenAPI document
291
+ --openapi-version info/version field of the OpenAPI document
292
+ ```
293
+
294
+ Use this command to generate OpenAPI documentation from all AppMaps in a directory
295
+ (recursively explored).
296
+
297
+ `openapi` ships with a default `yml` template but you can use a custom template if
298
+ you specify its file with the optional `--openapi-template` parameter.
299
+
300
+ The `--openapi-title` and `--openapi-version` parameters override the values of the
301
+ `info/title` and `info/version` properties in the generated document.
302
+
303
+ ## `prune`
304
+
305
+ Use this command to remove events from an AppMap, to make it have better performance, and to make it easier to understand.
306
+
307
+ Pruning works by finding the most repetitive calls in the map and then removing events associated with those calls. Non-application events such as HTTP requests and SQL queries will always be retained.
308
+
309
+ ### Usage
310
+
311
+ The `prune` command expects either a `--size` argument or a `--filter` argument. It will not work if neither are provided. Using the `--size` argument allows you to automatically shrink the AppMap file to a specified file size, while the `--filter` option allows you to specify what events to remove.
312
+
313
+ ### Arguments
314
+
315
+ You must provide either a `--size` argument or a `--filter` argument. You can find more information about the prune command by using the `--help` argument:
316
+
317
+ ```console
318
+ $ appmap prune --help
319
+ ```
320
+ {: .example-code}
321
+
322
+ ```
323
+ appmap prune <file>
324
+
325
+ Make an appmap file smaller by removing events
326
+
327
+ Positionals:
328
+ file AppMap to prune [required]
329
+
330
+ Options:
331
+ --version Show version number [boolean]
332
+ -v, --verbose Run with verbose logging [boolean]
333
+ --help Show help [boolean]
334
+ -o, --output-dir Specifies the output directory [string] [default: "."]
335
+ --format How to format the output
336
+ [choices: "json", "text"] [default: "text"]
337
+ -s, --size Prune input file to this size [string] [default: "15mb"]
338
+ -d, --directory Working directory for the command [string]
339
+ --filter Filter to use to prune the map [string]
340
+ --output-data Whether to output all AppMap data or just output what was
341
+ removed [boolean]
342
+ ```
343
+
344
+ ### Prune to a specific file size
345
+
346
+ The simplest way to use the `prune` command is to provide a target size for the map. The prune command will automatically
347
+ remove functions until the desired size is reached. Using the `prune` command in this way does not give you control over what
348
+ gets removed, but often times the removed functions are relatively uninteresting (getters, setters, etc.).
349
+
350
+ ### Prune specific events
351
+
352
+ The most powerful way to use the `prune` command is to pass it specific instructions about which events to remove. This is done by
353
+ using the `--filter` option. Here are the steps for using this technique:
354
+
355
+ 1. Open an AppMap in the code editor.
356
+ 2. Use the filtering available in the AppMap to hide certain events. ![AppMap Filtering](/assets/img/docs/using_appmap_filter.jpg)
357
+ 3. Open the command pallette using `CTRL+SHIFT+P` or `COMMAND+SHIFT+P` on macOS, type `AppMap: Copy Current AppMap State to Clipboard`, then hit `Enter`.
358
+ 4. Use the copied state as the `--filter` argument to the `prune` command. The `prune` command will remove whatever was filtered in the AppMap in your code editor.
359
+
360
+ ```shell
361
+ $ appmap prune <APPMAP_FILE> --filter eyJjdXJyZW50VmlldyI6InZpZXdTZXF1ZW5jZSIsImZpbHRlcnMi
362
+ ```
363
+ {: .example-code}
364
+
365
+ ## `archive`
366
+
367
+ Use this command locally, or [in CI](/docs/analysis/in-ci.html), to build a compressed archive of AppMaps from a directory containing AppMaps. Running this command without additional options will result in a "full" archive created at `.appmap/archive/full/{git revision}.tar`. Example: `.appmap/archive/full/028e610386f2fc132c93e613f57011825a8ae6e0.tar`
368
+
369
+ ### Usage
370
+
371
+ The `archive` command does not require any arguments to run, but must be run in a git project with a valid appmap.yml file with AppMaps located in the directory defined by `appmap_dir:` in the configuration.
372
+
373
+ ### Arguments
374
+ ```
375
+ appmap archive
376
+
377
+ Build an AppMap archive from a directory containing AppMaps
378
+
379
+ Options:
380
+ --version Show version number [boolean]
381
+ -v, --verbose Run with verbose logging [boolean]
382
+ --help Show help [boolean]
383
+ -d, --directory program working directory [string]
384
+ -t, --type archive type
385
+ [choices: "full", "incremental", "auto"] [default: "auto"]
386
+ -r, --revision revision identifier.
387
+
388
+ If not explicitly specified, the current git revision
389
+ will be used.
390
+ When this command is used in an CI server, it's best
391
+ to explicitly the provide the revision
392
+ from an environment variable provided by the CI
393
+ system, such as GITHUB_HEAD_SHA, because the
394
+ commit of the current git revision may not be the one
395
+ that triggered the build. [string]
396
+ --output-dir directory in which to save the output file. By
397
+ default, it's .appmap/archive/<type>. [string]
398
+ -f, --output-file output file name. Default output name is
399
+ <revision>.tar [string]
400
+ --analyze, --index whether to analyze the AppMaps
401
+ [boolean] [default: true]
402
+ --max-size maximum AppMap size that will be processed, in
403
+ filesystem-reported MB [default: 50]
404
+ --filter filter to apply to AppMaps when normalizing them into
405
+ sequence diagrams [string]
406
+ --thread-count Number of worker threads to use when analyzing AppMaps
407
+ [number]
408
+ ```
409
+
410
+ ## `restore`
411
+ Use this command locally, or [in CI](/docs/analysis/in-ci.html), to download the most current available AppMap data from the available archives. The archived AppMap data can be stored locally or within a GitHub artifact store (if you are using the [GitHub Integration](/docs/analysis/in-github-actions.html)). The archive filename must match the git revision requested to be restored.
412
+
413
+ ### Usage
414
+
415
+ The `restore` command does not require any arguments to run. By default, it will look for a valid AppMap tarball in the following location: `.appmap/archive/{full,incremental}/{git revision}.tar`. After finding a valid AppMap tarball in the default location, the command will extract the archive to the `.appmap/work/{git revision}` directory.
416
+
417
+ ### Arguments
418
+ ```
419
+ appmap restore
420
+
421
+ Restore the most current available AppMap data from available archives
422
+
423
+ Options:
424
+ --version Show version number [boolean]
425
+ -v, --verbose Run with verbose logging [boolean]
426
+ --help Show help [boolean]
427
+ -d, --directory program working directory [string]
428
+ -r, --revision revision to restore [string]
429
+ --output-dir directory in which to restore the data. Default:
430
+ .appmap/work/<revision> [string]
431
+ --archive-dir directory in which the archives are stored
432
+ [string] [default: ".appmap/archive"]
433
+ --github-repo Fetch AppMap archives from artifacts on a GitHub
434
+ repository. GITHUB_TOKEN must be set for this option to
435
+ work. [string]
436
+ --exact fail unless the specific revision requested is available to
437
+ be restored [boolean] [default: false]
438
+ ```
439
+
440
+ ## `compare`
441
+
442
+ Use this command locally, or [in CI](/docs/analysis/in-ci.html), to compare code behavior by analyzing two sets of AppMaps from different git revisions.
443
+ ### Usage
444
+
445
+ The `compare` command requires `--base-revision` to be passed to the command with a valid git SHA (i.e. `028e610386f2fc132c93e613f57011825a8ae6e0`). The head revision will be inferred based on the current git HEAD SHA for the git project in the current working directory.
446
+
447
+ When comparing two git revisions, you will need to use the [`restore`](#restore) command configuration flag `--output-dir` and set the output directory to `appmap/change-report/$base_revision-$head_revision/{base,head}`. For example if your base revision is `c01273ab4929e7d555aa8539f83c188aba42972d` and your head revision is `028e610386f2fc132c93e613f57011825a8ae6e0`, you will need to run the restore command on both revisions making sure your `--output-dir` looks like the following:
448
+
449
+ For the head revision (i.e. `028e610386f2fc132c93e613f57011825a8ae6e0`):
450
+ `--output-dir .appmap/change-report/$base_revision-$head_revision/head`
451
+ Example:
452
+ `--output-dir .appmap/change-report/c01273ab4929e7d555aa8539f83c188aba42972d-028e610386f2fc132c93e613f57011825a8ae6e0/head`
453
+
454
+ For the base revision (i.e. `c01273ab4929e7d555aa8539f83c188aba42972d`):
455
+ `--output-dir .appmap/change-report/$base_revision-$head_revision/base`
456
+ Example:
457
+ `--output-dir .appmap/change-report/028e610386f2fc132c93e613f57011825a8ae6e0-c01273ab4929e7d555aa8539f83c188aba42972d/base`
458
+
459
+ Both `base` and `head` directories will require restored appmaps before `compare` will run.
460
+
461
+ After successfully running, `compare` will output a `diff` directory of AppMaps and a `change-report.json` within the `.appmap/change-report/$base_revision-$head_revision/` directory.
462
+
463
+ ### Arguments
464
+ ```
465
+ appmap compare
466
+
467
+ Compare runtime code behavior between base and head revisions
468
+
469
+ Options:
470
+ --version Show version number [boolean]
471
+ -v, --verbose Run with verbose logging [boolean]
472
+ --help Show help [boolean]
473
+ -d, --directory program working directory [string]
474
+ -b, --base-revision, --base base revision name or commit SHA.
475
+ [required]
476
+ -h, --head-revision, --head head revision name or commit SHA. By
477
+ default, use the current commit.
478
+ --output-dir directory in which to save the
479
+ report files. Default is
480
+ ./.appmap/change-report/<base-revisi
481
+ on>-<head-revision>.
482
+ --clobber-output-dir remove the output directory if it
483
+ exists [boolean] [default: false]
484
+ --source-dir root directory of the application
485
+ source code [string] [default: "."]
486
+ --delete-unreferenced, whether to delete AppMaps from base
487
+ --delete-unchanged and head that are unreferenced by
488
+ the change report [default: true]
489
+ --report-removed whether to report removed findings,
490
+ such as removed API routes, resolved
491
+ findings, etc [default: true]
492
+ ```
493
+
494
+ ## `compare-report`
495
+
496
+ Use this command locally, or [in CI](/docs/analysis/in-ci.html), to generate a report document from comparison data generated by the [compare](#compare) command.
497
+
498
+ ### Usage
499
+
500
+ The `compare-report` command expects the `compare` command to have successfully executed against two git revisions and generated a `change-report.json` file. The `compare-report` command expects the first argument passed to it is the directory containing the `change-report.json`.
501
+
502
+ Example: `appmap compare-report .appmap/change-report/$base_revision-$head_revision`
503
+
504
+ ### Arguments
505
+ ```
506
+ appmap compare-report <report-directory>
507
+
508
+ Generate a report document from comparison data generated by the compare
509
+ command.
510
+
511
+ Positionals:
512
+ report-directory directory containing the comparison data [string] [required]
513
+
514
+ Options:
515
+ --version Show version number [boolean]
516
+ -v, --verbose Run with verbose logging [boolean]
517
+ --help Show help [boolean]
518
+ --source-url Base URL to link to a source file. The relative path to the
519
+ source file will be added to the URL path. [string]
520
+ --appmap-url Base URL to link to AppMaps. A 'path' parameter will be
521
+ added with the relative path from the report directory to
522
+ the AppMap JSON file. [string]
523
+ -d, --directory program working directory [string]
524
+ ```
525
+ ## GitHub repository
526
+
527
+ [https://github.com/getappmap/appmap-js/tree/main/packages/cli](https://github.com/getappmap/appmap-js/tree/main/packages/cli)
@@ -0,0 +1,140 @@
1
+ ---
2
+ layout: docs
3
+ title: Docs - Reference
4
+ toc: true
5
+ reference: true
6
+ name: AppMap for Java - Gradle Plugin
7
+ step: 7
8
+ ---
9
+
10
+ # AppMap Gradle plugin
11
+
12
+ - [AppMap Gradle plugin](#appmap-gradle-plugin)
13
+ - [About](#about)
14
+ - [Installation](#installation)
15
+ - [Tests recording](#tests-recording)
16
+ - [Plugin tasks](#plugin-tasks)
17
+ - [Plugin configuration](#plugin-configuration)
18
+ - [Troubleshooting](#troubleshooting)
19
+ - [GitHub repository](#github-repository)
20
+
21
+ ## About
22
+
23
+ The [AppMap Gradle Plugin](https://plugins.gradle.org/plugin/com.appland.appmap)
24
+ provides simple method for recording AppMaps in running
25
+ tests in Gradle projects, and a seamless integration into CI/CD pipelines. The
26
+ client agent requires `appmap.yml` configuration file, see
27
+ [appmap-java](./appmap-java/) for details.
28
+
29
+ ## Installation
30
+
31
+ First, ensure you have a
32
+ [properly configured `appmap.yml`](./appmap-java#configuration)
33
+ in your root project directory.
34
+
35
+ Next, add the following plugin definition and configuration to your `build.gradle` or `build.gradle.kts`.
36
+
37
+ 1. Add `com.appland.appmap` to plugins. You can find the latest plugin version on [plugins.gradle.org](https://plugins.gradle.org/plugin/com.appland.appmap).
38
+
39
+ Groovy:
40
+ ```groovy
41
+ plugins {
42
+ // other plugins here
43
+
44
+ id "com.appland.appmap" version "<latest-version>"
45
+ }
46
+ ```
47
+ {: .example-code}
48
+
49
+ Kotlin:
50
+ ```kotlin
51
+ plugins {
52
+
53
+ id("com.appland.appmap") version "<latest-version>"
54
+ }
55
+ ```
56
+ {: .example-code}
57
+
58
+ 2. Add appmap configuration (_optional_)
59
+
60
+ ```groovy
61
+ // Set Up AppMap agent, default parameters
62
+ appmap {
63
+ configFile = file("$projectDir/appmap.yml")
64
+ outputDirectory = file("$buildDir/appmap")
65
+ skip = false
66
+ debug = "info"
67
+ debugFile = file("$buildDir/appmap/agent.log")
68
+ eventValueSize = 1024
69
+ }
70
+ ```
71
+ {: .example-code}
72
+
73
+ ## Tests recording
74
+
75
+ The AppMap agent will automatically record your tests when you run
76
+ ```
77
+ gradle appmap test
78
+ ```
79
+ {: .example-code}
80
+
81
+ or
82
+
83
+ ```
84
+ gradlew appmap test
85
+ ```
86
+ {: .example-code}
87
+
88
+ By default, AppMap files are output to `$buildDir/appmap`.
89
+
90
+ ## Plugin tasks
91
+
92
+ - `appmap` - adds the AppMap Java agent to the JVM for the `test` task, must be explicitly called
93
+ - `appmap-validate-config` - validates if appmap.yml file exist, and it's readable
94
+ - `appmap-print-jar-path` - prints the path to the `appmap-agent.jar` file in the local Gradle cache
95
+
96
+ ## Plugin configuration
97
+
98
+ - `configFile` Path to the `appmap.yml` config file. Default: _./appmap.yml_
99
+ - `outputDirectory` Output directory for `.appmap.json` files. Default:
100
+ _.$buildDir/appmap_
101
+ - `skip` Agent won't record tests when set to true. Default: _false_
102
+ - `debug` Enable debug flags as a comma separated list. Accepts: `info`,
103
+ `hooks`, `http`, `locals` Default: _info_
104
+ - `debugFile` Specify where to output debug logs. Default:
105
+ _$buildDir/appmap/agent.log_
106
+ - `eventValueSize` Specifies the length of a value string before truncation
107
+ occurs. If set to 0, truncation is disabled. Default: _1024_
108
+
109
+ ## Troubleshooting
110
+
111
+ **I have no `$buildDir/appmap` directory**
112
+ It's likely that the agent is not running. Double check the `appmap` task is
113
+ being explicitly called and if the JVM is being forked at any point, make sure
114
+ the `javaagent` argument is being propagated to the new process.
115
+
116
+ **`*.appmap.json` files are present, but appear empty or contain little data**
117
+ Double check your `appmap.yml`. This usually indicates that the agent is
118
+ functioning as expected, but no classes or methods referenced in the
119
+ `appmap.yml` configuration are being executed. You may need to adjust the
120
+ packages being recorded. Follow [this link](./appmap-java#configuration) for more information.
121
+
122
+
123
+ **My tests aren't running, or I'm seeing
124
+ `The forked VM terminated without properly saying goodbye.`**
125
+ Check the agent log (defaults to `tmp/appmap/agent.log`) This is typically
126
+ indicative of an invalid `appmap.yml` configuration.
127
+
128
+ **I have a test failure that only occurs while the agent is attached**
129
+ Please open an issue at
130
+ [getappmap/appmap-java](https://github.com/getappmap/appmap-java/issues).
131
+ Attach a link to the source code or repository (if available), as well as any
132
+ other relevant information including:
133
+
134
+ - the contents of `appmap.yml`
135
+ - the run command used (such as `gradle appmap test`)
136
+ - output of the run command
137
+
138
+ ## GitHub repository
139
+
140
+ [https://github.com/getappmap/appmap-gradle-plugin](https://github.com/getappmap/appmap-gradle-plugin)