Skip to content

Commit f342878

Browse files
authored
Merge pull request #30 from automagik-dev/feat/workit-oneliner
feat: one-liner installer + agent plugin bootstrap
2 parents f16fece + c2657fc commit f342878

38 files changed

Lines changed: 2256 additions & 196 deletions

.goreleaser.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ project_name: workit
55
changelog:
66
disable: true
77

8+
before:
9+
hooks:
10+
- mkdir -p dist
11+
- tar -czf dist/workit-plugin_{{ .Version }}.tar.gz -C plugins workit
12+
813
builds:
914
- id: wk
1015
main: ./cmd/wk
@@ -82,3 +87,7 @@ archives:
8287

8388
checksum:
8489
name_template: checksums.txt
90+
91+
release:
92+
extra_files:
93+
- glob: dist/workit-plugin_*.tar.gz

INSTALL.md

Lines changed: 110 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,57 @@
1-
# workit — Quick Install for OpenClaw Agents
1+
# workit — Installation Guide
22

33
> Give your OpenClaw agent full access to Google Workspace (Gmail, Calendar, Drive, Docs, Sheets, Contacts, Tasks, and more) via CLI.
44
5-
## 1. Install the Binary
5+
## 1. Quick Install (Recommended)
6+
7+
Install the latest release binary and Claude Code skill in one command:
68

79
```bash
8-
curl -fsSL https://raw.githubusercontent.com/automagik-dev/workit/main/scripts/install.sh | bash
10+
curl -sSL https://raw.githubusercontent.com/automagik-dev/workit/main/install.sh | sh
911
```
1012

11-
For subsequent upgrades:
13+
This downloads the pre-built binary for your platform from GitHub Releases and installs it to `~/.local/bin/wk`.
14+
15+
### Installer Flags
16+
17+
Pass flags after a `--` separator when piping to `sh`:
18+
19+
```bash
20+
# Force overwrite an existing installation
21+
curl -sSL https://raw.githubusercontent.com/automagik-dev/workit/main/install.sh | sh -s -- --force
22+
23+
# Install a specific version
24+
curl -sSL https://raw.githubusercontent.com/automagik-dev/workit/main/install.sh | sh -s -- --version v0.5.0
25+
26+
# Show installer help
27+
curl -sSL https://raw.githubusercontent.com/automagik-dev/workit/main/install.sh | sh -s -- --help
28+
```
29+
30+
| Flag | Description |
31+
|------|-------------|
32+
| `--force` | Overwrite existing installation without prompting |
33+
| `--version VERSION` | Install a specific release tag (e.g. `v0.5.0`) |
34+
| `--help` | Show installer usage |
35+
36+
### Environment Variables
37+
38+
| Variable | Description |
39+
|----------|-------------|
40+
| `WK_RELEASE_URL` | Override the download URL (useful for offline/air-gapped testing) |
41+
42+
### Update
1243

1344
```bash
1445
wk update
1546
```
1647

48+
---
49+
1750
## 2. Configure Credentials
1851

1952
**Option A: Pre-built binary (recommended for internal use)**
2053

21-
If the binary was built with `make build-internal`, it already has OAuth credentials. Skip to step 3.
54+
If the binary was built with `make build-internal`, it already has OAuth credentials baked in. Skip to step 3.
2255

2356
**Option B: Environment variables**
2457

@@ -34,6 +67,8 @@ export WK_CALLBACK_SERVER="https://auth.example.com"
3467
wk auth credentials ~/path/to/client_secret.json
3568
```
3669

70+
---
71+
3772
## 3. Authenticate a Google Account
3873

3974
### For agents (headless — no browser needed):
@@ -57,6 +92,8 @@ wk auth add you@gmail.com --services=user
5792
# Opens browser, complete login, done.
5893
```
5994

95+
---
96+
6097
## 4. Set Up Keyring (Headless Environments)
6198

6299
On servers without a desktop keychain:
@@ -69,6 +106,8 @@ wk auth keyring file
69106
export WK_KEYRING_PASSWORD="your-secure-password"
70107
```
71108

109+
---
110+
72111
## 5. Verify It Works
73112

74113
```bash
@@ -81,6 +120,8 @@ wk drive list --account you@gmail.com
81120
wk calendar events list --account you@gmail.com
82121
```
83122

123+
---
124+
84125
## 6. Add to OpenClaw Config
85126

86127
Add `wk` to your agent's workspace. In your agent's `TOOLS.md`:
@@ -132,6 +173,8 @@ Access Gmail, Calendar, Drive, Docs, Sheets, Contacts, Tasks via `wk` CLI.
132173
- Multiple accounts supported: `wk auth add second@gmail.com`
133174
```
134175

