diff --git a/README.md b/README.md index b8fe811..35a4b0b 100644 --- a/README.md +++ b/README.md @@ -20,15 +20,15 @@ ## Installation -### Homebrew (macOS/Linux) +### Download Pre-built Binaries (Recommended) -```bash -brew install tmpo -``` +Download the latest release for your platform from the [releases page](https://github.com/DylanDevelops/tmpo/releases). -### Download Pre-built Binaries +For detailed installation instructions for your platform: -Download the latest release for your platform from the [releases page](https://github.com/DylanDevelops/tmpo/releases). +- [macOS Installation Guide](docs/installation/macos_installation.md) +- [Linux Installation Guide](docs/installation/linux_installation.md) +- [Windows Installation Guide](docs/installation/windows_installation.md) ### Build from Source diff --git a/docs/installation/linux_installation.md b/docs/installation/linux_installation.md new file mode 100644 index 0000000..c4958f2 --- /dev/null +++ b/docs/installation/linux_installation.md @@ -0,0 +1,278 @@ +# Linux Installation Guide + +This guide will walk you through installing tmpo on Linux. + +## Prerequisites + +- Linux kernel 3.10 or later (most modern distributions) +- For building from source: Go 1.21 or later + +## Method 1: Download Pre-built Binary (Recommended) + +### Step 1: Download the Binary + +1. Visit the [tmpo releases page](https://github.com/DylanDevelops/tmpo/releases) +2. Download the appropriate file for your architecture: + - **x86_64 (64-bit)**: `tmpo_X.X.X_Linux_x86_64.tar.gz` + - **ARM64**: `tmpo_X.X.X_Linux_arm64.tar.gz` + +> [!NOTE] +> Replace `X.X.X` with the latest version number, e.g., `0.1.0` + +You can also download using curl or wget: + +```bash +# For x86_64 (replace 0.1.0 with the latest version) +wget https://github.com/DylanDevelops/tmpo/releases/download/v0.1.0/tmpo_0.1.0_Linux_x86_64.tar.gz + +# Or using curl +curl -LO https://github.com/DylanDevelops/tmpo/releases/download/v0.1.0/tmpo_0.1.0_Linux_x86_64.tar.gz +``` + +### Step 2: Extract and Install + +**System-wide installation (requires sudo):** + +```bash +# Extract the archive (replace version and architecture as needed) +tar -xzf tmpo_0.1.0_Linux_x86_64.tar.gz + +# Move to /usr/local/bin +sudo mv tmpo /usr/local/bin/ + +# Make executable (usually already set) +sudo chmod +x /usr/local/bin/tmpo +``` + +**User installation (no sudo required):** + +```bash +# Create a bin directory in your home folder if it doesn't exist +mkdir -p ~/bin + +# Extract and move (replace version and architecture as needed) +tar -xzf tmpo_0.1.0_Linux_x86_64.tar.gz +mv tmpo ~/bin/ + +# Make executable +chmod +x ~/bin/tmpo + +# Add to PATH if not already (add to ~/.bashrc or ~/.zshrc) +echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc +source ~/.bashrc +``` + +### Step 3: Verify Installation + +```bash +tmpo --version +``` + +You should see the tmpo version information. + +## Method 2: Build from Source + +### Step 1: Install Go + +**Debian/Ubuntu:** + +```bash +sudo apt update +sudo apt install golang-go +``` + +**Fedora:** + +```bash +sudo dnf install golang +``` + +**Arch Linux:** + +```bash +sudo pacman -S go +``` + +**Or download from [golang.org/dl](https://golang.org/dl/):** + +```bash +# Download and install the latest version +wget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz +sudo tar -C /usr/local -xzf go1.23.0.linux-amd64.tar.gz +echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc +source ~/.bashrc + +# Verify installation +go version +``` + +### Step 2: Clone and Build + +```bash +# Install git if needed +sudo apt install git # Debian/Ubuntu +sudo dnf install git # Fedora +sudo pacman -S git # Arch + +# Clone the repository +git clone https://github.com/DylanDevelops/tmpo.git +cd tmpo + +# Build the binary +go build -o tmpo . + +# Move to PATH +sudo mv tmpo /usr/local/bin/ +# Or for user installation +mv tmpo ~/bin/ + +# Make executable +sudo chmod +x /usr/local/bin/tmpo +# Or for user installation +chmod +x ~/bin/tmpo +``` + +### Step 3: Verify Installation + +```bash +tmpo --version +``` + +## Determining Your Architecture + +If you're not sure which binary to download: + +```bash +uname -m +``` + +Output mapping: + +- `x86_64` → Download `tmpo_X.X.X_Linux_x86_64.tar.gz` +- `aarch64` or `arm64` → Download `tmpo_X.X.X_Linux_arm64.tar.gz` + +Replace `X.X.X` with the actual version number. + +## Troubleshooting + +### "tmpo: command not found" + +The binary is not in your PATH. Check: + +```bash +# Verify the file exists +ls -l /usr/local/bin/tmpo +# Or for user installation +ls -l ~/bin/tmpo + +# Check if the directory is in PATH +echo $PATH +``` + +Add to PATH if needed: + +```bash +# For /usr/local/bin (should already be there) +echo $PATH | grep "/usr/local/bin" + +# For ~/bin, add to your shell config +echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc +source ~/.bashrc +``` + +### Permission Denied + +If you get permission errors: + +```bash +# Make sure the file is executable +sudo chmod +x /usr/local/bin/tmpo +# Or for user installation +chmod +x ~/bin/tmpo + +# If you're trying to write to /usr/local/bin without sudo +sudo mv tmpo /usr/local/bin/ +``` + +### "cannot execute binary file: Exec format error" + +You downloaded the wrong architecture. Check your system: + +```bash +uname -m +``` + +And download the correct binary for your architecture. + +### Database Permission Issues + +If tmpo can't create or access the database: + +```bash +# Check if the directory exists and is writable +ls -la ~/.tmpo + +# If it doesn't exist, create it +mkdir -p ~/.tmpo + +# Fix permissions if needed +chmod 755 ~/.tmpo +``` + +## Distribution-Specific Notes + +### Ubuntu/Debian + +If you prefer `/usr/bin` over `/usr/local/bin`: + +```bash +sudo mv tmpo /usr/bin/ +sudo chmod +x /usr/bin/tmpo +``` + +### Fedora/RHEL + +SELinux may require additional context: + +```bash +sudo chcon -t bin_t /usr/local/bin/tmpo +``` + +### Arch Linux + +Consider creating a PKGBUILD for easier installation and updates. + +## Next Steps + +Once installed, check out the [Usage Guide](../usage.md) to learn how to use tmpo, or get started quickly with: + +```bash +# Navigate to your project directory +cd ~/path/to/your/project + +# Start tracking time +tmpo start + +# Check status +tmpo status + +# Stop tracking +tmpo stop + +# View statistics +tmpo stats +``` + +## Uninstalling + +To uninstall tmpo: + +```bash +# Remove the binary +sudo rm /usr/local/bin/tmpo +# Or for user installation +rm ~/bin/tmpo + +# Optionally, delete your tmpo data +rm -rf ~/.tmpo +``` diff --git a/docs/installation/macos_installation.md b/docs/installation/macos_installation.md new file mode 100644 index 0000000..dd16543 --- /dev/null +++ b/docs/installation/macos_installation.md @@ -0,0 +1,221 @@ +# macOS Installation Guide + +This guide will walk you through installing tmpo on macOS. + +## Prerequisites + +- macOS 11 (Big Sur) or later +- For building from source: Go 1.21 or later + +## Method 1: Download Pre-built Binary (Recommended) + +### Step 1: Download the Binary + +1. Visit the [tmpo releases page](https://github.com/DylanDevelops/tmpo/releases) +2. Download the appropriate file for your Mac: + - **Apple Silicon (M1/M2/M3/M4)**: `tmpo_X.X.X_Darwin_arm64.tar.gz` + - **Intel Mac**: `tmpo_X.X.X_Darwin_x86_64.tar.gz` + +> [!NOTE] +> Replace `X.X.X` with the latest version number, e.g., `0.1.0` + +### Step 2: Extract and Install + +Open Terminal and run: + +```bash +# Navigate to your Downloads folder +cd ~/Downloads + +# Extract the archive (adjust filename for your architecture and version) +tar -xzf tmpo_0.1.0_Darwin_arm64.tar.gz + +# Move to /usr/local/bin (may require sudo) +sudo mv tmpo /usr/local/bin/ + +# Make executable +sudo chmod +x /usr/local/bin/tmpo +``` + +Note: Replace `0.1.0` with the actual version you downloaded. + +### Step 3: Handle macOS Gatekeeper + +macOS may block the binary because it's not signed with an Apple Developer ID. To allow it: + +```bash +# Remove the quarantine attribute +sudo xattr -d com.apple.quarantine /usr/local/bin/tmpo +``` + +Alternatively, if you see a security warning: + +1. Open "System Settings" → "Privacy & Security" +2. Scroll down to the Security section +3. Click "Allow Anyway" next to the tmpo warning + +### Step 4: Verify Installation + +```bash +tmpo --version +``` + +You should see the tmpo version information. + +## Method 2: Homebrew (Coming Soon) + +Homebrew support is on the way! Once available, you'll be able to install with: + +```bash +brew install tmpo +``` + +## Method 3: Build from Source + +### Step 1: Install Go + +If you don't have Go installed: + +```bash +# Using Homebrew +brew install go + +# Verify installation +go version +``` + +Or download from [golang.org/dl](https://golang.org/dl/). + +### Step 2: Clone and Build + +```bash +# Clone the repository +git clone https://github.com/DylanDevelops/tmpo.git +cd tmpo + +# Build the binary +go build -o tmpo . + +# Move to PATH +sudo mv tmpo /usr/local/bin/ + +# Make executable +sudo chmod +x /usr/local/bin/tmpo +``` + +### Step 3: Verify Installation + +```bash +tmpo --version +``` + +## Alternative Installation Locations + +If you prefer not to use `/usr/local/bin/`, you can install to your home directory: + +```bash +# Create a bin directory in your home folder +mkdir -p ~/bin + +# Move tmpo there +mv tmpo ~/bin/ + +# Add to PATH (add this line to ~/.zshrc or ~/.bash_profile) +echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc + +# Reload your shell configuration +source ~/.zshrc +``` + +## Troubleshooting + +### "tmpo: command not found" + +This means tmpo is not in your PATH. Check: + +```bash +# Verify the file exists +ls -l /usr/local/bin/tmpo + +# Check if /usr/local/bin is in PATH +echo $PATH | grep "/usr/local/bin" +``` + +If it's not in your PATH: + +```bash +echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrc +source ~/.zshrc +``` + +### "tmpo cannot be opened because the developer cannot be verified" + +Run the xattr command to remove the quarantine flag: + +```bash +sudo xattr -d com.apple.quarantine /usr/local/bin/tmpo +``` + +### Permission Denied + +If you get permission errors: + +```bash +# Make sure the file is executable +sudo chmod +x /usr/local/bin/tmpo + +# Or if installed in ~/bin +chmod +x ~/bin/tmpo +``` + +### Architecture Mismatch + +If you see an error about architecture, make sure you downloaded the correct binary: + +```bash +# Check your Mac's architecture +uname -m + +# arm64 = Apple Silicon (M1/M2/M3) +# x86_64 = Intel +``` + +## Next Steps + +Once installed, check out the [Usage Guide](../usage.md) to learn how to use tmpo, or get started quickly with: + +```bash +# Navigate to your project directory +cd ~/path/to/your/project + +# Start tracking time +tmpo start + +# Check status +tmpo status + +# Stop tracking +tmpo stop + +# View statistics +tmpo stats +``` + +## Uninstalling + +To uninstall tmpo: + +```bash +# Remove the binary +sudo rm /usr/local/bin/tmpo + +# Optionally, delete your tmpo data +rm -rf ~/.tmpo +``` + +If you installed to `~/bin`: + +```bash +rm ~/bin/tmpo +rm -rf ~/.tmpo +``` diff --git a/docs/installation/windows_installation.md b/docs/installation/windows_installation.md new file mode 100644 index 0000000..6eb30c5 --- /dev/null +++ b/docs/installation/windows_installation.md @@ -0,0 +1,161 @@ +# Windows Installation Guide + +This guide will walk you through installing tmpo on Windows. + +## Prerequisites + +- Windows 10 or later +- For building from source: Go 1.21 or later + +## Method 1: Download Pre-built Binary (Recommended) + +### Step 1: Download the Binary + +1. Visit the [tmpo releases page](https://github.com/DylanDevelops/tmpo/releases) +2. Download the appropriate file for your system: + - **x86_64 (64-bit Intel/AMD)**: `tmpo_X.X.X_Windows_x86_64.zip` + - **ARM64 (ARM-based Windows)**: `tmpo_X.X.X_Windows_arm64.zip` + +> [!NOTE] +> Replace `X.X.X` with the latest version number, e.g., `0.1.0` + +3. Extract the ZIP file to a location of your choice (e.g., `C:\Program Files\tmpo\`) + +### Step 2: Add tmpo to PATH + +To use tmpo from any directory, add it to your system PATH: + +**Using PowerShell (Recommended):** + +```powershell +# Add to user PATH (doesn't require admin) +$userPath = [Environment]::GetEnvironmentVariable("Path", "User") +$tmpoPath = "C:\Program Files\tmpo" # Adjust this to your installation path +[Environment]::SetEnvironmentVariable("Path", "$userPath;$tmpoPath", "User") +``` + +**Using System Settings (GUI):** + +1. Press `Win + X` and select "System" +2. Click "Advanced system settings" +3. Click "Environment Variables" +4. Under "User variables", select "Path" and click "Edit" +5. Click "New" and add the path to your tmpo directory (e.g., `C:\Program Files\tmpo`) +6. Click "OK" on all dialogs + +### Step 3: Verify Installation + +Open a new Command Prompt or PowerShell window and run: + +```powershell +tmpo --version +``` + +You should see the tmpo version information. + +### Step 4: Start Using tmpo + +```powershell +tmpo --help +``` + +## Method 2: Build from Source + +### Step 1: Install Go + +1. Download and install Go from [golang.org/dl](https://golang.org/dl/) +2. Verify installation: + +```powershell +go version +``` + +### Step 2: Clone and Build + +```powershell +# Clone the repository +git clone https://github.com/DylanDevelops/tmpo.git +cd tmpo + +# Build the binary +go build -o tmpo.exe . +``` + +### Step 3: Move Binary to PATH + +Move the built `tmpo.exe` to a directory in your PATH, or add the current directory to PATH as described in Method 1. + +### Step 4: Verify Installation + +```powershell +tmpo --version +``` + +## Determining Your System Architecture + +If you're not sure which binary to download, open PowerShell and run: + +```powershell +$env:PROCESSOR_ARCHITECTURE +``` + +Output mapping: + +- `AMD64` → Download `tmpo_X.X.X_Windows_x86_64.zip` +- `ARM64` → Download `tmpo_X.X.X_Windows_arm64.zip` + +Replace `X.X.X` with the actual version number. + +## Troubleshooting + +### "tmpo is not recognized as an internal or external command" + +This means tmpo is not in your PATH. Make sure you: + +1. Added the correct directory to your PATH +2. Opened a new terminal window after modifying PATH +3. The `tmpo.exe` file exists in the directory you added + +### Permission Denied Errors + +If you get permission errors when extracting or running tmpo: + +1. Try running your terminal as Administrator +2. Extract the binary to your user directory instead (e.g., `C:\Users\YourName\bin\`) + +### Windows SmartScreen Warning + +Windows may show a SmartScreen warning for the binary. This is normal for newly released software. You can click "More info" and then "Run anyway" to proceed. + +## Next Steps + +Once installed, check out the [Usage Guide](../usage.md) to learn how to use tmpo, or get started quickly with: + +```powershell +# Navigate to your project directory +cd C:\path\to\your\project + +# Start tracking time +tmpo start + +# Check status +tmpo status + +# Stop tracking +tmpo stop + +# View statistics +tmpo stats +``` + +## Uninstalling + +To uninstall tmpo: + +1. Delete the tmpo binary from your installation directory +2. Remove the directory from your PATH (reverse the steps in "Add tmpo to PATH") +3. Optionally, delete your tmpo data: + + ```powershell + Remove-Item -Recurse -Force "$env:USERPROFILE\.tmpo" + ```