Skip to content

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

24 Commits

Folders and files

Repository files navigation

Better Tinker

A beautiful terminal interface for the Tinker API, built with Bubble Tea.

Go Python License

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 (stored in local config file)
  • ✨ Interactive UI - Beautiful dark theme with keyboard navigation

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)    β”‚                 β”‚             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Configuration

Option 1: Use the Settings Menu (Recommended)

The easiest way to configure your API key is through the CLI itself:

  1. Run better-tinker
  2. Select Settings from the menu
  3. Select API Key and enter your key
  4. The key is stored in a local config file:
    • Windows: %APPDATA%\tinker-cli\config.json
    • macOS/Linux: ~/.config/tinker-cli/config.json

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"'

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 config)
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:

  1. Via Settings menu (recommended):

    better-tinker
    # Navigate to Settings > API Key
  2. 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:

  1. Check if port 8765 is already in use
  2. Try manually starting the bridge:
    python -m better_tinker.bridge.server

API Documentation

When the bridge server is running, you can access the interactive API documentation at:

Development

Build from source

git clone https://github.com/mohaddz/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 (thin wrapper around internal/tui)
β”œβ”€β”€ better_tinker/
β”‚   β”œβ”€β”€ wrapper.py          # Python wrapper (starts bridge + Go CLI)
β”‚   └── bridge/
β”‚       └── server.py       # FastAPI bridge server
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ client.go       # REST API client (calls bridge)
β”‚   β”‚   └── types.go        # API response types
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── config.go       # Configuration / credential storage
β”‚   β”œβ”€β”€ tui/
β”‚   β”‚   β”œβ”€β”€ program.go      # Bubble Tea program wiring
β”‚   β”‚   β”œβ”€β”€ model.go        # App state + initial model
β”‚   β”‚   β”œβ”€β”€ update.go       # Update loop + navigation logic
β”‚   β”‚   β”œβ”€β”€ views.go        # View rendering
β”‚   β”‚   β”œβ”€β”€ commands.go     # Async commands (API calls)
β”‚   β”‚   β”œβ”€β”€ types.go        # Msg/types used by the TUI
β”‚   β”‚   β”œβ”€β”€ layout.go       # Layout helpers
β”‚   β”‚   β”œβ”€β”€ util.go         # Small helpers
β”‚   β”‚   └── menu_delegate.go # Custom menu renderer
β”‚   └── ui/
β”‚       β”œβ”€β”€ styles.go       # Lip Gloss styles
β”œβ”€β”€ build_binaries.py       # Cross-compilation script
β”œβ”€β”€ pyproject.toml          # Python package config
└── go.mod                  # Go module config

Tech Stack

Go CLI

Python Bridge

  • Web Framework: FastAPI
  • ASGI Server: Uvicorn
  • Tinker SDK: Official Python SDK for Tinker API

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages