poke-gate 0.1.1 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,66 @@
1
+ # Installing Agents
2
+
3
+ You can download community agents from the Poke Gate repository with a single command.
4
+
5
+ ## Install an agent
6
+
7
+ ```bash
8
+ npx poke-gate agent get <name>
9
+ ```
10
+
11
+ For example:
12
+
13
+ ```bash
14
+ npx poke-gate agent get beeper
15
+ ```
16
+
17
+ This does three things:
18
+
19
+ 1. **Downloads the agent script** from GitHub to `~/.config/poke-gate/agents/`
20
+ 2. **Downloads the env template** (if one exists)
21
+ 3. **Prompts you to fill in env variables** interactively
22
+
23
+ ## Interactive env setup
24
+
25
+ If the agent needs secrets, you'll be prompted:
26
+
27
+ ```
28
+ Fetching agent "beeper" from GitHub...
29
+ Saved: ~/.config/poke-gate/agents/beeper.1h.js
30
+
31
+ This agent needs 1 env variable(s):
32
+
33
+ BEEPER_TOKEN (Find it in Beeper Desktop > Settings > API): █
34
+
35
+ Saved: ~/.config/poke-gate/agents/.env.beeper
36
+
37
+ Test it: npx poke-gate run-agent beeper
38
+ ```
39
+
40
+ The prompt parses the `.env` template, identifies placeholder values, and asks you for real ones. Comments from the template are shown as hints.
41
+
42
+ ## Test after installing
43
+
44
+ Always test the agent before relying on it:
45
+
46
+ ```bash
47
+ npx poke-gate run-agent beeper
48
+ ```
49
+
50
+ ## Existing env files
51
+
52
+ If you already have a `.env.<name>` file, it won't be overwritten. You'll see:
53
+
54
+ ```
55
+ .env.beeper already exists, skipped.
56
+ ```
57
+
58
+ ## Browse available agents
59
+
60
+ See all community agents at:
61
+
62
+ [github.com/f/poke-gate/tree/main/examples/agents](https://github.com/f/poke-gate/tree/main/examples/agents)
63
+
64
+ ## Install via macOS app
65
+
66
+ You can also manage agents through the macOS app's **Agents** window — browse, edit, and create agents with a built-in syntax-highlighted editor.
@@ -0,0 +1,97 @@
1
+ # Sharing Agents
2
+
3
+ Built a useful agent? Share it with the community by opening a pull request.
4
+
5
+ ## How sharing works
6
+
7
+ Community agents live in the [`examples/agents/`](https://github.com/f/poke-gate/tree/main/examples/agents) directory of the Poke Gate repository. Anyone can install them with:
8
+
9
+ ```bash
10
+ npx poke-gate agent get <name>
11
+ ```
12
+
13
+ ## Submit your agent
14
+
15
+ ### 1. Fork the repo
16
+
17
+ Go to [github.com/f/poke-gate](https://github.com/f/poke-gate) and click **Fork**.
18
+
19
+ ### 2. Add your agent files
20
+
21
+ Place your files in `examples/agents/`:
22
+
23
+ ```
24
+ examples/agents/
25
+ your-agent.1h.js # The agent script
26
+ .env.your-agent # Env template with placeholder values
27
+ ```
28
+
29
+ ### 3. Agent checklist
30
+
31
+ Before submitting, make sure your agent:
32
+
33
+ - Has a **frontmatter block** with `@agent`, `@name`, `@description`, `@interval`, `@env`, `@author`
34
+ - Uses **placeholder values** in the `.env` file (e.g. `YOUR_TOKEN_HERE`) — never real credentials
35
+ - Has **comments in the `.env`** explaining where to find each value
36
+ - Handles **errors gracefully** — logs useful messages, doesn't crash silently
37
+ - Stays within the **5-minute timeout**
38
+ - Uses `getToken()` from the Poke SDK for authentication (not hardcoded tokens)
39
+
40
+ ### 4. Frontmatter example
41
+
42
+ ```javascript
43
+ /**
44
+ * @agent your-agent
45
+ * @name Your Agent Name
46
+ * @description Clear one-line description of what this agent does.
47
+ * @interval 1h
48
+ * @env API_TOKEN - Where to find this token
49
+ * @env BASE_URL - (optional) Override the default URL
50
+ * @author your-github-username
51
+ */
52
+ ```
53
+
54
+ ### 5. Env template example
55
+
56
+ ```env
57
+ # Where to find this token: App > Settings > API
58
+ API_TOKEN=your_token_here
59
+
60
+ # Optional: override the default API URL
61
+ # BASE_URL=http://localhost:8080
62
+ ```
63
+
64
+ Use `your_*_here` as placeholder values — the installer detects these and prompts the user.
65
+
66
+ ### 6. Open a PR
67
+
68
+ Push to your fork and open a pull request to `f/poke-gate` with:
69
+
70
+ - **Title:** `agent: add <name>`
71
+ - **Description:** What the agent does, what service it connects to, any prerequisites
72
+
73
+ ```bash
74
+ git checkout -b agent/your-agent
75
+ git add examples/agents/
76
+ git commit -m "agent: add your-agent"
77
+ git push origin agent/your-agent
78
+ ```
79
+
80
+ Then open the PR at [github.com/f/poke-gate/compare](https://github.com/f/poke-gate/compare).
81
+
82
+ ## Agent ideas
83
+
84
+ Looking for inspiration? Here are some agents the community would love:
85
+
86
+ | Idea | What it does |
87
+ |------|-------------|
88
+ | **GitHub notifications** | Fetch unread notifications and send a digest |
89
+ | **Calendar summary** | Summarize today's upcoming meetings |
90
+ | **Disk space monitor** | Alert when disk space is below a threshold |
91
+ | **Uptime checker** | Ping a list of URLs and report any downtime |
92
+ | **RSS reader** | Fetch latest articles from your feeds |
93
+ | **Git status** | Report uncommitted changes across your projects |
94
+ | **Docker health** | Check running containers and their status |
95
+ | **Mail digest** | Summarize unread emails from a local mail client |
96
+
97
+ Build one and share it!
package/docs/cli.md ADDED
@@ -0,0 +1,73 @@
1
+ # CLI Reference
2
+
3
+ ## Start the gate
4
+
5
+ ```bash
6
+ npx poke-gate
7
+ ```
8
+
9
+ Starts the MCP server, connects the tunnel, and begins the agent scheduler. On first run, if you're not signed in, opens Poke OAuth in your browser.
10
+
11
+ ### Verbose mode
12
+
13
+ ```bash
14
+ npx poke-gate --verbose
15
+ # or
16
+ npx poke-gate -v
17
+ ```
18
+
19
+ Shows real-time tool calls:
20
+
21
+ ```
22
+ [14:52:01] tool: run_command
23
+ [14:52:01] $ ls -la ~/Code
24
+ [14:52:03] tool: read_file
25
+ [14:52:03] read: ~/.zshrc
26
+ ```
27
+
28
+ ## Run an agent
29
+
30
+ ```bash
31
+ npx poke-gate run-agent <name>
32
+ ```
33
+
34
+ Runs a single agent script immediately and exits. Useful for testing.
35
+
36
+ **Example:**
37
+
38
+ ```bash
39
+ npx poke-gate run-agent beeper
40
+ ```
41
+
42
+ Finds `~/.config/poke-gate/agents/beeper.*.js` and runs it with the env from `.env.beeper`.
43
+
44
+ ## Install an agent
45
+
46
+ ```bash
47
+ npx poke-gate agent get <name>
48
+ ```
49
+
50
+ Downloads an agent from the [community repository](https://github.com/f/poke-gate/tree/main/examples/agents) and saves it to `~/.config/poke-gate/agents/`.
51
+
52
+ If the agent has an `.env` file, you'll be prompted to fill in the values:
53
+
54
+ ```
55
+ Fetching agent "beeper" from GitHub...
56
+ Saved: ~/.config/poke-gate/agents/beeper.1h.js
57
+
58
+ This agent needs 1 env variable(s):
59
+
60
+ BEEPER_TOKEN (Find it in Beeper Desktop > Settings > API): <you type>
61
+
62
+ Saved: ~/.config/poke-gate/agents/.env.beeper
63
+
64
+ Test it: npx poke-gate run-agent beeper
65
+ ```
66
+
67
+ ## Environment variables
68
+
69
+ | Variable | Description |
70
+ |----------|-------------|
71
+ | `POKE_API_KEY` | Override the API key (skips OAuth) |
72
+ | `POKE_API` | Override the Poke API base URL |
73
+ | `POKE_FRONTEND` | Override the Poke frontend URL |
@@ -0,0 +1,62 @@
1
+ # Getting Started
2
+
3
+ ## Install
4
+
5
+ ### Homebrew
6
+
7
+ The recommended way to install the macOS app:
8
+
9
+ ```bash
10
+ brew install f/tap/poke-gate
11
+ ```
12
+
13
+ ### Manual download
14
+
15
+ Download the latest **Poke.macOS.Gate.dmg** from [GitHub Releases](https://github.com/f/poke-gate/releases/latest), open it, and drag to Applications.
16
+
17
+ Since the app is not notarized, you may need to run:
18
+
19
+ ```bash
20
+ xattr -cr /Applications/Poke\ macOS\ Gate.app
21
+ ```
22
+
23
+ ### CLI only
24
+
25
+ If you don't need the macOS app:
26
+
27
+ ```bash
28
+ npx poke-gate
29
+ ```
30
+
31
+ ## Sign in
32
+
33
+ Poke Gate uses Poke OAuth to authenticate. On first launch:
34
+
35
+ 1. Open Poke Gate from your menu bar
36
+ 2. The app starts and connects automatically
37
+ 3. If you're not signed in, a browser window opens for Poke OAuth
38
+ 4. After signing in, the connection is established
39
+
40
+ You can also sign in manually:
41
+
42
+ ```bash
43
+ npx poke login
44
+ ```
45
+
46
+ ## Verify it works
47
+
48
+ Once connected, you'll see a green dot in the menu bar. The popover shows:
49
+
50
+ > ● Connected to your Poke, [your name]
51
+
52
+ Now open iMessage or Telegram and message your Poke:
53
+
54
+ > "What's my hostname?"
55
+
56
+ Poke will use the `system_info` tool to answer from your machine.
57
+
58
+ ## What's next?
59
+
60
+ - [How It Works](/how-it-works) — understand the architecture
61
+ - [Tools](/tools) — see all available tools
62
+ - [Agents](/agents/) — set up scheduled automation
@@ -0,0 +1,56 @@
1
+ # How It Works
2
+
3
+ Poke Gate bridges your machine to Poke's cloud so your AI assistant can execute tasks locally.
4
+
5
+ ## Architecture
6
+
7
+ ```mermaid
8
+ flowchart LR
9
+ A["You (iMessage)"] --> B["Poke Agent"]
10
+ B --> C["MCP Tunnel"]
11
+ C --> D["Poke Gate"]
12
+ D --> E["Executes locally"]
13
+ E --> C
14
+ C --> B
15
+ B --> A
16
+ ```
17
+
18
+ ## Step by step
19
+
20
+ 1. **You send a message** to Poke from iMessage, Telegram, or SMS — e.g. "What's running on port 3000?"
21
+
22
+ 2. **Poke's agent processes it** and decides it needs your machine to answer. It picks a tool like `run_command`.
23
+
24
+ 3. **The tool call travels through the MCP tunnel** — a WebSocket connection from Poke's cloud to your machine via the Piko protocol.
25
+
26
+ 4. **Poke Gate receives the call** on your local MCP server (a lightweight HTTP server running on localhost).
27
+
28
+ 5. **The tool executes locally** — runs the shell command, reads the file, takes the screenshot, etc.
29
+
30
+ 6. **The result flows back** through the tunnel to Poke's agent, which formats it and replies to you.
31
+
32
+ ## Key components
33
+
34
+ ### MCP Server
35
+
36
+ A local HTTP server that implements the [Model Context Protocol](https://modelcontextprotocol.io) (MCP) using raw JSON-RPC over HTTP. It exposes tools like `run_command`, `read_file`, etc.
37
+
38
+ ### PokeTunnel
39
+
40
+ A WebSocket-based tunnel from the [Poke SDK](https://www.npmjs.com/package/poke) that connects your local MCP server to Poke's cloud. Uses the Piko protocol with Yamux multiplexing for reliable, multiplexed communication.
41
+
42
+ ### Connection lifecycle
43
+
44
+ - On startup, Poke Gate creates a connection via `POST /mcp/connections/cli`
45
+ - A WebSocket tunnel is established to the upstream URL
46
+ - Poke's cloud can now route tool calls through the tunnel to your machine
47
+ - If the connection drops, it reconnects automatically
48
+ - Old connections are cleaned up before creating new ones to prevent duplicates
49
+
50
+ ## On-connect notification
51
+
52
+ When the tunnel connects, Poke Gate sends a message to your Poke agent:
53
+
54
+ > "Hey! I've connected my computer to you via Poke Gate. You can now run commands, read and write files, list directories, take screenshots, and check system info on my machine."
55
+
56
+ This ensures the agent knows your machine is available and which tools it can use.
package/docs/index.md ADDED
@@ -0,0 +1,63 @@
1
+ ---
2
+ layout: home
3
+
4
+ hero:
5
+ name: Poke Gate
6
+ text: A two-way bridge between your Mac and your AI.
7
+ tagline: Poke pulls from your Mac when you ask. Your Mac pushes to Poke when something happens. Run commands, read files, take screenshots — and automate it all with Agents.
8
+ image:
9
+ src: /logo.png
10
+ alt: Poke Gate
11
+ actions:
12
+ - theme: brand
13
+ text: Get Started
14
+ link: /getting-started
15
+ - theme: alt
16
+ text: View on GitHub
17
+ link: https://github.com/f/poke-gate
18
+
19
+ features:
20
+ - icon: 🖥️
21
+ title: Full Shell Access
22
+ details: Run any terminal command on your machine — ls, git, brew, python, curl, and more.
23
+ - icon: 📁
24
+ title: File Operations
25
+ details: Read, write, and list files and directories. Your Poke agent sees your filesystem.
26
+ - icon: 📸
27
+ title: Screenshots
28
+ details: Capture your screen remotely. Poke can see what you see.
29
+ - icon: 🤖
30
+ title: Agents
31
+ details: Scheduled scripts that run in the background — automate message digests, backups, health checks.
32
+ - icon: 🌴
33
+ title: macOS Menu Bar App
34
+ details: Native SwiftUI app that lives in your menu bar. Auto-connects, auto-restarts, shows real-time status.
35
+ - icon: ⚡
36
+ title: MCP Tunnel
37
+ details: Secure WebSocket tunnel powered by the Poke SDK. Only your authenticated agent can reach your machine.
38
+ ---
39
+
40
+ ## Quick install
41
+
42
+ ::: code-group
43
+
44
+ ```bash [Homebrew]
45
+ brew install f/tap/poke-gate
46
+ ```
47
+
48
+ ```bash [npm]
49
+ npx poke-gate
50
+ ```
51
+
52
+ ```bash [Manual]
53
+ # Download from GitHub Releases
54
+ # https://github.com/f/poke-gate/releases/latest
55
+ ```
56
+
57
+ :::
58
+
59
+ <br>
60
+
61
+ ::: tip Community project
62
+ Poke Gate is open source and not affiliated with Poke or The Interaction Company of California.
63
+ :::
@@ -0,0 +1,74 @@
1
+ # macOS App
2
+
3
+ Poke Gate includes a native SwiftUI menu bar app for macOS.
4
+
5
+ ## Menu bar
6
+
7
+ The app runs in the menu bar only — no Dock icon. Click the door icon to see the popover:
8
+
9
+ - **Status** — green dot when connected, yellow when connecting, red on error
10
+ - **Personalized** — shows "Connected to your Poke, [name]"
11
+ - **Recent activity** — last few log entries
12
+ - **Action buttons** — Logs, Agents, Settings, Restart/Start, Quit
13
+ - **About** — version, GitHub link
14
+
15
+ ### Status icons
16
+
17
+ | Icon | Meaning |
18
+ |------|---------|
19
+ | 🚪 (open) | Connected |
20
+ | 🚪 (closed) | Stopped or connecting |
21
+ | ⚠️ | Error |
22
+
23
+ ## Settings
24
+
25
+ Open Settings from the popover. The settings window shows:
26
+
27
+ - **Authentication status** — whether you're signed in via Poke OAuth
28
+ - **Sign in button** — runs `npx poke login` and opens a browser window
29
+ - **Connection status** — current state with a Reconnect button
30
+
31
+ ## Logs
32
+
33
+ The Logs window shows real-time activity:
34
+
35
+ - Tool calls are highlighted
36
+ - Errors appear in red
37
+ - Copy all logs to clipboard
38
+ - Clear logs
39
+
40
+ ## Agents Editor
41
+
42
+ The Agents window provides a built-in editor for managing agent scripts — no external editor needed.
43
+
44
+ <img src="/agents-editor.png" alt="Agents Editor" style="border-radius: 8px; border: 1px solid var(--vp-c-divider); margin: 16px 0;" />
45
+
46
+ - **Sidebar** — lists agents by `@name` from frontmatter, with interval badges and descriptions
47
+ - **Editor** — native syntax-highlighted code editor for JavaScript and env files
48
+ - **Tab bar** — switch between `.js` file and `.env` file
49
+ - **Interval editor** — change the schedule by typing a new interval (renames the file automatically)
50
+ - **New Agent** — creates a template agent with frontmatter
51
+ - **Delete** — right-click to remove an agent and its env file
52
+
53
+ Learn more about agents in the [Agents documentation](/agents/).
54
+
55
+ ## Auto-start
56
+
57
+ The app connects automatically on launch if you've previously signed in. If the connection drops, it reconnects after 2 seconds.
58
+
59
+ ## Building from source
60
+
61
+ Requires macOS 15+ and Xcode 26+.
62
+
63
+ ```bash
64
+ git clone https://github.com/f/poke-gate.git
65
+ cd poke-gate/clients/Poke\ macOS\ Gate
66
+ open Poke\ macOS\ Gate.xcodeproj
67
+ ```
68
+
69
+ Hit **Run** in Xcode, or build a universal DMG:
70
+
71
+ ```bash
72
+ cd poke-gate
73
+ ./build.sh
74
+ ```