|
| 1 | +# DevGlobe — OpenCode Plugin |
| 2 | + |
| 3 | +Track your OpenCode activity on the [DevGlobe](https://devglobe.xyz) world map. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- [OpenCode](https://github.com/anomalyco/opencode) installed |
| 8 | +- A DevGlobe account (sign in at [devglobe.xyz](https://devglobe.xyz) with GitHub, X (Twitter), or Google) |
| 9 | + |
| 10 | +## Install |
| 11 | + |
| 12 | +Add `opencode-devglobe` to your `opencode.json`: |
| 13 | + |
| 14 | +```json |
| 15 | +{ |
| 16 | + "plugin": ["opencode-devglobe"] |
| 17 | +} |
| 18 | +``` |
| 19 | + |
| 20 | +OpenCode installs the plugin automatically on startup via npm. |
| 21 | + |
| 22 | +<details> |
| 23 | +<summary>Alternative: install from a local clone</summary> |
| 24 | + |
| 25 | +```bash |
| 26 | +git clone https://github.com/Nako0/devglobe-extension |
| 27 | +cd devglobe-extension/opencode-plugin |
| 28 | +npm install && npm run build |
| 29 | +``` |
| 30 | + |
| 31 | +Then in your `opencode.json`: |
| 32 | + |
| 33 | +```json |
| 34 | +{ |
| 35 | + "plugin": ["file:///path/to/devglobe-extension/opencode-plugin/dist/index.js"] |
| 36 | +} |
| 37 | +``` |
| 38 | + |
| 39 | +</details> |
| 40 | + |
| 41 | +## Setup |
| 42 | + |
| 43 | +After installing, restart OpenCode and ask it to set up DevGlobe: |
| 44 | + |
| 45 | +``` |
| 46 | +setup devglobe with my key devglobe_YOUR_KEY_HERE |
| 47 | +``` |
| 48 | + |
| 49 | +Get your API key at [devglobe.xyz](https://devglobe.xyz) — sign in, then open your **profile settings**. |
| 50 | + |
| 51 | +OpenCode will call the `devglobe_setup` tool, which saves your key and creates default settings. Heartbeats start automatically while you code. |
| 52 | + |
| 53 | +### Alternative: manual setup |
| 54 | + |
| 55 | +```bash |
| 56 | +mkdir -p ~/.devglobe |
| 57 | +echo "your-api-key-here" > ~/.devglobe/api_key |
| 58 | +echo '{"anonymousMode": true, "shareRepo": false}' > ~/.devglobe/config.json |
| 59 | +``` |
| 60 | + |
| 61 | +Or use an environment variable (add to `~/.zshrc` or `~/.bashrc`): |
| 62 | + |
| 63 | +```bash |
| 64 | +export DEVGLOBE_API_KEY="your-api-key-here" |
| 65 | +``` |
| 66 | + |
| 67 | +## Commands |
| 68 | + |
| 69 | +The plugin registers tools that the AI agent can call on your behalf. Just ask in natural language: |
| 70 | + |
| 71 | +| What you say | Tool called | Description | |
| 72 | +|--------------|-------------|-------------| |
| 73 | +| "setup devglobe with key X" | `devglobe_setup` | Configure your API key and create default settings | |
| 74 | +| "enable anonymous mode on devglobe" | `devglobe_anonymous` | Toggle anonymous mode (city-level location) | |
| 75 | +| "share my repo on devglobe" | `devglobe_share_repo` | Toggle repository sharing on the globe | |
| 76 | +| "set my devglobe status to Working on X" | `devglobe_status` | Set a status message on your globe profile | |
| 77 | +| "check devglobe status" | `devglobe_check` | Verify installation (API key, config) | |
| 78 | + |
| 79 | +### Settings |
| 80 | + |
| 81 | +| Setting | Default | Description | |
| 82 | +|---------|---------|-------------| |
| 83 | +| `anonymousMode` | `true` | Your marker is placed on a random city in your country (from 152,000+ cities). Your real location is never sent. | |
| 84 | +| `shareRepo` | `false` | Display your current repo on your DevGlobe profile. | |
| 85 | + |
| 86 | +Settings are stored in `~/.devglobe/config.json` and can also be modified via the tools above. |
| 87 | + |
| 88 | +## How it works |
| 89 | + |
| 90 | +The plugin hooks into OpenCode's `tool.execute.after` and `file.edited` events to detect coding activity. It sends a heartbeat to DevGlobe at most once per minute via devglobe-core. It automatically detects: |
| 91 | + |
| 92 | +- The programming language from the files you interact with (exact file paths from tool calls) |
| 93 | +- Your git repository (from `git remote get-url origin`) |
| 94 | +- Your approximate location (via IP geolocation, cached for 1 hour) |
| 95 | + |
| 96 | +Your coding session then appears live on the [DevGlobe map](https://devglobe.xyz) with the editor shown as `opencode`. |
| 97 | + |
| 98 | +A forced heartbeat is sent when the session goes idle or is deleted, ensuring your last activity is always recorded. |
| 99 | + |
| 100 | +## Updating |
| 101 | + |
| 102 | +Since the plugin is installed from npm, OpenCode fetches the latest version automatically. To force an update, remove the cache: |
| 103 | + |
| 104 | +```bash |
| 105 | +rm -rf ~/.cache/opencode/node_modules/opencode-devglobe |
| 106 | +``` |
| 107 | + |
| 108 | +Then restart OpenCode. |
| 109 | + |
| 110 | +## GitHub App — Verified commit stats |
| 111 | + |
| 112 | +Commit statistics displayed on DevGlobe (insertions/deletions per week) are **never collected by this plugin**. They are fetched server-side via a [GitHub App](https://github.com/apps/devglobeapp) that requests only **Metadata: Read-only** — the most minimal permission available. No access to source code, file contents, commit messages, issues, or pull requests. |
| 113 | + |
| 114 | +See the [main extensions README](../README.md#-github-app--verified-commit-stats) for details. |
| 115 | + |
| 116 | +## Privacy |
| 117 | + |
| 118 | +| Data | Sent | Detail | |
| 119 | +|------|------|--------| |
| 120 | +| Programming language | Yes | Detected from file extensions of files being edited. | |
| 121 | +| Approximate location | Yes | Coordinates **snapped to your city center** (from a database of 152,000+ cities). | |
| 122 | +| Repo name | **You decide** | `owner/repo` is **only sent to the server if `shareRepo` is enabled** (disabled by default). When disabled, your repo name never leaves your machine. | |
| 123 | +| Anonymous mode | **You decide** | When enabled, real coordinates are replaced with a random city in your country (from a database of 152,000+ cities worldwide). Your actual location is never transmitted. | |
| 124 | +| Coding time | Yes | Accumulated per day, per language. | |
| 125 | + |
| 126 | +The plugin **never** reads your source code, file contents, file names, keystrokes, commit messages, environment variables, or credentials. |
| 127 | + |
| 128 | +## Support |
| 129 | + |
| 130 | +- Website: [devglobe.xyz](https://devglobe.xyz) |
| 131 | +- Contact: [contact@devglobe.xyz](mailto:contact@devglobe.xyz) |
| 132 | +- Issues: [GitHub Issues](https://github.com/Nako0/devglobe-extension/issues) |
0 commit comments