Welcome to Workbench! This is my personal collection of command-line tools for automating everyday tasks and storing useful utilities I don't want to forget. It's also a personal project to expand my Go programming knowledge and skills.
$ go install github.com/bdunn313/workbench@latestRoll is a simple dice roller. It takes a dice notation and rolls the dice. It supports the following notation:
d6: Roll a single 6-sided die2d6: Roll two 6-sided diced6+1: Roll a single 6-sided die and add 1 to the result2d6+1: Roll two 6-sided dice and add 1 to the result2d4+3d8+4+1d20+2: Roll two 4-sided dice, three 8-sided dice, a single 20-sided die, and add 4 and 2 to the result
$ workbench roll 2d4+3d8+4+1d20+2
Rolling: 2d4+3d8+4+1d20+2
2 2d4
30 3d8+4
15 1d20+2
------------
47It also supports plain formatting so you can pipe the output
$ workbench roll 2d4+3d8+4+1d20+2 --plain | cat
47Note: Right now it does not support negative numbers for modifiers. That is tracked here.
Table is a command for randomly selecting rows from CSV files. It supports the following features:
- Read from a file or stdin
- Skip header row automatically
- Output in either formatted or plain CSV format
# Roll on a table from a file
$ workbench table roll path/to/table.csv
# Roll on a table from stdin
$ cat table.csv | workbench table roll -
# Get plain CSV output
$ workbench table roll path/to/table.csv --plainThe formatted output will show each column with its header (if present) or column number, while the plain output will be comma-separated values suitable for piping to other commands.
Prepare helps you get ready for your upcoming week by:
- Pulling calendar events and tasks from your Google account
- Asking a series of questions about your upcoming week
- Analyzing your commitments and providing a summary
$ workbench prepareBefore using the prepare command, you'll need to set up Google OAuth credentials:
-
Go to the Google Cloud Console
-
Create a new project or select an existing one
-
Enable the Calendar and Tasks APIs:
- Go to "APIs & Services" > "Library"
- Search for "Google Calendar API" and enable it
- Search for "Google Tasks API" and enable it
-
Create OAuth 2.0 credentials:
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth client ID"
- Choose "Desktop app" as the application type
- Give it a name and click "Create"
- You'll get a client ID and client secret
-
Configure your credentials in
~/.workbench.yaml:
google:
client_id: "your-client-id.apps.googleusercontent.com"
client_secret: "your-client-secret"
token_file: "~/.workbench/google_token.json"The first time you run the command, it will:
- Open a browser window for you to authorize the application
- Ask you to paste the authorization code
- Store the token for future use
The command will then:
- Show your upcoming calendar events for the next week
- Ask you a series of questions about your upcoming week
- Analyze your commitments and provide a summary