Parameters Highlight

To bring attention to important parameters in your CLI examples use the fence plugin. Note: Parameter names gets matched as long as their names contain the passed value. cli ```cli {highlight: "important"} my-super-command paramA --important-flag=true ``` my-super-command paramA --important-flag=true ```cli {highlight: "important"} my-super-command paramA --important-flag=true another-command stop ``` my-super-command paramA --important-flag=true another-command stop

Include Plugin

Alternatively to fence plugin above, you can use include type. Note: options listed below are applicable to either form :include-cli-command: my-super-command paramA --important-flag=true {highlight: "important"} my-super-command paramA --important-flag=true

Long Commands

Long command lines will be automatically wrapped into multiple lines. Use parameter to specify the max length of a line before splitting: Use to force line splitting after specified parameter: Note: Unlike , must be an exact match another-command --score=2 --name=Name --value=8 --long-parameter-test --another-long-parameter1 --another-long-parameter2 --another-long3 threshold :include-cli-command: another-command --score=2 --name=Name --value=8 --long-parameter-test --another-long-parameter1 --another-long-parameter2 --another-long3 { highlight: ["name", "value"], threshold: 30 } another-command --score=2 --name=Name --value=8 --long-parameter-test --another-long-parameter1 --another-long-parameter2 --another-long3 splitAfter :include-cli-command: another-command --score=2 --name=Name --value=8 --long-parameter-test --another-long-parameter1 --another-long-parameter2 --another-long3 { highlight: ["name", "value"], splitAfter: ["--score=2", "--value=8"] } another-command --score=2 --name=Name --value=8 --long-parameter-test --another-long-parameter1 --another-long-parameter2 --another-long3 highlight splitAfter

Handle Special Symbols