176+
---
177+
135178
## 7. Drive Sync Setup (optional)
136179

137180
To sync a Google Drive folder to a local directory:
@@ -160,18 +203,78 @@ Changes sync bidirectionally:
160203

161204
---
162205

206+
## 8. Build from Source (Developer / Contributor)
207+
208+
If you want to contribute to workit or build a custom binary, you need Go 1.21+ and the repo cloned locally.
209+
210+
### Requirements
211+
212+
- Go 1.21 or newer — [go.dev/doc/install](https://go.dev/doc/install)
213+
- GNU Make
214+
215+
### Quick Build
216+
217+
```bash
218+
git clone https://github.com/automagik-dev/workit.git
219+
cd workit
220+
make build
221+
./bin/wk --help
222+
```
223+
224+
### Makefile Targets
225+
226+
| Target | Description |
227+
|--------|-------------|
228+
| `make build` | Build binary to `bin/wk` (community build, no baked-in credentials) |
229+
| `make build-automagik` | Build with Automagik OAuth credentials (requires internal secrets) |
230+
| `make build-internal` | Build with internal-use baked-in credentials |
231+
| `make tools` | Install dev tools (`gofumpt`, `goimports`, `golangci-lint`) to `.tools/` |
232+
| `make test` | Run test suite |
233+
| `make lint` | Run linter |
234+
| `make install` | Install `bin/wk` to `~/.local/bin` |
235+
236+
### Developer Credential Setup
237+
238+
When building from source you need to supply your own OAuth credentials:
239+
240+
```bash
241+
# Option A: Environment variables
242+
export WK_CLIENT_ID="your-client-id"
243+
export WK_CLIENT_SECRET="your-client-secret"
244+
export WK_CALLBACK_SERVER="https://auth.example.com"
245+
246+
# Option B: Credentials file
247+
mkdir -p ~/.config/workit && chmod 700 ~/.config/workit
248+
cat > ~/.config/workit/credentials.env << 'CRED'
249+
WK_CLIENT_ID=your-client-id
250+
WK_CLIENT_SECRET=your-client-secret
251+
WK_CALLBACK_SERVER=https://your-callback-server.example.com
252+
CRED
253+
```
254+
255+
Then build and install:
256+
257+
```bash
258+
make build
259+
make install # copies bin/wk to ~/.local/bin
260+
```
261+
262+
After building, proceed with [Configure Credentials](#2-configure-credentials) above.
263+
264+
---
265+
163266
## TL;DR for Agents
164267

165268
```bash
166269
# Install
167-
curl -fsSL https://raw.githubusercontent.com/automagik-dev/workit/main/scripts/install.sh | bash
270+
curl -sSL https://raw.githubusercontent.com/automagik-dev/workit/main/install.sh | sh
168271

169272
# Update
170273
wk update
171274

172275
# Configure (if not using pre-built binary)
173276
export WK_CLIENT_ID="xxx"
174-
export WK_CLIENT_SECRET="xxx"
277+
export WK_CLIENT_SECRET="xxx"
175278
export WK_CALLBACK_SERVER="https://auth.example.com"
176279
export WK_KEYRING_BACKEND=file
177280
export WK_KEYRING_PASSWORD="secure-password"

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@
6565
### One Command (recommended)
6666

6767
```bash
68-
curl -fsSL https://raw.githubusercontent.com/automagik-dev/workit/main/scripts/install.sh | bash
68+
curl -sSL https://raw.githubusercontent.com/automagik-dev/workit/main/install.sh | sh
6969
```
7070

71-
This installs the latest release binary and bootstraps local skills.
71+
This downloads the pre-built binary for your platform from GitHub Releases and installs it to `~/.local/bin/wk`.
7272

7373
### Update
7474

@@ -87,10 +87,12 @@ yay -S workit
8787

8888
#### Build from source
8989

90+
Requires Go 1.21+. See [INSTALL.md](INSTALL.md) for full developer build instructions.
91+
9092
```bash
9193
git clone https://github.com/automagik-dev/workit.git
9294
cd workit
93-
make
95+
make build
9496
./bin/wk --help
9597
```
9698

0 commit comments

Comments
 (0)