No description
Find a file
Renovate Bot 26f9067be1
Some checks failed
Build workctl / build-and-run (push) Has been cancelled
Build workctl / build-and-run (pull_request) Has been cancelled
chore(deps): update module modernc.org/sqlite to v1.37.1
2025-06-04 11:02:40 +00:00
.forgejo/workflows fix: change foldername for workflows 2025-06-04 12:54:38 +02:00
.gitignore fix: remove config file from repo 2024-12-28 11:57:07 +01:00
app.go refactor: perform clean up and add option for direct connection 2025-04-02 22:19:32 +02:00
cmd.go refactor: perform clean up and add option for direct connection 2025-04-02 22:19:32 +02:00
config.go refactor: perform clean up and add option for direct connection 2025-04-02 22:19:32 +02:00
export.go refactor: clean up code from comments 2025-04-02 14:21:33 +02:00
forwarder.go refactor: clean up code from comments 2025-04-02 14:21:33 +02:00
go.mod chore(deps): update module modernc.org/sqlite to v1.37.1 2025-06-04 11:02:40 +00:00
go.sum chore(deps): update module modernc.org/sqlite to v1.37.1 2025-06-04 11:02:40 +00:00
main.go refactor: rebuild work without timewarrior dependency 2025-04-02 13:44:30 +02:00
README.md refactor: rebuild work without timewarrior dependency 2025-04-02 13:44:30 +02:00
renovate.json Add renovate.json 2025-06-04 10:48:39 +00:00
ssh.go refactor: clean up code from comments 2025-04-02 14:21:33 +02:00
store.go refactor: clean up code from comments 2025-04-02 14:21:33 +02:00

Work Control CLI (workctl)

Description

This Golang program is a versatile command-line tool designed to streamline common work-related tasks. It offers functions such as work time tracking (using an internal SQLite database), remote computer wake-up (Wake-on-LAN), and establishing SSH tunnels and RDP connections.

Main Features

  • Work Time Tracking: Start, stop, and track work time and breaks using an internal SQLite database (~/.config/work/worktime.sqlite). Summaries (daily, weekly, monthly) and yearly Excel export are available.
  • Remote Computer Wake-up: Wake remote computers using Wake-on-LAN, potentially via an SSH jump host.
  • SSH Tunneling: Establish SSH connections and set up port forwarding for accessing remote services (like SSH or RDP on a workstation) securely.
  • RDP Connection: Helper command to launch an RDP client (xfreerdp) through an established tunnel.

Prerequisites

  • Go (Golang) installed (for building or development)
  • SSH client (ssh) installed and configured (keys recommended)
  • lsof command (for killing tunnels, usually pre-installed on Linux/macOS)
  • wakeonlan command installed on the jump host if waking via jump host.
  • xfreerdp command (or another RDP client) installed for RDP connections.

Configuration

The program expects a configuration file at ~/.config/work/config.toml. Create this directory and file if they don't exist.

Example config.toml:

# ~/.config/work/config.toml

[default]
# SSH connection details for the first hop (e.g., Jump Host or Gateway)
SSH_USER = "your_ssh_user"
SSH_HOST = "[jumphost.example.com](https://www.google.com/search?q=jumphost.example.com)"
SSH_PORT = 22 # Optional, defaults to 22

# Optional: Details for a second SSH hop (if waking requires jumping)
JUMP_USER = "user_on_jump_host" # User needed to run wakeonlan on jump host
JUMP_HOST = "internal_host_reachable_from_jump" # Host from which wakeonlan is run

# Workstation details
WORKSTATION_HOST = "workstation.internal.network" # Hostname/IP from Jump Host's perspective
WORKSTATION_IP = "192.168.1.100" # IP for direct tunneling target
WORKSTATION_MAC = "AA:BB:CC:DD:EE:FF" # MAC address for Wake-on-LAN
WORKSTATION_USER = "your_workstation_ssh_user" # SSH user on the workstation

# RDP connection details (used by the 'connect rdp' command)
RDP_USER = "your_windows_domain\\your_rdp_user"
RDP_PASSWORD = "your_rdp_password" # SECURITY RISK: Avoid storing passwords here. Consider alternatives.

# Optional: Specify database path explicitly
# DATABASE_PATH = "/path/to/your/worktime.sqlite"