@openthread/claude-code-plugin 0.1.0 → 0.1.2
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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +5 -5
- package/package.json +3 -8
- package/scripts/auth.sh +3 -3
- package/scripts/share.sh +3 -3
- package/scripts/token.sh +2 -2
- package/skills/share-thread/SKILL.md +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @openthread/claude-code-plugin
|
|
2
2
|
|
|
3
|
-
Share Claude Code conversations to [OpenThread](https://openthread.
|
|
3
|
+
Share Claude Code conversations to [OpenThread](https://openthread.me) -- a Reddit-like platform for AI conversation threads.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@openthread/claude-code-plugin)
|
|
6
6
|
[](https://github.com/nicholasgriffintn/openthread/blob/main/LICENSE)
|
|
@@ -24,7 +24,7 @@ Authenticated as @yourname
|
|
|
24
24
|
Auto-generated title: "Debugging PKCE token refresh in auth middleware"
|
|
25
25
|
Posted to c/ClaudeCode
|
|
26
26
|
|
|
27
|
-
https://openthread.
|
|
27
|
+
https://openthread.me/c/ClaudeCode/posts/abc123
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
## Features
|
|
@@ -72,14 +72,14 @@ Environment variables override the default endpoints. Set them in your shell pro
|
|
|
72
72
|
|
|
73
73
|
| Variable | Default | Description |
|
|
74
74
|
| --- | --- | --- |
|
|
75
|
-
| `OPENTHREAD_API_URL` | `https://
|
|
76
|
-
| `OPENTHREAD_WEB_URL` | `https://openthread.
|
|
75
|
+
| `OPENTHREAD_API_URL` | `https://openthread.me/api` | Backend API base URL |
|
|
76
|
+
| `OPENTHREAD_WEB_URL` | `https://openthread.me` | Web app base URL (used for post links) |
|
|
77
77
|
|
|
78
78
|
## Manual Install
|
|
79
79
|
|
|
80
80
|
If you prefer not to use npm:
|
|
81
81
|
|
|
82
|
-
1. Download the latest
|
|
82
|
+
1. Download the latest `.zip` release from [openthread.me/extensions](https://openthread.me/extensions).
|
|
83
83
|
2. Extract it to `~/.claude/plugins/openthread-share/`.
|
|
84
84
|
3. Restart Claude Code. The plugin will be detected on next launch.
|
|
85
85
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openthread/claude-code-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Share Claude Code conversations to OpenThread",
|
|
5
5
|
"bin": {
|
|
6
6
|
"openthread-claude": "bin/cli.sh"
|
|
@@ -29,10 +29,5 @@
|
|
|
29
29
|
"share"
|
|
30
30
|
],
|
|
31
31
|
"author": "OpenThread",
|
|
32
|
-
"license": "MIT"
|
|
33
|
-
|
|
34
|
-
"type": "git",
|
|
35
|
-
"url": "https://github.com/nicholasgriffintn/openthread.git",
|
|
36
|
-
"directory": "apps/claude-code-plugin"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
32
|
+
"license": "MIT"
|
|
33
|
+
}
|
package/scripts/auth.sh
CHANGED
|
@@ -7,8 +7,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
7
7
|
# shellcheck source=token.sh
|
|
8
8
|
source "$SCRIPT_DIR/token.sh"
|
|
9
9
|
|
|
10
|
-
API_BASE="${OPENTHREAD_API_URL:-https://
|
|
11
|
-
WEB_BASE="${OPENTHREAD_WEB_URL:-https://openthread.
|
|
10
|
+
API_BASE="${OPENTHREAD_API_URL:-https://openthread.me/api}"
|
|
11
|
+
WEB_BASE="${OPENTHREAD_WEB_URL:-https://openthread.me}"
|
|
12
12
|
EXTENSION_ID="claude-code"
|
|
13
13
|
CALLBACK_PORT=18923
|
|
14
14
|
REDIRECT_URI="http://localhost:${CALLBACK_PORT}/callback"
|
|
@@ -149,7 +149,7 @@ exchange_code() {
|
|
|
149
149
|
|
|
150
150
|
echo "Exchanging authorization code for tokens..." >&2
|
|
151
151
|
|
|
152
|
-
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "${API_BASE}/
|
|
152
|
+
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "${API_BASE}/auth/extension/token" \
|
|
153
153
|
-H "Content-Type: application/json" \
|
|
154
154
|
-d "{
|
|
155
155
|
\"code\": \"${auth_code}\",
|
package/scripts/share.sh
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
set -euo pipefail
|
|
8
8
|
|
|
9
9
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
10
|
-
API_BASE="${OPENTHREAD_API_URL:-https://
|
|
10
|
+
API_BASE="${OPENTHREAD_API_URL:-https://openthread.me/api}"
|
|
11
11
|
|
|
12
12
|
# --- Parse JSONL session file into compact markdown body ---
|
|
13
13
|
# Extracts only text blocks from assistant messages, skips thinking/tool_use/tool_result/etc.
|
|
@@ -131,7 +131,7 @@ print(json.dumps(payload))
|
|
|
131
131
|
" "$compact_body" "$title" "$community_id" "$tags_json")
|
|
132
132
|
|
|
133
133
|
# POST to import endpoint
|
|
134
|
-
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "${API_BASE}/
|
|
134
|
+
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "${API_BASE}/posts/import" \
|
|
135
135
|
-H "Authorization: Bearer ${access_token}" \
|
|
136
136
|
-H "Content-Type: application/json" \
|
|
137
137
|
-d "$payload")
|
|
@@ -192,7 +192,7 @@ print(json.dumps(payload))
|
|
|
192
192
|
" "$export_file" "$title" "$community_id" "$tags_json")
|
|
193
193
|
|
|
194
194
|
# POST to import endpoint
|
|
195
|
-
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "${API_BASE}/
|
|
195
|
+
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "${API_BASE}/posts/import" \
|
|
196
196
|
-H "Authorization: Bearer ${access_token}" \
|
|
197
197
|
-H "Content-Type: application/json" \
|
|
198
198
|
-d "$payload")
|
package/scripts/token.sh
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# bash token.sh check — exit 0 if authenticated, 1 if not
|
|
8
8
|
set -euo pipefail
|
|
9
9
|
|
|
10
|
-
API_BASE="${OPENTHREAD_API_URL:-https://
|
|
10
|
+
API_BASE="${OPENTHREAD_API_URL:-https://openthread.me/api}"
|
|
11
11
|
EXTENSION_ID="claude-code"
|
|
12
12
|
CREDENTIALS_DIR="$HOME/.config/openthread"
|
|
13
13
|
CREDENTIALS_FILE="$CREDENTIALS_DIR/credentials.json"
|
|
@@ -75,7 +75,7 @@ refresh_token() {
|
|
|
75
75
|
local current_refresh
|
|
76
76
|
current_refresh=$(get_refresh_token) || return 1
|
|
77
77
|
|
|
78
|
-
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "${API_BASE}/
|
|
78
|
+
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "${API_BASE}/auth/extension/refresh" \
|
|
79
79
|
-H "Content-Type: application/json" \
|
|
80
80
|
-d "{
|
|
81
81
|
\"refreshToken\": \"${current_refresh}\",
|
|
@@ -10,8 +10,8 @@ This skill shares the current Claude Code conversation to OpenThread in 4 steps.
|
|
|
10
10
|
## Configuration
|
|
11
11
|
|
|
12
12
|
```
|
|
13
|
-
API_BASE="${OPENTHREAD_API_URL:-
|
|
14
|
-
WEB_BASE="${OPENTHREAD_WEB_URL:-
|
|
13
|
+
API_BASE="${OPENTHREAD_API_URL:-https://openthread.me/api}"
|
|
14
|
+
WEB_BASE="${OPENTHREAD_WEB_URL:-https://openthread.me}"
|
|
15
15
|
PLUGIN_DIR=<directory containing this skill — find it relative to this file, e.g. apps/claude-code-plugin or ~/.claude/plugins/openthread-share>
|
|
16
16
|
```
|
|
17
17
|
|
|
@@ -93,7 +93,7 @@ First, check if the `/share-thread` command was invoked with **arguments** (any
|
|
|
93
93
|
|
|
94
94
|
1. **Fetch communities**:
|
|
95
95
|
```bash
|
|
96
|
-
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" "$API_BASE/
|
|
96
|
+
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" "$API_BASE/communities?limit=50"
|
|
97
97
|
```
|
|
98
98
|
Response format: `{"data": [{"id": "uuid", "name": "Name", "slug": "slug"}, ...], "pagination": {...}}`
|
|
99
99
|
|