Skip to content

Improve the help doc for oras manifest index sub commands #1638

Description

@Wwwsylvia

Problem

Currently, the help doc for the oras manifest index create command looks like this:

$ oras manifest index create -h
[Experimental] Create and push an index from provided manifests. All manifests should be in the same repository

Example - Create an index from source manifests tagged 'linux-amd64' and 'linux-arm64', and push without tagging:
  oras manifest index create localhost:5000/hello linux-amd64 linux-arm64

Example - Create an index from source manifests tagged 'linux-amd64' and 'linux-arm64', and push with the tag 'v1':
  oras manifest index create localhost:5000/hello:v1 linux-amd64 linux-arm64

Example - Create an index from source manifests using both tags and digests, and push with tag 'v1':
  oras manifest index create localhost:5000/hello:v1 linux-amd64 sha256:99e4703fbf30916f549cd6bfa9cdbab614b5392fbe64fdee971359a77073cdf9

Example - Create an index and push it with multiple tags:
  oras manifest index create localhost:5000/hello:tag1,tag2,tag3 linux-amd64 linux-arm64 sha256:99e4703fbf30916f549cd6bfa9cdbab614b5392fbe64fdee971359a77073cdf9

Example - Create and push an index with annotations:
  oras manifest index create localhost:5000/hello:v1 linux-amd64 --annotation "key=val"

Example - Create an index and push to an OCI image layout folder 'layout-dir' and tag with 'v1':
  oras manifest index create --oci-layout layout-dir:v1 linux-amd64 sha256:99e4703fbf30916f549cd6bfa9cdbab614b5392fbe64fdee971359a77073cdf9

Example - Create an index and save it locally to index.json, auto push will be disabled:
  oras manifest index create --output index.json localhost:5000/hello linux-amd64 linux-arm64

Example - Create an index and output the index to stdout, auto push will be disabled:
  oras manifest index create localhost:5000/hello linux-arm64 --output - --pretty

Usage:
  oras manifest index create [flags] <name>[:<tag[,<tag>][...]] [{<tag>|<digest>}...]

Aliases:
  create, pack

There are two problems here that could potentially confuse users:

  1. The usage guide is not clear about which argument is the target to create and which are the source tags

Usage:
oras manifest index create [flags] [:<tag[,][...]] [{|}...]

  1. Looking at the example for using the --oci-layout flag, some users might think that the positional parameters are the argument of the --oci-layout flag, which is not the case

Example - Create an index and push to an OCI image layout folder 'layout-dir' and tag with 'v1':
oras manifest index create --oci-layout layout-dir:v1 linux-amd64 sha256:99e4703fbf30916f549cd6bfa9cdbab614b5392fbe64fdee971359a77073cdf9

Proposal

To reduce confusion, we can consider:

  1. Clarifying the purpose of the positional arguments in the usage guide, similar to oras cp -h. Maybe something like:
Usage:
-   oras manifest index create [flags] <name>[:<tag[,<tag>][...]] [{<tag>|<digest>}...]
+  oras manifest index create [flags] <target>[:<tag[,<tag>][...]] <sources>[{<tag>|<digest>}...]
  1. Putting all flags behind the positional arguments in the examples, for example:
Example - Create an index and push to an OCI image layout folder 'layout-dir' and tag with 'v1':
-  oras manifest index create --oci-layout layout-dir:v1 linux-amd64 sha256:99e4703fbf30916f549cd6bfa9cdbab614b5392fbe64fdee971359a77073cdf9
+  oras manifest index create layout-dir:v1 linux-amd64 sha256:99e4703fbf30916f549cd6bfa9cdbab614b5392fbe64fdee971359a77073cdf9 --oci-layout

Activity

  1. added
    documentation
    good first issue
    on Feb 27, 2025
  2. RohanMishra315 commented on Mar 9, 2025

    @RohanMishra315
    Contributor

    Hey @Wwwsylvia Could I take it ?

  3. Wwwsylvia commented on Mar 10, 2025

    @Wwwsylvia
    MemberAuthor

    Hi @RohanMishra315 , sure, please feel free to open a PR😀

  4. added a commit that references this issue on Mar 10, 2025
    8d5ffb8
  5. added this to the v1.3.0-beta.3 milestone on Mar 11, 2025
  6. added a commit that references this issue on Apr 14, 2025
    c123dcb
  7. Wwwsylvia commented on Apr 14, 2025

    @Wwwsylvia
    MemberAuthor

    #1650 updated the doc for oras manifest index create. We should apply similar updates to oras manifest index update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

documentationgood first issue

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions