tgs profile#

管理账户配置文件。

用法#

tgs profile <subcommand> [flags]

子命令#

tgs profile list#

列出所有配置文件及其关联的账户信息。

tgs profile list [flags]
FlagShortDefaultDescription
--output-ojsonOutput format: json, text
tgs profile list
tgs profile list --output text
* default (@myuser)
  work (@workuser)

JSON(默认):

[
  {"name":"default","phone":"+79001234567","username":"alice","id":261054642,"active":true},
  {"name":"work","phone":"+79001230000","username":"alice_work","id":342178890,"active":false}
]

文本(--output text):

* default (@alice)
  work (@alice_work)

文本输出中用 * 标记当前活跃的配置文件,JSON 中标记为 "active": true。若未缓存 username 和 phone,则只显示配置文件名。


tgs profile switch#

通过写入 .tgs.yaml 文件来设置当前目录的活跃配置文件。

tgs profile switch <name>
tgs profile switch work
tgs profile switch default
profile: <name>

JSON(默认):

{"profile":"work","status":"switched","dir":"/Users/alice/projects"}

文本(--output text):

Switched to profile "work" (wrote .tgs.yaml in /Users/alice/projects)

在当前目录及所有子目录中运行的 tgs 命令都将使用指定的配置文件。


tgs profile delete#

删除配置文件及其本地会话数据库。

tgs profile delete <name>
tgs profile delete old-account
tgs profile switch default
tgs profile delete work

JSON(默认):

{"profile":"old","status":"deleted"}

文本(--output text):

Deleted profile "old"

无法删除当前活跃的配置文件。请先切换到其他配置文件。

另请参阅#