目录

ohpm info

Queries details of a third-party library.

Command Format

ohpm info [options] [<@group>/]<pkg>[@<version> | @tag:<tag>] [field]
  • @group: namespace of the third-party library. This parameter is optional.
  • pkg: name of the third-party library. This parameter is mandatory.
  • version: version number of the third-party library. This parameter is optional.
  • tag: tag of the third-party library, marking a specific version number. This parameter is optional.

Description

This command is used to display details of a specified package and output the result in standard mode by calling a cloud query API.

Options

[h2]registry

You can append the --registry <registry> parameter to the ohpm info command to specify a repository address. If the repository address is not specified, the repository address is obtained from the configuration by default.

[h2]fetch_timeout

You can append the --ft <number> or --fetch_timeout <number> parameter to the ohpm info command to set the operation timeout. If the parameter is not set, the default timeout is 60000 ms.

[h2]strict_ssl

If no parameter is appended to the ohpm info command, or the --strict_ssl or --strict_ssl true parameter is appended, HTTPS certificate verification is enabled.

In ohpm 26.0.0.630 and later versions, to disable verification, append --no-strict_ssl (recommended) or --strict_ssl false to the command.

[h2]pageNum

This parameter takes effect when field is set to versions. You can configure the --pageNum <number> parameter after field. The value ranges from 1 to 10000. It indicates the target page number when versions are displayed as a paginated list, and can be used together with pageSize.

[h2]pageSize

This parameter takes effect when field is set to versions. You can configure the --pageSize <number> parameter after field. The value ranges from 1 to 500. It indicates the number of versions displayed per page when versions are presented as a paginated list, and can be used together with pageNum.

[h2]debug

In ohpm 6.0.2.636 and later versions, you can append the --debug parameter to the command to set the log level to debug for execution of the current command. This configuration takes effect only on the current command line and does not alter the log level configured in the .ohpmrc file. If this parameter is not set, the log_level setting in the .ohpmrc file is applied.

[h2]log_level

In ohpm 6.0.2.636 and later versions, you can append the --log_level <string> parameter to the ohpm info command to specify the log level (info, debug, warn, or error) for execution of the current command. If this parameter is not set, the log_level setting in the .ohpmrc file is applied.

registry, fetch_timeout, and strict_ssl configurations take effect only during the execution of the ohpm info command. They will not modify project-level or user-level configuration files.

Field

Since ohpm 6.21.0, you can use field to view metadata attributes of third-party libraries. The attributes are as follows:

  • tags: displays all tags of the third-party library. It does not support filtering by appending a specific version or tag with @ after the dependency name. For example, running ohpm info @ohos/lottie tags yields the same result as running ohpm info @ohos/lottie@latest tags or ohpm info @ohos/lottie@1.0.0 tags.
  • versions: displays all versions of the third-party library in a paginated list. It does not support filtering by appending a specific version or tag with @ after the dependency name.

Examples

[h2]Example 1

Command:

ohpm info @ohos/lottie --registry https://ohpm.openharmony.cn/ohpm

Output:

➜ ohpm info @ohos/lottie --registry https://ohpm.openharmony.cn/ohpm

@ohos/lottie@2.0.10-rc.1 | MIT | deps: none | versions: 15
lottie is an animation library for OpenHarmony, designed to work with animations exported from Adobe After Effects in JSON format through the use of Bodymovin.

keywords: OpenHarmony, HarmonyOS, Lottie

dist
.tarball: https://repo.harmonyos.com/ohpm/@ohos/lottie/-/lottie-2.0.10-rc.1.har
.integrity: sha512-fjdc1qJeEax+4/wA1eHdjvtLBOFxRGeU4J2F9Q1b+yRYjmZnzL6GCA241Ku5iyzG5j2RUZi6tyBa0rpyQnjhPg==

dist-tags:
latest: 2.0.10-rc.1

published 15 hours ago by ohos_tpc

[h2]Example 2

Command:

ohpm info @ohos/imageknife --registry https://ohpm.openharmony.cn/ohpm/ keywords

Output:

OpenHarmony, ImageKnife, glide, HarmonyOS

[h2]Example 3

Command:

ohpm info @ohos/lottie --registry https://ohpm.openharmony.cn/ohpm versions --pageNum 1 --pageSize 500

Output:

current page num: 1, total pages: 88
2.0.0        2.0.1        2.0.10       2.0.10-rc.0  2.0.10-rc.1  2.0.10-rc.2  2.0.10-rc.3  2.0.10-rc.4  2.0.11       
2.0.11-rc.0  2.0.11-rc.1  2.0.11-rc.2  2.0.11-rc.3  2.0.11-rc.4  2.0.11-rc.5  2.0.11-rc.6  2.0.11-rc.7  ......