If your command contains special symbols, such as , move the command definition to a option { command :include-cli-command: {command: "another-command {file1} [file2]", highlight: ["file1"]} another-command {file1} [file2]

From File

You can read a command from file. This option is useful for displaying a captured command during tests. :include-cli-command: {commandFile: "cli/command.txt", highlight: "value"} my-captured-command --param=10 --another=value my-captured-command --param=10 --another=value

ANSI Colors Output

CLI renders ANSI colors automatically. webtau:000> http.get("https://jsonplaceholder.typicode.com/todos/1") > executing HTTP GET https://jsonplaceholder.typicode.com/todos/1 . header.statusCode equals 200 matches: header.statusCode: actual: 200 <java.lang.Integer> expected: 200 <java.lang.Integer> (47ms) { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } . executed HTTP GET https://jsonplaceholder.typicode.com/todos/1 (342ms) webtau:000> http.get("https://jsonplaceholder.typicode.com/todos/1") > executing HTTP GET https://jsonplaceholder.typicode.com/todos/1 . header.statusCode equals 200 matches: header.statusCode: actual: 200 <java.lang.Integer> expected: 200 <java.lang.Integer> (47ms) { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } . executed HTTP GET https://jsonplaceholder.typicode.com/todos/1 (342ms) :include-cli-output: cli/ansi.out

Title

Use to specify output of the output webtau:000> http.get("https://jsonplaceholder.typicode.com/todos/1") > executing HTTP GET https://jsonplaceholder.typicode.com/todos/1 . header.statusCode equals 200 matches: header.statusCode: actual: 200 <java.lang.Integer> expected: 200 <java.lang.Integer> (47ms) { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } . executed HTTP GET https://jsonplaceholder.typicode.com/todos/1 (342ms) title :include-cli-output: cli/ansi.out {title: "captured output"}

Anchor

When you specify a title, hover mouse over it to see a clickable anchor. Use to override auto generated identifier. webtau:000> http.get("https://jsonplaceholder.typicode.com/todos/1") > executing HTTP GET https://jsonplaceholder.typicode.com/todos/1 . header.statusCode equals 200 matches: header.statusCode: actual: 200 <java.lang.Integer> expected: 200 <java.lang.Integer> (47ms) { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } . executed HTTP GET https://jsonplaceholder.typicode.com/todos/1 (342ms) anchorId :include-cli-output: cli/ansi.out { title: "captured output", anchorId: "my-output" }

Output Highlight

Use to highlight lines webtau:000> http.get("https://jsonplaceholder.typicode.com/todos/1") > executing HTTP GET https://jsonplaceholder.typicode.com/todos/1 . header.statusCode equals 200 matches: header.statusCode: actual: 200 <java.lang.Integer> expected: 200 <java.lang.Integer> (47ms) { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } . executed HTTP GET https://jsonplaceholder.typicode.com/todos/1 (342ms) Use to highlight lines based on the content of a file webtau:000> http.get("https://jsonplaceholder.typicode.com/todos/1") > executing HTTP GET https://jsonplaceholder.typicode.com/todos/1 . header.statusCode equals 200 matches: header.statusCode: actual: 200 <java.lang.Integer> expected: 200 <java.lang.Integer> (47ms) { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } . executed HTTP GET https://jsonplaceholder.typicode.com/todos/1 (342ms) :include-cli-output: cli/ansi.out { title: "captured output", "highlight": "GET https" } :include-cli-output: cli/ansi.out {highlightPath: "cli/file-path-of-asserted-lines.txt"} statusCode equals 200 executed HTTP GET

Wide Mode

Use option to occupy as much horizontal space as available long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output wide :include-cli-output: cli/wide-output.out { title: "Captured output", wide: true }

Extract Snippets

Use , to extract specific content by using marker lines. Mykolas-MacBook-Pro:znai-reactjs mykola$ git push Counting objects: 13, done. Delta compression using up to 8 threads. Compressing objects: 100% (13/13), done. Writing objects: 100% (13/13), 1.25 KiB | 0 bytes/s, done. Total 13 (delta 11), reused 0 (delta 0) remote: Resolving deltas: 100% (11/11), completed with 11 local objects. To https://github.com/testingisdocumenting/znai.git e310685..900e0be master -> master More on snippets extractions: Snippets Manipulation. startLine endLine :include-cli-output: cli/file-path-of-captured.out { title: "Limited captured output", startLine: "git push", endLine: "master -> master" }

Presentation Mode

In presentation mode, cli command related plugins will simulate typing inside the terminal. You can gradually reveal by providing parameter. Passed will highlight each line as a separate slide. Delta compression using up to 8 threads. Compressing objects: 100% (16/16), done. Writing objects: 100% (16/16), 1.34 KiB | 0 bytes/s, done. Total 16 (delta 14), reused 0 (delta 0) remote: Resolving deltas: 100% (14/14), completed with 10 local objects. To https://github.com/testingisdocumenting/znai.git ea44003..e310685 master -> master Mykolas-MacBook-Pro:znai-reactjs mykola$ git push Counting objects: 13, done. Delta compression using up to 8 threads. Compressing objects: 100% (13/13), done. Writing objects: 100% (13/13), 1.25 KiB | 0 bytes/s, done. Total 13 (delta 11), reused 0 (delta 0) remote: Resolving deltas: 100% (11/11), completed with 11 local objects. To https://github.com/testingisdocumenting/znai.git e310685..900e0be master -> master Mykolas-MacBook-Pro:znai-reactjs mykola$ git push Counting objects: 33, done. Delta compression using up to 8 threads. Compressing objects: 100% (33/33), done. Writing objects: 100% (33/33), 3.34 KiB | 0 bytes/s, done. Total 33 (delta 28), reused 0 (delta 0) remote: Resolving deltas: 100% (28/28), completed with 14 local objects. To https://github.com/testingisdocumenting/znai.git 900e0be..bb9993f master -> master cli-output revealLineStop :include-cli-output: cli/file-path-of-captured.out {revealLineStop: [0, 4], highlight: "remote"}