快速开始
本指南将帮助你快速上手 lip,涵盖项目中管理包的基础用法。
前置条件
开始前请确保:
- 你已安装 lip。
- 终端中已安装并可使用
git。
初始化项目
要开始追踪包,请先初始化项目清单。在项目根目录运行:
shell
lip init该命令会在当前目录创建 tooth.json 文件。这个文件是清单(manifest),用于保存项目及其依赖的元数据。
安装包
使用 install 命令并跟上包标识即可安装包,也可用 @ 指定版本。
shell
lip install github.com/LiteLDev/LeviLamina@1.0.0lip 支持从多种来源安装(包括 Git 仓库)。安装时会:
- 下载到本地缓存;
- 加入你的
tooth.json清单; - 解析并安装其依赖。
查看已安装包
查看当前项目中已安装的所有包:
shell
lip list会显示包列表及其已安装版本。
查看包信息
你可以在不安装的情况下获取包详情(如可用版本、元数据)。
查看包元数据:
shell
lip view github.com/LiteLDev/LeviLamina查看可用版本:
shell
lip versions github.com/LiteLDev/LeviLamina更新包
使用 update 命令将包更新到新版本。
shell
lip update github.com/LiteLDev/LeviLamina另外,使用 install 并指定版本也可完成升级或降级。
卸载包
从项目和 tooth.json 中移除包:
shell
lip uninstall github.com/LiteLDev/LeviLamina配置
lip 支持配置全局设置,例如代理。
查看当前配置:
shell
lip config list设置配置项:
shell
lip config set github_proxy https://mirror.ghproxy.com/