lip config
管理配置項。
配置有兩個文件,各有自己的配置鍵:
- 用戶配置:
config.toml,Windows 為%APPDATA%\lip\config.toml,Linux/macOS 為$XDG_CONFIG_HOME/lip/config.toml。命令默認使用它。 - 工作區配置:當前目錄中的
.lip/config.toml。命令加上--workspace時使用它。
可用鍵請參見配置參考。不屬於所選文件的鍵會報錯。
lip config get
shell
lip config get <KEY> [--workspace] [--json]獲取並顯示指定配置鍵的值。使用 --json 時以 JSON 字符串輸出該值,而不是表格;該鍵沒有值(不在文件中且沒有默認值)時輸出 null。
lip config set
shell
lip config set <KEY> <VALUE> [--workspace]將配置鍵設置為給定值。值可以為空(""),例如 lip config set github_proxy ""。該鍵不接受的值會報錯,且不做任何更改。
lip config list
shell
lip config list [--workspace] [--json]列出所有配置鍵及其值。使用 --json 時以 JSON 對象輸出,沒有值的鍵為 null。
lip config delete
shell
lip config delete <KEY> [--workspace]從配置文件中移除該鍵,使其取默認值;沒有默認值時,它就沒有值。
選項
| 選項 | 說明 |
|---|---|
--workspace | 使用工作區配置(當前目錄中的 .lip/config.toml),而不是用戶配置。 |
--json | 以 JSON 輸出結果(get 與 list)。 |