Tinker CLI wrapper and bridge
Project description
Better Tinker
A beautiful terminal interface for the Tinker API, built with Bubble Tea.
Features
- ๐ Training Runs - View and manage your training runs with expandable tree view
- ๐พ Checkpoints - Browse, publish/unpublish, and delete model checkpoints
- ๐ Usage Statistics - View your API usage and quotas
- โ๏ธ Settings - Configure API key with secure storage (OS keyring)
- โจ Interactive UI - Beautiful dark theme with keyboard navigation
- ๐ Secure Credential Storage - API keys stored in Windows Credential Manager / macOS Keychain / Linux Secret Service
Quick Start
Option 1: Using uv/uvx (Recommended)
# Install uv if you don't have it
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Run directly (downloads and runs in isolated environment)
uvx better-tinker
Option 2: Using pip
pip install better-tinker
better-tinker
Architecture
This CLI uses a Python bridge server to communicate with the Tinker API. The bridge is started automatically when you run better-tinker.
โโโโโโโโโโโโโโโ Authorization Header โโโโโโโโโโโโโโโโโโโ gRPC-Web โโโโโโโโโโโโโโโ
โ Go CLI โ โโโโโโโโโโโโโโโโโโโโโโโโโบ โ Python Bridge โ โโโโโโโโโโโโโโโบ โ Tinker API โ
โ (Bubble Tea)โ Bearer <api_key> โ (FastAPI) โ โ โ
โ โ โ โ โ โ
โ Reads key โ โ Uses key from โ โ โ
โ from keyringโ โ header (no โ โ โ
โ (1 prompt) โ โ keyring access) โ โ โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
Key Design Decision: The Go CLI is the only component that accesses the system keyring. The API key is passed to the bridge via HTTP Authorization header, eliminating the double password prompt issue on macOS.
Configuration
Option 1: Use the Settings Menu (Recommended)
The easiest way to configure your API key is through the CLI itself:
- Run
better-tinker - Select Settings from the menu
- Select API Key and enter your key
- The key will be stored securely in your OS keyring:
- Windows: Credential Manager
- macOS: Keychain
- Linux: Secret Service (GNOME Keyring, KWallet, etc.)
Option 2: Environment Variable
Set your Tinker API key as an environment variable:
# Linux/macOS
export TINKER_API_KEY="your-api-key-here"
# Windows (PowerShell)
$env:TINKER_API_KEY="your-api-key-here"
# Windows (CMD)
set TINKER_API_KEY=your-api-key-here
# Then run
better-tinker
Note: Environment variables take precedence over stored credentials.
Persistent Environment Variable (Recommended for uvx)
If you use uvx, setting the environment variable in your shell config is the most reliable method:
macOS/Linux (bash/zsh):
echo 'export TINKER_API_KEY="your-api-key-here"' >> ~/.zshrc
source ~/.zshrc
Windows (PowerShell profile):
# Add to your PowerShell profile
Add-Content $PROFILE 'setx TINKER_API_KEY "your-api-key-here"'
Platform-Specific Notes
macOS
- Keychain Access: The first time you run
better-tinker, macOS may prompt for your password to allow keychain access. Click "Always Allow" to avoid future prompts. - Unsigned Binary Warning: If macOS blocks the binary, go to System Preferences > Security & Privacy and click "Open Anyway"
- Code Signing: The binaries are ad-hoc signed to reduce Keychain prompts
Windows
- Credential Manager: API keys are stored in Windows Credential Manager under
tinker-cli:api-key - Firewall: The bridge server runs on
127.0.0.1:8765. Windows Firewall may ask to allow it (this is local-only traffic)
Linux
- Secret Service: Requires a running secret service daemon (GNOME Keyring, KWallet, etc.)
- Headless Servers: On servers without a desktop environment, use the
TINKER_API_KEYenvironment variable instead
Keyboard Controls
| Key | Action |
|---|---|
โ/k |
Move up |
โ/j |
Move down |
Enter |
Select / Confirm / Edit |
Space |
Expand/collapse training run |
r |
Refresh data |
p |
Publish/Unpublish checkpoint |
d |
Delete checkpoint / Delete API key (in Settings) |
Esc |
Go back / Cancel editing |
q |
Quit |
Environment Variables
| Variable | Description | Default |
|---|---|---|
TINKER_API_KEY |
Your Tinker API key | (from keyring) |
TINKER_BRIDGE_URL |
Custom bridge server URL | http://127.0.0.1:8765 |
TINKER_BRIDGE_PORT |
Bridge server port | 8765 |
TINKER_BRIDGE_HOST |
Bridge server host | 127.0.0.1 |
Troubleshooting
"API key required" error
Set your API key using one of these methods:
-
Via Settings menu (recommended):
better-tinker # Navigate to Settings > API Key -
Via environment variable:
export TINKER_API_KEY="your-api-key-here" better-tinker
"Tinker SDK not installed" error
This usually means the Python environment is missing dependencies. Try:
# Reinstall with fresh environment
uvx --refresh better-tinker
# Or with pip
pip install --upgrade better-tinker tinker
"Bridge server not running" error
The bridge should start automatically. If it fails:
- Check if port 8765 is already in use
- Try manually starting the bridge:
python -m better_tinker.bridge.server
Double password prompt on macOS
This issue has been fixed in v0.2.0+. If you still experience it:
- Update to the latest version:
uvx --refresh better-tinker - Use environment variable instead of keyring:
export TINKER_API_KEY="your-key" uvx better-tinker
API Documentation
When the bridge server is running, you can access the interactive API documentation at:
- Swagger UI: http://127.0.0.1:8765/docs
- ReDoc: http://127.0.0.1:8765/redoc
Development
Build from source
git clone https://github.com/mohadese/better-tinker.git
cd better-tinker
# Build Go binaries for all platforms
python build_binaries.py
# Install in development mode
pip install -e .
# Run
better-tinker
Project Structure
better-tinker/
โโโ main.go # Go CLI entry point
โโโ better_tinker/
โ โโโ wrapper.py # Python wrapper (starts bridge + Go CLI)
โ โโโ bin/ # Pre-built Go binaries
โ โ โโโ tinker-cli-windows.exe
โ โ โโโ tinker-cli-linux
โ โ โโโ tinker-cli-darwin
โ โ โโโ tinker-cli-darwin-arm64
โ โโโ bridge/
โ โโโ server.py # FastAPI bridge server
โโโ internal/
โ โโโ api/
โ โ โโโ client.go # REST API client (calls bridge)
โ โ โโโ types.go # API response types
โ โโโ config/
โ โ โโโ keyring.go # Secure credential storage
โ โโโ ui/
โ โโโ app.go # Bubble Tea app model
โ โโโ styles.go # Lip Gloss styles
โ โโโ views/ # UI views
โโโ build_binaries.py # Cross-compilation script
โโโ pyproject.toml # Python package config
โโโ go.mod # Go module config
Tech Stack
Go CLI
- TUI Framework: Bubble Tea
- Components: Bubbles
- Styling: Lip Gloss
- Credential Storage: go-keyring
Python Bridge
License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file better_tinker-0.2.6.tar.gz.
File metadata
- Download URL: better_tinker-0.2.6.tar.gz
- Upload date:
- Size: 23.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c89fe73b44f52b249dcc8cea40e108e87f5430b64e705ea4651ca4521a87c6d
|
|
| MD5 |
cb11ec802898a2583d86a8c381236dfa
|
|
| BLAKE2b-256 |
472d58133b66869a98382097a0695ccd0f45a0ddf0b010dcecc89ba6c0f53395
|
File details
Details for the file better_tinker-0.2.6-py3-none-any.whl.
File metadata
- Download URL: better_tinker-0.2.6-py3-none-any.whl
- Upload date:
- Size: 12.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0397beee2fb55404c3d5a8a890f7a66295bded9cf5e24d22e378db5f6d58fbdb
|
|
| MD5 |
3c92109097ec439da72909f5bb5ce2f4
|
|
| BLAKE2b-256 |
059f4a43fc0fd340fda4e74e7402f2b62935eafaa3724e7d275ce5814af06f9b
|