From 67a30b9287cf2a1a2e22799b077ae7345853a260 Mon Sep 17 00:00:00 2001 From: nikshankarnoble Date: Thu, 17 Sep 2026 00:36:29 +0930 Subject: [PATCH] fix(cli): correct linebreaks in command help. --- .../cli/commands/credential_helper/__init__.py | 10 ++++++---- .../cli/commands/credential_helper/docker.py | 9 ++++++++- .../cli/commands/credential_helper/terraform.py | 6 ++++-- cloudsmith_cli/cli/commands/domains.py | 1 + cloudsmith_cli/cli/commands/entitlements.py | 17 +++++++++-------- cloudsmith_cli/cli/commands/list_.py | 1 + cloudsmith_cli/cli/commands/mcp.py | 12 +++++++----- cloudsmith_cli/cli/commands/metadata.py | 1 + 8 files changed, 37 insertions(+), 20 deletions(-) diff --git a/cloudsmith_cli/cli/commands/credential_helper/__init__.py b/cloudsmith_cli/cli/commands/credential_helper/__init__.py index 5a9a06fd..bcf76528 100644 --- a/cloudsmith_cli/cli/commands/credential_helper/__init__.py +++ b/cloudsmith_cli/cli/commands/credential_helper/__init__.py @@ -27,18 +27,20 @@ def credential_helper(): manager automatically, or run the runtime command directly for debugging. Examples: + + \b # Install Docker credential helper $ cloudsmith credential-helper install docker - + \b # Install pnpm credential helper $ cloudsmith credential-helper install pnpm - + \b # Install cargo credential helper $ cloudsmith credential-helper install cargo - + \b # Test Docker credential helper directly $ echo "docker.cloudsmith.io" | cloudsmith credential-helper docker - + \b # Test pnpm credential helper directly $ cloudsmith credential-helper pnpm npm.cloudsmith.io """ diff --git a/cloudsmith_cli/cli/commands/credential_helper/docker.py b/cloudsmith_cli/cli/commands/credential_helper/docker.py index 25d3d81f..b64bb478 100644 --- a/cloudsmith_cli/cli/commands/credential_helper/docker.py +++ b/cloudsmith_cli/cli/commands/credential_helper/docker.py @@ -33,23 +33,30 @@ def docker(opts, operation): ``workspace`` in ``config.ini``; legacy aliases are also accepted - and a valid API key/token). + \b Input (stdin): Server URL as plain text (e.g. "docker.cloudsmith.io") + \b Output (stdout): JSON: {"Username": "token", "Secret": ""} + \b Exit codes: 0: Success 1: Error (no credentials available, not a Cloudsmith registry, etc.) + \b Examples: + + \b # Manual testing $ echo "docker.cloudsmith.io" | cloudsmith credential-helper docker - + \b # Called by Docker via launcher $ echo "docker.cloudsmith.io" | docker-credential-cloudsmith get + \b Environment variables: CLOUDSMITH_API_KEY: API key for authentication (optional) CLOUDSMITH_WORKSPACE: Workspace slug (CLOUDSMITH_ORG is also accepted) diff --git a/cloudsmith_cli/cli/commands/credential_helper/terraform.py b/cloudsmith_cli/cli/commands/credential_helper/terraform.py index 37c9adec..a152b548 100644 --- a/cloudsmith_cli/cli/commands/credential_helper/terraform.py +++ b/cloudsmith_cli/cli/commands/credential_helper/terraform.py @@ -92,13 +92,15 @@ def terraform(opts, repo, params): \b Examples: + + \b # Direct usage $ cloudsmith credential-helper terraform --repo my-repo terraform.cloudsmith.io {"token": "..."} - + \b # Terraform's calling convention (verb + hostname) $ cloudsmith credential-helper terraform --repo my-repo get terraform.cloudsmith.io - + \b # Select an org and profile explicitly (no env vars needed) $ cloudsmith credential-helper terraform --org=acme -P ci get terraform.cloudsmith.io diff --git a/cloudsmith_cli/cli/commands/domains.py b/cloudsmith_cli/cli/commands/domains.py index c4f42ae6..9c9fa28b 100644 --- a/cloudsmith_cli/cli/commands/domains.py +++ b/cloudsmith_cli/cli/commands/domains.py @@ -162,6 +162,7 @@ def list_domains( # pylint: disable=too-many-arguments paginated endpoint, so there is no benefit to hiding entries by default. Passing --page or --page-size switches to paged output. + \b Output (stdout): JSON: {"version": 1, "domains": [{"host": ..., "format": ..., "type": ..., "domain_type": ..., "workspace": ..., "repository": ..., diff --git a/cloudsmith_cli/cli/commands/entitlements.py b/cloudsmith_cli/cli/commands/entitlements.py index a505e43f..9b9d2e3f 100644 --- a/cloudsmith_cli/cli/commands/entitlements.py +++ b/cloudsmith_cli/cli/commands/entitlements.py @@ -775,14 +775,15 @@ def restrict( Full CLI example: - $ cloudsmith entitlements restrict cloudsmith/testing-private/9xGSdAxlIqIV \ - --limit-bandwidth=1 \ - --limit-bandwidth-unit=gigabyte \ - --limit-num-clients=10 \ - --limit-num-downloads=1000 \ - --limit-package-query="package-darwin-amd64 OR package-windows-amd64 OR package-linux-amd64" \ - --limit-path-query=tag:latest \ - --limit-date-range-from=2020-01-01T00:00:00Z \ + \b + $ cloudsmith entitlements restrict cloudsmith/testing-private/9xGSdAxlIqIV \\ + --limit-bandwidth=1 \\ + --limit-bandwidth-unit=gigabyte \\ + --limit-num-clients=10 \\ + --limit-num-downloads=1000 \\ + --limit-package-query="package-darwin-amd64 OR package-windows-amd64 OR package-linux-amd64" \\ + --limit-path-query=tag:latest \\ + --limit-date-range-from=2020-01-01T00:00:00Z \\ --limit-date-range-to=2077-01-01T00:00:00Z """ owner, repo, identifier = owner_repo_identifier diff --git a/cloudsmith_cli/cli/commands/list_.py b/cloudsmith_cli/cli/commands/list_.py index 2277f46a..02434898 100644 --- a/cloudsmith_cli/cli/commands/list_.py +++ b/cloudsmith_cli/cli/commands/list_.py @@ -195,6 +195,7 @@ def packages(ctx, opts, owner_repo, page, page_size, query, sort, page_all): --query 'name:^foo$ filename:.zip$ architecture:~x86' + \b You can sort the results using --sort with these fields: - date/-date: Sort by creation date - downloads/-downloads: Sort by download count diff --git a/cloudsmith_cli/cli/commands/mcp.py b/cloudsmith_cli/cli/commands/mcp.py index 7e2d0f04..dfeee816 100644 --- a/cloudsmith_cli/cli/commands/mcp.py +++ b/cloudsmith_cli/cli/commands/mcp.py @@ -200,6 +200,7 @@ def configure(ctx, opts, client, is_global): # pylint: disable=unused-argument """ Configure the Cloudsmith MCP server for supported clients. + \b This command automatically adds the Cloudsmith MCP server configuration to the specified client's configuration file. Supported clients are: - Claude Desktop @@ -211,11 +212,12 @@ def configure(ctx, opts, client, is_global): # pylint: disable=unused-argument For Claude Code, --global edits ~/.claude.json (user scope) and --local writes ./.mcp.json (project scope, intended to be committed). - Examples:\n - cloudsmith mcp configure --client claude\n - cloudsmith mcp configure --client claude-code\n - cloudsmith mcp configure --client cursor --local\n - cloudsmith mcp configure --client gemini-cli\n + \b + Examples: + cloudsmith mcp configure --client claude + cloudsmith mcp configure --client claude-code + cloudsmith mcp configure --client cursor --local + cloudsmith mcp configure --client gemini-cli cloudsmith mcp configure # Auto-detect and configure all """ diff --git a/cloudsmith_cli/cli/commands/metadata.py b/cloudsmith_cli/cli/commands/metadata.py index 7c37b84e..7f604044 100644 --- a/cloudsmith_cli/cli/commands/metadata.py +++ b/cloudsmith_cli/cli/commands/metadata.py @@ -463,6 +463,7 @@ def remove_metadata(ctx, opts, owner_repo_package, metadata_slug_perm, yes): """ Remove package metadata. + \b OWNER/REPO/PACKAGE: target package. METADATA_SLUG_PERM: permanent slug for the metadata entry.