<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>参考 on tgs</title><link>https://garenal1v3.github.io/tgs-cli/zh/reference/</link><description>Recent content in 参考 on tgs</description><generator>Hugo</generator><language>zh</language><atom:link href="https://garenal1v3.github.io/tgs-cli/zh/reference/index.xml" rel="self" type="application/rss+xml"/><item><title>环境变量</title><link>https://garenal1v3.github.io/tgs-cli/zh/reference/environment/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://garenal1v3.github.io/tgs-cli/zh/reference/environment/</guid><description>&lt;h1 id="环境变量"&gt;环境变量&lt;a class="anchor" href="#%e7%8e%af%e5%a2%83%e5%8f%98%e9%87%8f"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;所有 tgs 环境变量均为可选。它们会覆盖编译时的默认值或配置文件中的值。&lt;/p&gt;
&lt;h2 id="变量列表"&gt;变量列表&lt;a class="anchor" href="#%e5%8f%98%e9%87%8f%e5%88%97%e8%a1%a8"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Variable&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;TGS_PROFILE&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Active profile name. Overrides &lt;code&gt;.tgs.yaml&lt;/code&gt; but is overridden by &lt;code&gt;--profile&lt;/code&gt; flag.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;TGS_API_ID&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Telegram API ID. Overrides the value compiled into the binary.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;TGS_API_HASH&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Telegram API Hash. Overrides the value compiled into the binary.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;TGS_CONFIG_DIR&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Config directory. Takes precedence over &lt;code&gt;XDG_CONFIG_HOME&lt;/code&gt;. Default: &lt;code&gt;$XDG_CONFIG_HOME/tgs&lt;/code&gt;, falling back to &lt;code&gt;~/.config/tgs&lt;/code&gt;.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;TGS_DATA_DIR&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Data directory for session databases. Takes precedence over &lt;code&gt;XDG_DATA_HOME&lt;/code&gt;. Default: &lt;code&gt;$XDG_DATA_HOME/tgs&lt;/code&gt;, falling back to &lt;code&gt;~/.local/share/tgs&lt;/code&gt;.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;XDG_CONFIG_HOME&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Base config directory (XDG spec). Used as &lt;code&gt;$XDG_CONFIG_HOME/tgs&lt;/code&gt; when &lt;code&gt;TGS_CONFIG_DIR&lt;/code&gt; is unset.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;XDG_DATA_HOME&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Base data directory (XDG spec). Used as &lt;code&gt;$XDG_DATA_HOME/tgs&lt;/code&gt; when &lt;code&gt;TGS_DATA_DIR&lt;/code&gt; is unset.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id="配置文件选择"&gt;配置文件选择&lt;a class="anchor" href="#%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6%e9%80%89%e6%8b%a9"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#abb2bf;background-color:#282c34;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#7f848e"&gt;# Use the &amp;#34;work&amp;#34; profile for one command&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e06c75"&gt;TGS_PROFILE&lt;/span&gt;&lt;span style="color:#56b6c2"&gt;=&lt;/span&gt;work tgs whoami
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#7f848e"&gt;# Use the &amp;#34;work&amp;#34; profile for the whole shell session&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e5c07b"&gt;export&lt;/span&gt; &lt;span style="color:#e06c75"&gt;TGS_PROFILE&lt;/span&gt;&lt;span style="color:#56b6c2"&gt;=&lt;/span&gt;work&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;完整优先级链详见&lt;a href="https://garenal1v3.github.io/tgs-cli/zh/guide/profiles/#how-profile-resolution-works"&gt;配置文件解析顺序&lt;/a&gt;。&lt;/p&gt;</description></item></channel></rss>