npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zhang-cli

v1.1.4

Published

`zhang-cli` is a command-line tool used to clone template projects from a specified GitHub or Gitee organization. It guides users through an interactive command-line interface (CLI) to select the desired platform, organization name, and project template,

Downloads

22

Readme

zhang-cli

zhang-cli is a command-line tool used to clone template projects from a specified GitHub or Gitee organization. It guides users through an interactive command-line interface (CLI) to select the desired platform, organization name, and project template, and then clones it locally.

Features

  • Supports retrieving all available templates from a GitHub or Gitee organization.
  • Provides an interactive template selection interface.
  • Automatically clones the selected template into the user-specified project folder.
  • Saves the user's selection (platform and organization name) to a configuration file on first use, and automatically reads from the configuration file on subsequent uses to avoid repeated input.

Installation

Before using this CLI, you need to install it globally. Run the following command:

npm install -g zhang-cli

Usage

After installation, you can use the zhang command to create a new project. Here’s how to use it:

zhang create <project-name>

This command will perform the following steps:

  1. If running for the first time:
    • Select which platform (GitHub or Gitee) you want to retrieve templates from.
    • Enter the name of the organization you want to use.
    • This information will be saved in a configuration file located in the user's home directory as .zhang-cli-config.json.
  2. Retrieve a list of all available templates from the specified platform and organization.
  3. Prompt you to choose a template via the interactive interface.
  4. Clone the selected template into a local folder named <project-name>.

Dependencies

This CLI uses the following dependencies:

  • axios: For sending HTTP requests to the GitHub or Gitee API and retrieving template information.
  • inquirer: For creating interactive command-line interfaces.
  • simple-git: For executing Git operations and cloning template projects.
  • commander: For parsing command-line input and defining command structures.

Example

Suppose you want to create a new project using a template from a GitHub or Gitee organization:

  1. Run zhang create my-project in the terminal.
  2. If running for the first time, choose the platform (GitHub or Gitee) and enter the organization name.
  3. Choose the template you want to use.
  4. The tool will automatically clone the template into a local folder named my-project and notify you when the cloning is complete.

Configuration File

On the first run, the platform and organization name will be saved to a .zhang-cli-config.json file in the user's home directory. On subsequent runs, the configuration will be automatically read from this file. If the file is deleted, the system will prompt the user to input the information again.

Version

Current version: 1.0.0

License

This project is licensed under the ISC License.

zhang-cli

zhang-cli 是一个命令行工具,用于从指定的 GitHub 或 Gitee 组织中克隆模板项目。它通过交互式命令行界面(CLI)引导用户选择所需的平台、组织名和项目模板,并将其克隆到本地。

功能

  • 支持从 GitHub 或 Gitee 组织中获取所有可用的模板。
  • 提供交互式的模板选择界面。
  • 自动克隆选定的模板到用户指定的项目文件夹中。
  • 第一次使用时,保存用户的选择(平台和组织名)到配置文件,下次使用时自动读取配置,避免重复输入。

安装

在使用该 CLI 之前,您需要先全局安装它。运行以下命令:

npm install -g zhang-cli

用法

安装完成后,您可以使用 zhang 命令来创建一个新的项目。以下是使用方式:

zhang create <project-name>

此命令会执行以下步骤:

  1. 如果是首次运行:
    • 选择您要从哪个平台(GitHub 或 Gitee)获取模板。
    • 输入要使用的组织名称。
    • 这些信息会被保存到配置文件中,配置文件位于用户主目录下的 .zhang-cli-config.json 文件中。
  2. 从指定的平台和组织中获取所有可用的模板列表。
  3. 通过交互式界面提示您选择一个模板。
  4. 克隆选定的模板到以 <project-name> 命名的本地文件夹中。

依赖

该 CLI 使用了以下依赖库:

  • axios: 用于向 GitHub 或 Gitee API 发送 HTTP 请求并获取模板信息。
  • inquirer: 用于创建交互式命令行界面。
  • simple-git: 用于执行 Git 操作并克隆模板项目。
  • commander: 用于解析命令行输入和定义命令结构。

示例

假设您想使用 GitHub 或 Gitee 组织中的一个模板创建一个新项目:

  1. 在终端中运行 zhang create my-project
  2. 如果是第一次运行,选择平台(GitHub 或 Gitee)并输入组织名称。
  3. 选择您想要使用的模板。
  4. 工具会自动克隆该模板到当前目录下名为 my-project 的文件夹中,并告知您克隆完成。

配置文件

首次运行时,平台和组织名称会被保存到用户主目录下的 .zhang-cli-config.json 文件中。下次运行时将自动读取该配置文件。如果该文件被删除,系统将重新提示用户输入。

版本

当前版本:1.0.0

许可证

该项目遵循 ISC 许可证。