Generate a CLI Command Summary in Markdown
Generate a Markdown summary of JFrog CLI activity using the jf gsm command.
The jf generate-summary-markdown command (jf gsm) compiles recorded JFrog CLI activity into a single Markdown report. The file is written to <JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR>/jfrog-command-summary/markdown.md after you set the output directory and run the commands you want summarized.
Synopsis
jf generate-summary-markdownAliases: jf gsm
Arguments
The following table lists command arguments.
| Argument | Required | Description |
|---|---|---|
| (none) | — | This command takes no arguments |
Options
This command has no flags.
Environment Variables
The following table lists the environment variable.
| Variable | Required | Description |
|---|---|---|
JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR | Yes | Root directory for command summary data. The report is written to <DIR>/jfrog-command-summary/markdown.md |
Prerequisites
To satisfy configuration requirements for jf gsm:
- Ensure your JFrog server is configured with a JFrog Platform URL (not just the Artifactory URL).
jf gsmneeds the Platform URL to generate correct links in the report. - Run
jf config showand verify theJFrog Platform URLfield is present:
JFrog Platform URL: https://<YOUR_INSTANCE>.jfrog.io/- If the field is missing, re-add your server using
jf config add:
jf config add <server-id> \
--url="https://<platform-host>" \
--user="<username>" \
--password="<password>" \
--interactive=falseWhere:
<server-id>: Short name for this configuration (for exampleacme).<platform-host>: JFrog Platform host without a trailing path (for exampleacme.jfrog.io).<username>and<password>: Credentials with permission to use the CLI against that platform.
Example:
jf config add acme \
--url="https://acme.jfrog.io" \
--user="[email protected]" \
--password="your-secret" \
--interactive=falseIf no platform URL is in config, jf gsm fails with an error of this form (the CLI logs it as an [Error]):
failed to get server URL or major version: error extracting server details: no JFrog Platform URL specified, either via the --url flag or as part of the server configuration. This means markdown URLs will be invalidHow Command Summaries Work
The JFrog CLI uses a 2-phase approach for command summaries. While you run CLI commands (such as jf rt upload or jf rt build-publish), the CLI automatically writes summary data to JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR. This recording happens during normal command execution, and you do not need extra flags.
After your commands have run, jf gsm reads the recorded data and compiles it into a single Markdown report at <JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR>/jfrog-command-summary/markdown.md.
You must set JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR before you run the commands you want to capture.
Examples
Generate a Command Summary
To record CLI usage and produce a Markdown summary:
- Create and set the output directory:
mkdir -p /tmp/cli-summary
export JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR=/tmp/cli-summary- Run your JFrog CLI commands (summary data is recorded automatically):
jf rt upload ./my-artifact.zip my-repository/my-artifact.zip- Generate the Markdown summary:
jf gsm- Open the report:
cat /tmp/cli-summary/jfrog-command-summary/markdown.mdUse a Custom Output Directory
To write the summary under a project-relative directory:
- Run:
mkdir -p ./docs/usage
JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR=./docs/usage jf gsmWhen to Use
Use jf gsm in continuous integration and delivery (CI/CD) pipelines to generate a human-readable summary of all CLI commands run during a build. Common scenarios:
- Build reports: Attach the Markdown summary as a build artifact for auditing.
- Pull request comments: Post the summary as a pull request comment to show what was built and deployed.
- Documentation: Track CLI usage patterns across builds.
Important Notes
- The
JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIRenvironment variable must be set before you run any JFrog CLI commands you want to capture. The CLI records command summaries to this directory during execution, andjf gsmcompiles them. - The CLI creates the output directory automatically (including any missing parent directories) if it does not already exist, so you do not need to pre-create it.
- If no commands were recorded before running
jf gsm, the command exits successfully but produces no report file. - If a previous CLI command failed mid-run, it may leave an empty data file in the output directory. If
jf gsmprints[Warn] Failed to generate markdown for section: … unexpected end of JSON input, check for and remove zero-byte*-datafiles under<DIR>/jfrog-command-summary/.
Expected Output
The command writes a Markdown file to <JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR>/jfrog-command-summary/markdown.md. The content format depends on which commands were recorded. For example, after an upload command the report contains an HTML tree of the uploaded artifacts with links to the JFrog UI:
<pre>
📦 my-repository
└── <a href='https://example.jfrog.io/ui/repos/tree/General/my-repository/my-artifact.zip' target="_blank">my-artifact.zip</a>
</pre>Each command category (upload, build-info, security, evidence) generates its own section in the report.
Frequently Asked Questions
This section provides answers to frequently asked questions.
FAQs
Q: How do I generate a Markdown summary of my JFrog CLI commands?
A: Set JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR, run the JFrog CLI commands you want recorded, then run jf gsm to compile the report. See Generate a Command Summary for the full procedure.
Q: What happens if I run jf gsm without recording any commands first?
jf gsm without recording any commands first?A: The command exits successfully but produces no report file, because there's no recorded data to compile. See Important Notes.
Q: What do I need before using jf gsm?
jf gsm?A: Your JFrog server configuration must include a JFrog Platform URL, not just the Artifactory URL, so jf gsm can generate correct links in the report. See Prerequisites.
Q: Can I write the command summary to a custom directory?
A: Yes. Set JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR to any directory before running your commands. See Use a Custom Output Directory.
Related Topics
Updated 2 days ago
What’s Next
For setup details and supported commands, see the Command Summaries guide.
