mirror of
				https://github.com/astral-sh/uv.git
				synced 2025-11-03 21:23:54 +00:00 
			
		
		
		
	Allow providing the uv auth login password or token via stdin (#15642)
				
					
				
			This commit is contained in:
		
							parent
							
								
									63b93a1db0
								
							
						
					
					
						commit
						f9e98d1fb6
					
				
					 5 changed files with 105 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -15,6 +15,17 @@ This will prompt for the credentials.
 | 
			
		|||
The credentials can also be provided using the `--username` and `--password` options, or the
 | 
			
		||||
`--token` option for services which use a `__token__` or arbitrary username.
 | 
			
		||||
 | 
			
		||||
!!! note
 | 
			
		||||
 | 
			
		||||
    We recommend providing the secret via stdin. Use `-` to indicate the value should be read from
 | 
			
		||||
    stdin, e.g., for `--password`:
 | 
			
		||||
 | 
			
		||||
    ```console
 | 
			
		||||
    $ echo 'my-password' | uv auth login example.com --password -
 | 
			
		||||
    ```
 | 
			
		||||
 | 
			
		||||
    The same pattern can be used with `--token`.
 | 
			
		||||
 | 
			
		||||
Once credentials are added, uv will use them for packaging operations that require fetching content
 | 
			
		||||
from the given service. At this time, only HTTPS Basic authentication is supported. The credentials
 | 
			
		||||
will not yet be used for Git requests.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -110,7 +110,8 @@ uv auth login [OPTIONS] <SERVICE>
 | 
			
		|||
<p>May also be set with the <code>UV_NO_PROGRESS</code> environment variable.</p></dd><dt id="uv-auth-login--no-python-downloads"><a href="#uv-auth-login--no-python-downloads"><code>--no-python-downloads</code></a></dt><dd><p>Disable automatic downloads of Python.</p>
 | 
			
		||||
</dd><dt id="uv-auth-login--offline"><a href="#uv-auth-login--offline"><code>--offline</code></a></dt><dd><p>Disable network access.</p>
 | 
			
		||||
<p>When disabled, uv will only use locally cached data and locally available files.</p>
 | 
			
		||||
<p>May also be set with the <code>UV_OFFLINE</code> environment variable.</p></dd><dt id="uv-auth-login--password"><a href="#uv-auth-login--password"><code>--password</code></a> <i>password</i></dt><dd><p>The password to use for the service</p>
 | 
			
		||||
<p>May also be set with the <code>UV_OFFLINE</code> environment variable.</p></dd><dt id="uv-auth-login--password"><a href="#uv-auth-login--password"><code>--password</code></a> <i>password</i></dt><dd><p>The password to use for the service.</p>
 | 
			
		||||
<p>Use <code>-</code> to read the password from stdin.</p>
 | 
			
		||||
</dd><dt id="uv-auth-login--project"><a href="#uv-auth-login--project"><code>--project</code></a> <i>project</i></dt><dd><p>Run the command within the given project directory.</p>
 | 
			
		||||
<p>All <code>pyproject.toml</code>, <code>uv.toml</code>, and <code>.python-version</code> files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (<code>.venv</code>).</p>
 | 
			
		||||
<p>Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.</p>
 | 
			
		||||
| 
						 | 
				
			
			@ -120,6 +121,7 @@ uv auth login [OPTIONS] <SERVICE>
 | 
			
		|||
<p>Repeating this option, e.g., <code>-qq</code>, will enable a silent mode in which uv will write no output to stdout.</p>
 | 
			
		||||
</dd><dt id="uv-auth-login--token"><a href="#uv-auth-login--token"><code>--token</code></a>, <code>-t</code> <i>token</i></dt><dd><p>The token to use for the service.</p>
 | 
			
		||||
<p>The username will be set to <code>__token__</code>.</p>
 | 
			
		||||
<p>Use <code>-</code> to read the token from stdin.</p>
 | 
			
		||||
</dd><dt id="uv-auth-login--username"><a href="#uv-auth-login--username"><code>--username</code></a>, <code>-u</code> <i>username</i></dt><dd><p>The username to use for the service</p>
 | 
			
		||||
</dd><dt id="uv-auth-login--verbose"><a href="#uv-auth-login--verbose"><code>--verbose</code></a>, <code>-v</code></dt><dd><p>Use verbose output.</p>
 | 
			
		||||
<p>You can configure fine-grained logging using the <code>RUST_LOG</code> environment variable. (<a href="https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives">https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives</a>)</p>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue