dotshare-cli 1.0.0 โ†’ 3.0.0

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.
Files changed (57) hide show
  1. package/LICENSE +201 -21
  2. package/README.md +245 -189
  3. package/SECURITY.md +145 -0
  4. package/bin/dotshare-agent.js +7 -0
  5. package/bin/dotshare-cli.js +11 -7
  6. package/bin/dotshare-mcp.js +6 -0
  7. package/docs/AGENT_INTEGRATION.md +541 -0
  8. package/out/agent/commands.js +119 -0
  9. package/out/agent/server.js +97 -0
  10. package/out/cli/commands.js +128 -376
  11. package/package.json +34 -94
  12. package/bin/dotshare-scheduler.js +0 -208
  13. package/out/analytics.js +0 -67
  14. package/out/analytics.js.map +0 -1
  15. package/out/bluesky.js +0 -100
  16. package/out/bluesky.js.map +0 -1
  17. package/out/cli/commands.js.map +0 -1
  18. package/out/cli/config.js +0 -144
  19. package/out/cli/config.js.map +0 -1
  20. package/out/credential-provider.js +0 -92
  21. package/out/credential-provider.js.map +0 -1
  22. package/out/discord.js +0 -85
  23. package/out/discord.js.map +0 -1
  24. package/out/extension.js +0 -1383
  25. package/out/extension.js.map +0 -1
  26. package/out/facebook.js +0 -66
  27. package/out/facebook.js.map +0 -1
  28. package/out/gemini.js +0 -219
  29. package/out/gemini.js.map +0 -1
  30. package/out/linkedin.js +0 -110
  31. package/out/linkedin.js.map +0 -1
  32. package/out/message-handlers.js +0 -391
  33. package/out/message-handlers.js.map +0 -1
  34. package/out/openai.js +0 -217
  35. package/out/openai.js.map +0 -1
  36. package/out/post-executor.js +0 -168
  37. package/out/post-executor.js.map +0 -1
  38. package/out/reddit.js +0 -538
  39. package/out/reddit.js.map +0 -1
  40. package/out/scheduled-posts.js +0 -100
  41. package/out/scheduled-posts.js.map +0 -1
  42. package/out/scheduler.js +0 -98
  43. package/out/scheduler.js.map +0 -1
  44. package/out/storage-manager.js +0 -403
  45. package/out/storage-manager.js.map +0 -1
  46. package/out/telegram.js +0 -104
  47. package/out/telegram.js.map +0 -1
  48. package/out/types.js +0 -3
  49. package/out/types.js.map +0 -1
  50. package/out/webview-provider.js +0 -168
  51. package/out/webview-provider.js.map +0 -1
  52. package/out/x.js +0 -55
  53. package/out/x.js.map +0 -1
  54. package/out/xai.js +0 -235
  55. package/out/xai.js.map +0 -1
  56. package/src/cli/commands.ts +0 -380
  57. package/src/cli/config.ts +0 -148
package/README.md CHANGED
@@ -1,253 +1,309 @@
1
- # DotShare
1
+ <div align="center">
2
2
 
3
- [![Version](https://img.shields.io/badge/version-2.0.0-blue.svg)](https://github.com/kareem2099/DotShare)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
3
+ <img src="https://raw.githubusercontent.com/kareem2099/DotShare/master/assets/icons/icon.png" alt="DotShare logo" width="96" height="96">
5
4
 
6
- A VS Code extension that helps you share your project updates to social media using AI-powered content generation.
5
+ # DotShare โ€” Share Code Updates to LinkedIn, X, Bluesky, Mastodon & Dev.to from VS Code
7
6
 
8
- ## Features
7
+ **Write, generate with AI, and publish developer updates, threads, code snapshots and Dev.to articles without leaving your editor.**
9
8
 
10
- - ๐Ÿค– **AI-Powered Content Generation**: Generate engaging social media posts using Gemini AI, OpenAI, or xAI
11
- - โœ๏ธ **Manual Post Creation**: Write and post content manually without AI assistance
12
- - ๐Ÿ“Ž **Enhanced Media Upload**: Drag-and-drop and click-to-browse functionality for images and videos
13
- - ๐Ÿ”— **LinkedIn Integration**: Share posts directly to LinkedIn
14
- - ๐Ÿ“ฑ **Telegram Support**: Post to Telegram channels and groups
15
- - ๐Ÿฆ **X/Twitter Integration**: Post directly to X (formerly Twitter)
16
- - ๐Ÿ“˜ **Facebook Support**: Share to Facebook profiles and pages
17
- - ๐Ÿ”ต **Discord Webhooks**: Post updates to Discord channels
18
- - ๐ŸŸ  **Reddit Integration**: Submit posts to Reddit communities and user profiles (r/ and u/)
19
- - ๐ŸŒ… **BlueSky Support**: Early adopter integration with BlueSky social
20
- - โฐ **Scheduled Posting**: CLI tool for automated cross-platform posting
21
- - ๐ŸŒ **Multi-language Support**: English, Arabic, and Russian
22
- - ๐ŸŽจ **Interactive UI**: Built-in webview for managing your posts with improved user experience
23
- - ๐Ÿ“Š **Analytics Dashboard**: Track posting performance across platforms
9
+ [![VS Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/freerave.dotshare?label=VS%20Marketplace&logo=visualstudiocode&color=007ACC)](https://marketplace.visualstudio.com/items?itemName=freerave.dotshare)
10
+ [![Installs](https://img.shields.io/visual-studio-marketplace/i/freerave.dotshare?color=10b981)](https://marketplace.visualstudio.com/items?itemName=freerave.dotshare)
11
+ [![Open VSX](https://img.shields.io/open-vsx/v/freerave/dotshare?label=Open%20VSX&color=a60ee5)](https://open-vsx.org/extension/freerave/dotshare)
12
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/kareem2099/DotShare/blob/master/LICENSE)
13
+ [![GitHub Stars](https://img.shields.io/github/stars/kareem2099/DotShare?style=flat&logo=github)](https://github.com/kareem2099/DotShare)
24
14
 
25
- ## Installation
15
+ [Install](#-install) ยท [Features](#-features) ยท [Platforms](#-supported-platforms) ยท [Pricing](#-free-vs-dotsuite-plans) ยท [Setup guides](#-platform-setup-guides) ยท [FAQ](#-faq) ยท [Website](https://dotsuite.dev/en/product/dotshare)
26
16
 
27
- ### VS Code Extension
17
+ </div>
28
18
 
29
- 1. Open VS Code
30
- 2. Go to Extensions (Ctrl+Shift+X)
31
- 3. Search for "DotShare"
32
- 4. Click Install
19
+ ---
33
20
 
34
- ### CLI Scheduler
21
+ **DotShare** is a free, open-source **VS Code extension for building in public**. It turns your commits, changelog and code into posts for **LinkedIn, X (Twitter), Bluesky, Mastodon, Telegram, Discord and Dev.to**, then publishes them directly from the editor. Generate drafts with **Gemini, OpenAI, Claude, DeepSeek or Grok**, build threads, attach images, capture **CodeSnap** code screenshots, create **GitHub Gists**, and schedule posts through **[DotSuite](https://dotsuite.dev)** cloud.
35
22
 
36
- The CLI scheduler can be used independently for automated posting:
23
+ > Part of **[DotSuite](https://dotsuite.dev)**, a family of developer tools for VS Code, Next.js and Python.
37
24
 
38
- ```bash
39
- npm install -g dotshare
40
- dotshare-scheduler --help
41
- ```
25
+ ---
42
26
 
43
- ## Usage
27
+ ## ๐Ÿ†• What's New in 3.6.0 โ€” MCP & Publishing Library
44
28
 
45
- ### VS Code Extension
29
+ - **Local MCP server** for AI agents, with setup and diagnostics for Codex.
30
+ - **Shared Publishing Library** for reviewing drafts, templates and per-account versions in VS Code.
31
+ - **Saved previews and receipts** that record exactly which draft revision was published and where.
32
+ - **Encrypted local records** with an OS-keyring master key and verified migration for existing libraries.
46
33
 
47
- #### Generating Posts
34
+ ๐Ÿ‘‰ [Full changelog](https://github.com/kareem2099/DotShare/blob/master/CHANGELOG.md)
48
35
 
49
- 1. Open your project in VS Code
50
- 2. Use Command Palette (Ctrl+Shift+P)
51
- 3. Run "DotShare: Generate Social Media Post with Gemini"
52
- 4. Choose your AI provider and customize the generated content
36
+ ---
53
37
 
54
- #### Sharing Posts
38
+ ## ๐Ÿค– Publish through an AI agent
55
39
 
56
- - Use "DotShare: Share to LinkedIn" to post to LinkedIn
57
- - Use "DotShare: Share to Telegram" to post to Telegram groups/channels
40
+ DotShare now includes a local **MCP server** and an agent CLI. Connect Codex or another
41
+ MCP client, then ask it to preview or publish posts, images and threads to named
42
+ accounts on LinkedIn, X, Bluesky, Mastodon, Telegram, Discord and Dev.to. Per-account
43
+ content, multiple accounts, durable retry protection and DotSuite cloud scheduling
44
+ are available through structured tools.
58
45
 
59
- The extension now supports sharing to multiple platforms including:
60
- - LinkedIn (profiles)
61
- - Telegram (bots, channels, groups)
62
- - X/Twitter (tweets)
63
- - Facebook (profiles and pages)
64
- - Discord (webhooks)
65
- - Reddit (submissions)
66
- - BlueSky (posts)
46
+ Install `dotshare-cli-3.0.0.tgz` from the [GitHub release](https://github.com/kareem2099/DotShare/releases/tag/v3.6.0)
47
+ with `npm install -g ./dotshare-cli-3.0.0.tgz`, or build this checkout with `npm run compile`.
48
+ Run `dotshare-agent setup` to connect Codex, then `dotshare-agent doctor` to verify
49
+ the connection. Connect accounts with `dotshare-agent accounts add`.
50
+ `dotshare-agent doctor --check-accounts` checks platform identities without publishing.
51
+ From a source checkout, replace `dotshare-agent` with `node bin/dotshare-agent.js`.
67
52
 
68
- ### CLI Tool
53
+ Existing users should run `dotshare-agent security protect` and restart
54
+ all MCP clients/VS Code windows. Shared library records are encrypted with an
55
+ OS-keyring master key; Linux requires Secret Service without automatic fallback.
56
+ See [the local security model and recovery requirements](SECURITY.md).
69
57
 
70
- The CLI provides a powerful command-line interface for social media posting.
58
+ Saved drafts have explicit **Draft โ†’ Preview โ†’ Published** states, with separate
59
+ in-progress/uncertain results and publication URLs. Editing invalidates the preview;
60
+ `publish_draft` sends the saved revision and verified local image bytes. Use
61
+ `create_draft`, `update_draft`, `preview_draft` and `publish_draft` from your agent,
62
+ or the CLI's `drafts` commands.
71
63
 
72
- #### Quick Start
64
+ Reusable local **templates** support literal `{{variables}}`, required/default values,
65
+ HTTPS URL fields and platform/account variants. Start with five built-in recipes,
66
+ save your own, then create an independent draft. Inspect each account's version with
67
+ `get_draft_variants` and edit it with `set_draft_variant`; every edit requires a fresh
68
+ publication preview. Rendering and draft creation never publish or call an AI provider.
69
+ The same workflow is available through `templates` and `drafts` CLI commands.
73
70
 
74
- ```bash
75
- # Initialize CLI configuration
76
- dotshare init
71
+ In VS Code, run **DotShare: Open Publishing Library** (or use the sidebar button)
72
+ to work with those **same MCP drafts and templates** visually. Edit shared content
73
+ and account versions, fill/customize templates, prepare a saved preview and publish
74
+ it with per-account receipts. External edits refresh automatically; unsaved changes
75
+ are preserved and stale saves are rejected. The library connects to your configured
76
+ local MCP installation, without copying platform credentials. Earlier platform
77
+ composer drafts remain in their existing screen; no automatic migration occurs.
77
78
 
78
- # Authenticate with platforms
79
- dotshare login telegram
80
- dotshare login linkedin
81
- dotshare login reddit
79
+ โ†’ [Publishing Library guide](docs/PUBLISHING_LIBRARY.md)
82
80
 
83
- # Check your setup
84
- dotshare whoami
81
+ โ†’ [Agent setup, Codex configuration, examples and supported limits](docs/AGENT_INTEGRATION.md)
85
82
 
86
- # Start posting!
87
- dotshare "Hello from CLI! ๐Ÿš€"
88
- ```
83
+ ---
89
84
 
90
- #### CLI Commands
85
+ ## ๐Ÿ“ฆ Install
91
86
 
92
- ##### `dotshare init`
93
- Initialize CLI configuration and test server connection.
94
- ```bash
95
- dotshare init
96
- ```
87
+ **From VS Code:** open Extensions (`Ctrl+Shift+X` / `Cmd+Shift+X`), search **DotShare**, and click **Install**.
97
88
 
98
- ##### `dotshare login <platform>`
99
- Authenticate with social media platforms. Opens browser for OAuth flow.
100
- ```bash
101
- dotshare login telegram # Telegram authentication
102
- dotshare login linkedin # LinkedIn authentication
103
- dotshare login reddit # Reddit authentication
104
- ```
89
+ **From the command line:**
105
90
 
106
- ##### `dotshare whoami`
107
- Show current configuration and authenticated platforms.
108
91
  ```bash
109
- dotshare whoami
92
+ code --install-extension freerave.dotshare
110
93
  ```
111
94
 
112
- ##### `dotshare [message]` (Default)
113
- Post message to all configured platforms.
114
- ```bash
115
- # Post text message
116
- dotshare "๐Ÿš€ Just deployed a new feature!"
95
+ Also available on the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=freerave.dotshare) and [Open VSX](https://open-vsx.org/extension/freerave/dotshare) (VSCodium, Cursor, Windsurf and other compatible editors). Requires VS Code **1.90** or later.
117
96
 
118
- # Post with media
119
- dotshare "Beautiful sunset today ๐ŸŒ…" --media ./sunset.jpg
97
+ ### Quick start
120
98
 
121
- # Post to specific platforms
122
- dotshare "Team update" --platforms telegram,linkedin
99
+ 1. Click the **DotShare** icon in the Activity Bar.
100
+ 2. On a platform card, add your credentials (see the [setup guides](#-platform-setup-guides)).
101
+ 3. Click **โœจ Create Post**, write or generate your post, and press **Share** (or `Ctrl+Enter`).
123
102
 
124
- # Post media only
125
- dotshare --media ./video.mp4
126
- ```
103
+ ---
127
104
 
128
- #### CLI Options
129
-
130
- - `--media <path>`: Path to media file (image/video)
131
- - `--platforms <list>`: Comma-separated list of platforms (telegram,linkedin,reddit)
132
-
133
- #### CLI Configuration
134
-
135
- Configuration is stored in `~/.dotshare/config.json`:
136
-
137
- ```json
138
- {
139
- "serverUrl": "https://your-railway-app.railway.app",
140
- "credentials": {
141
- "telegram": {
142
- "botToken": "your_telegram_bot_token",
143
- "chatId": "your_chat_id"
144
- },
145
- "linkedin": {
146
- "accessToken": "your_linkedin_token"
147
- },
148
- "reddit": {
149
- "accessToken": "your_reddit_token",
150
- "refreshToken": "your_refresh_token"
151
- }
152
- },
153
- "defaultPlatforms": ["telegram", "linkedin", "reddit"]
154
- }
155
- ```
105
+ ## โœจ Features
156
106
 
157
- ### Scheduled Posting
107
+ ### ๐Ÿค– AI release copilot
108
+ - Generate posts and full articles with **Google Gemini, OpenAI, Anthropic Claude, DeepSeek or xAI Grok**, using your own API key. Models are discovered live from each provider.
109
+ - DotShare reads your **CHANGELOG, README, package manifest, Git commits and diffs** so posts describe what actually changed.
110
+ - Five writing tones: Professional, Build in Public, Technical Deep-Dive, Quick TL;DR, and Full Markdown Article.
111
+ - Writes in **English or Arabic**. Run **DotShare: Inspect AI Release Context** to see exactly what the AI receives.
112
+ - Known secret patterns (API keys, tokens, private keys) are redacted from code excerpts before they reach an AI provider.
158
113
 
159
- Use the CLI scheduler for automated cross-platform posting:
114
+ ### ๐Ÿงต Thread composer
115
+ - Build threads for **X, Bluesky and Mastodon**, with a character counter per post and up to **4 images per post**.
116
+ - Long single posts are split into numbered threads automatically.
117
+ - **X Premium** mode for posts up to 25,000 characters.
160
118
 
161
- ```bash
162
- # Run scheduler (requires config file)
163
- npm run scheduler
119
+ ### ๐Ÿ“ฐ Dev.to publishing
120
+ - Generate technical articles with YAML frontmatter, or load the Markdown file open in your editor.
121
+ - Live sanitized preview with word count and reading time; publish as draft or public, with series support.
164
122
 
165
- # Or use the interactive CLI for manual posting
166
- dotshare "Scheduled post content"
167
- ```
123
+ ### ๐Ÿ“ธ CodeSnap
124
+ - Turn selected code into a polished image with 9+ themes (Dracula, Nord, Tokyo Night, GitHub, Catppuccin and more).
125
+ - Send the snapshot straight to the composer, or save it as PNG.
126
+
127
+ ### ๐Ÿ’ป GitHub Gists
128
+ - Create a public or secret Gist from a selection or a whole file, then share it in one click.
129
+
130
+ ### ๐Ÿ“Š Productivity
131
+ - **Drafts** for social posts, articles and Gists.
132
+ - **Analytics** for share counts and success rates per platform.
133
+ - **Smart hashtags** from your project, commits and tech stack (skipped where they don't help, such as Discord).
134
+ - **Saved API sets** to switch between accounts.
135
+ - Interface available in **English, Arabic and Russian**.
136
+
137
+ ---
138
+
139
+ ## ๐ŸŒ Supported Platforms
140
+
141
+ | Platform | Posts | Threads | Images | Cloud scheduling | Sign-in |
142
+ |---|:---:|:---:|:---:|:---:|---|
143
+ | ๐Ÿ”— **LinkedIn** | โœ… | โ€” | 1 | โœ… | OAuth or access token |
144
+ | ๐• **X (Twitter)** | โœ… | โœ… | 4 | โœ… | OAuth |
145
+ | ๐Ÿฆ‹ **Bluesky** | โœ… | โœ… | 4 | โœ… | Handle + app password |
146
+ | ๐Ÿ˜ **Mastodon** | โœ… | โœ… | 4 | โœ… | Instance URL + access token |
147
+ | ๐Ÿ“ฑ **Telegram** | โœ… | โ€” | 10 | โœ… | Bot token + chat ID |
148
+ | ๐Ÿ’ฌ **Discord** | โœ… | โ€” | 10 | โ€” | Webhook URL |
149
+ | ๐Ÿ‘จโ€๐Ÿ’ป **Dev.to** | Articles | โ€” | Cover image URL | โœ… | API key |
150
+ | โšก **GitHub Gist** | Snippets | โ€” | โ€” | โ€” | GitHub sign-in |
151
+
152
+ ---
153
+
154
+ ## ๐Ÿ’Ž Free vs DotSuite Plans
155
+
156
+ Everything that runs inside VS Code with your own accounts and AI keys is **free and open source**. Paid plans add cloud services hosted by DotSuite.
157
+
158
+ | | **Free** | **Pro** | **Max** |
159
+ |---|:---:|:---:|:---:|
160
+ | Direct publishing to every platform | โœ… | โœ… | โœ… |
161
+ | AI generation with your own key | โœ… | โœ… | โœ… |
162
+ | Threads, drafts, Gists, analytics | โœ… | โœ… | โœ… |
163
+ | Cloud-scheduled posts per month | 100 | Unlimited | Unlimited |
164
+ | Scheduled posts with images per month | 10 | Unlimited | Unlimited |
165
+ | Scheduler precision | Hourly | Every 5 minutes | Exact time |
166
+ | CodeSnap without watermark, custom branding, 3ร— and JPG/WEBP export | โ€” | โœ… | โœ… |
167
+ | Price | **$0** | **$15 / month** | **$30 / month** |
168
+
169
+ See current plans on the [DotShare page on DotSuite](https://dotsuite.dev/en/product/dotshare).
170
+
171
+ ---
168
172
 
169
- #### CLI Troubleshooting
173
+ ## ๐Ÿ”‘ Platform Setup Guides
170
174
 
171
- **"Server connection failed"**
172
- - Make sure the Python server is running: `cd DotSharePY && python3 server.py`
173
- - Check that the server URL is correct (default: http://localhost:3000)
175
+ <details>
176
+ <summary><b>๐Ÿ˜ Mastodon</b></summary>
174
177
 
175
- **"No platforms configured"**
176
- - Run `dotshare login <platform>` to authenticate with platforms
177
- - Check `dotshare whoami` to see configured platforms
178
+ 1. On your Mastodon server, open **Preferences โ†’ Development โ†’ New application** (for example `https://mastodon.social/settings/applications/new`).
179
+ 2. Enter any name, keep the redirect URI as `urn:ietf:wg:oauth:2.0:oob`, and enable only **`write:statuses`** and **`write:media`**.
180
+ 3. Save, open the application, and copy **Your access token**.
181
+ 4. In DotShare's Mastodon card, enter your instance URL (such as `https://mastodon.social`) and the token.
178
182
 
179
- **"Authentication failed"**
180
- - Verify your credentials are correct
181
- - Check that the Python server has the right environment variables
182
- - Try re-authenticating with `dotshare login <platform>`
183
+ Any instance works. The URL must use HTTPS, and the token is only ever sent to that server.
184
+ </details>
183
185
 
184
- **Permission Issues**
185
- - Make sure the CLI has execute permissions: `chmod +x bin/dotshare-cli.js`
186
- - Check file permissions for `~/.dotshare/config.json`
186
+ <details>
187
+ <summary><b>๐Ÿฆ‹ Bluesky</b></summary>
187
188
 
188
- #### CLI Development
189
+ 1. Go to [Bluesky โ†’ Settings โ†’ App passwords](https://bsky.app/settings/app-passwords) and create an app password (never use your main password).
190
+ 2. Enter your handle (such as `yourname.bsky.social`) and the app password in DotShare.
191
+ </details>
189
192
 
190
- To modify the CLI:
193
+ <details>
194
+ <summary><b>๐• X (Twitter)</b></summary>
191
195
 
192
- 1. Edit commands in `src/cli/commands.ts`
193
- 2. Edit config management in `src/cli/config.ts`
194
- 3. Compile: `npm run compile`
195
- 4. Test: `npm run cli --help`
196
+ Click **Connect** on the X card and authorize DotShare in your browser. Tokens refresh automatically.
197
+ </details>
196
198
 
197
- ## Requirements
199
+ <details>
200
+ <summary><b>๐Ÿ”— LinkedIn</b></summary>
198
201
 
199
- - VS Code 1.74.0 or higher
200
- - Node.js 18.x or higher
201
- - API keys for AI services (Gemini, OpenAI, etc.)
202
- - API keys for social media platforms
202
+ Click **Connect** on the LinkedIn card to sign in with OAuth. You can also paste an access token with the `w_member_social` scope from [LinkedIn Developers](https://www.linkedin.com/developers/) under the advanced options.
203
+ </details>
203
204
 
204
- ## Configuration
205
+ <details>
206
+ <summary><b>๐Ÿ“ฑ Telegram</b></summary>
205
207
 
206
- Set up your API keys in VS Code settings or environment variables:
208
+ 1. Message [@BotFather](https://t.me/botfather), create a bot with `/newbot`, and copy its token.
209
+ 2. Add the bot to your channel or group, then get the chat ID (for example with [@FreeID](https://github.com/kareem2099/FreeID)).
210
+ 3. Enter both in DotShare.
211
+ </details>
207
212
 
208
- - `dotshare.geminiApiKey`: For Gemini AI
209
- - `dotshare.openaiApiKey`: For OpenAI
210
- - `dotshare.xaiApiKey`: For xAI
211
- - `dotshare.linkedinToken`: LinkedIn access token
212
- - `dotshare.telegramBot`: Telegram bot token
213
- - `dotshare.telegramChat`: Telegram chat ID
214
- - `dotshare.xAccessToken`: X/Twitter access token
215
- - `dotshare.xAccessSecret`: X/Twitter access secret
216
- - `dotshare.facebookToken`: Facebook access token
217
- - `dotshare.facebookPageToken`: Facebook page access token
218
- - `dotshare.facebookPageId`: Facebook page ID
219
- - `dotshare.discordWebhookUrl`: Discord webhook URL
220
- - `dotshare.redditClientId`: Reddit client ID
221
- - `dotshare.redditClientSecret`: Reddit client secret
222
- - `dotshare.redditAccessToken`: Reddit access token
223
- - `dotshare.redditRefreshToken`: Reddit refresh token
224
- - `dotshare.blueskyIdentifier`: BlueSky username/handle
225
- - `dotshare.blueskyPassword`: BlueSky app password
213
+ <details>
214
+ <summary><b>๐Ÿ’ฌ Discord</b></summary>
226
215
 
227
- ## Development
216
+ In your server, open **Channel settings โ†’ Integrations โ†’ Webhooks**, create a webhook, and paste its URL into DotShare.
217
+ </details>
218
+
219
+ <details>
220
+ <summary><b>๐Ÿ‘จโ€๐Ÿ’ป Dev.to</b></summary>
221
+
222
+ Generate a key under [Dev.to Settings โ†’ Extensions](https://dev.to/settings/extensions) and paste it into DotShare. Dev.to's API doesn't accept image uploads, so use publicly hosted image URLs in your article and cover image.
223
+ </details>
224
+
225
+ ---
226
+
227
+ ## โŒจ๏ธ DotShare CLI
228
+
229
+ Use named local accounts from your terminal or CI. Requires Node.js 22.12+ and
230
+ an unlocked OS credential store. Build/install this checkout for the current agent
231
+ and security features; older published npm packages do not contain them.
228
232
 
229
233
  ```bash
230
- git clone https://github.com/kareem2099/DotShare.git
231
- cd DotShare
232
- npm install
233
- npm run compile
234
- # Press F5 in VS Code to test
234
+ node bin/dotshare-agent.js security protect
235
+ node bin/dotshare-agent.js accounts add personal-mastodon --platform mastodon
236
+ node bin/dotshare-agent.js templates list
237
+ node bin/dotshare-agent.js drafts create --input draft.json
238
+ node bin/dotshare-agent.js drafts preview DRAFT_ID --revision 1
239
+ node bin/dotshare-agent.js drafts publish DRAFT_ID --revision 1 --preview-id PREVIEW_ID --request-id release-1
235
240
  ```
236
241
 
237
- ## Contributing
242
+ Credentials stay in the required OS keyring. Shared drafts, custom templates and
243
+ journals are encrypted with a separate OS-keyring master key. The old `dotshare
244
+ "message"` relay and legacy login are disabled; use the direct named-account tools.
245
+ [Input formats and examples](docs/AGENT_INTEGRATION.md).
246
+
247
+ ---
248
+
249
+ ## ๐Ÿ” Security & Privacy
250
+
251
+ - **Your keys stay in VS Code SecretStorage.** Webviews only receive whether a key is saved, never its value, and saved keys show as **๐Ÿ”’ Key Saved & Active**.
252
+ - **Direct publishing** sends each credential only to its own platform. AI prompts go only to the provider you choose.
253
+ - **Cloud scheduling is opt-in.** Before any credential is synced to DotSuite, DotShare asks for explicit consent (Mastodon has its own prompt). Sync requires HTTPS and a signed-in DotSuite account.
254
+ - **Logs are redacted**: credential values and OAuth callback queries are excluded, and known secret formats are masked.
255
+ - **Clear All Credentials** removes local platform, AI, GitHub and DotSuite secrets and cloud consent. Copies already synced to DotSuite are revoked from the DotSuite Dashboard.
256
+
257
+ Server-side handling is implemented in the separately maintained DotSuite backend; local SecretStorage does not protect copies held there.
258
+
259
+ ---
260
+
261
+ ## โ“ FAQ
262
+
263
+ **Is DotShare free?**
264
+ Yes. The extension is open source under Apache 2.0, and direct publishing with your own accounts and AI keys is free. Only DotSuite cloud services, such as higher scheduling limits, are paid.
265
+
266
+ **Do I need my own server to post to Mastodon?**
267
+ No. You only need an account on any Mastodon instance and an access token. DotShare talks to your instance directly.
268
+
269
+ **Which AI models can I use?**
270
+ Any text model your key can access from Google Gemini, OpenAI, Anthropic Claude, DeepSeek or xAI Grok. DotShare lists them live from each provider.
271
+
272
+ **Can I schedule posts for later?**
273
+ Yes, with a free DotSuite account. Scheduled posts run on DotSuite servers, so your computer doesn't need to stay on.
274
+
275
+ **Does DotShare work in VSCodium, Cursor or Windsurf?**
276
+ Yes, install it from [Open VSX](https://open-vsx.org/extension/freerave/dotshare).
277
+
278
+ **Where are my API keys stored?**
279
+ In VS Code's encrypted SecretStorage on your machine. See [Security & Privacy](#-security--privacy).
280
+
281
+ ---
282
+
283
+ ## ๐Ÿค Contributing
284
+
285
+ Bug reports, platform ideas and pull requests are welcome. Read the [contributing guide](https://github.com/kareem2099/DotShare/blob/master/CONTRIBUTING.md) to get started, and see the [roadmap](https://github.com/kareem2099/DotShare/blob/master/ROADMAP.md) for what's planned.
286
+
287
+ ## ๐Ÿ’ Support the Project
288
+
289
+ If DotShare saves you time, you can help keep it alive:
290
+
291
+ <div align="center">
292
+
293
+ <a href="https://www.buymeacoffee.com/freerave"><img src="https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black" alt="Buy Me a Coffee"></a>
294
+ <a href="https://github.com/sponsors/kareem2099"><img src="https://img.shields.io/badge/Sponsor%20on-GitHub-ea4aaa?style=for-the-badge&logo=github-sponsors" alt="Sponsor on GitHub"></a>
295
+ <a href="https://paypal.me/freerave1"><img src="https://img.shields.io/badge/Donate-PayPal-00457C?style=for-the-badge&logo=paypal" alt="Donate via PayPal"></a>
238
296
 
239
- We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
297
+ </div>
240
298
 
241
- ## Changelog
299
+ Or โญ [star the repository](https://github.com/kareem2099/DotShare), share DotShare with your network, and [report issues](https://github.com/kareem2099/DotShare/issues).
242
300
 
243
- See [CHANGELOG.md](CHANGELOG.md) for the latest updates.
301
+ ## ๐Ÿ“„ License
244
302
 
245
- ## License
303
+ DotShare is licensed under the [Apache License 2.0](https://github.com/kareem2099/DotShare/blob/master/LICENSE).
246
304
 
247
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
305
+ <div align="center">
248
306
 
249
- ## Support
307
+ **Made with โค๏ธ by [FreeRave](https://dotsuite.dev) for developers who build in public.**
250
308
 
251
- - ๐Ÿ“ง Create an issue on GitHub
252
- - ๏ฟฝ Get your Telegram User ID using [FreeID Bot](https://github.com/kareem2099/FreeID)
253
- - ๏ฟฝ๐Ÿ’ Support the project: [GitHub Sponsors](https://github.com/sponsors/kareem2099)
309
+ </div>
package/SECURITY.md ADDED
@@ -0,0 +1,145 @@
1
+ # DotShare local security model
2
+
3
+ This describes the protections implemented in this checkout. It is not an
4
+ independent security certification or a claim that the entire operating system,
5
+ every platform adapter, or the separate DotSuite backend has been audited.
6
+
7
+ ## Credentials
8
+
9
+ - CLI/MCP platform credentials and the DotSuite session token live in the native
10
+ OS credential store, not JSON configuration, command arguments or MCP responses.
11
+ - On Linux, every entry explicitly requires **Secret Service**. An unavailable or
12
+ locked provider fails closed. Automatic fallback to the kernel keyutils store is
13
+ disabled. Existing kernel-fallback entries are not silently copied; reconnect
14
+ affected accounts through hidden CLI prompts after configuring Secret Service.
15
+ - macOS/Windows use their native OS stores. VS Code account/AI credentials continue
16
+ to use VS Code SecretStorage, with status-only responses to webviews and host-side
17
+ secret redaction. DotShare cannot attest how the chosen OS/VS Code provider
18
+ encrypts its own database; configure a password-protected provider and OS account.
19
+ - Local account IDs are shared by the OS user's CLI service, as before. Different
20
+ `DOTSHARE_HOME` directories are not separate user/security identities for platform
21
+ keys; use distinct IDs to avoid accidental replacement. Separate OS users are
22
+ required for isolation from other local users.
23
+ - The legacy CLI relay publishing path is disabled: it used to send raw platform
24
+ credentials to a configured intermediary. Legacy login no longer echoes secrets.
25
+ Use `accounts add` and the direct named-account publishing commands/tools.
26
+ - Cloud credential sync remains a separate explicit-consent feature of the extension;
27
+ this change does not verify or change the remote backend's credential storage.
28
+
29
+ ## Encrypted shared library
30
+
31
+ Saved agent drafts, custom templates and operation journals under `DOTSHARE_HOME`
32
+ use **AES-256-GCM** with a cryptographically random 256-bit key, a fresh random
33
+ 96-bit nonce per write and a required 128-bit authentication tag. Associated data
34
+ binds the format version, key ID, category and record filename; swapping or renaming
35
+ ciphertext between records fails authentication. A key-confirmation HMAC prevents
36
+ a substituted OS key from being used to overwrite records under the same key ID.
37
+ Encryption/decryption use Node's built-in crypto implementation.
38
+
39
+ The master key is stored only in the required OS credential store under a random
40
+ `vault:<keyId>` entry. `security.json` contains a public key ID and key confirmation,
41
+ not the master key. No password, master-key environment variable or local plaintext
42
+ file fallback is accepted. The first saved record needs an unlocked/available OS
43
+ keyring. Missing, malformed or mismatched keys do not trigger key regeneration for
44
+ an existing vault.
45
+
46
+ Directories/files are private (0700/0600 on Unix), checked for ownership and regular
47
+ file type. Symlinks and multiply linked files are refused. Writes use exclusive
48
+ private temporary files, file/directory fsync and atomic replacement. Exclusive
49
+ operation claims survive failed writes so an uncertain operation cannot simply be
50
+ resent. Short cross-process write/migration and record locks prevent concurrent
51
+ commits from silently replacing each other. Stale locks require inspection rather
52
+ than automatic removal. File reads and decoded records are bounded.
53
+
54
+ Account IDs/labels, non-secret CLI configuration and vault metadata remain private
55
+ metadata rather than encrypted content. Built-in recipes are public source data.
56
+ Original user-selected images and private temporary upload copies are not encrypted
57
+ by the record vault. Earlier platform-composer drafts remain in VS Code global state;
58
+ they are not silently migrated into the shared agent library.
59
+
60
+ ## Upgrading an existing library
61
+
62
+ Stop active publications, update/build the checkout, then run:
63
+
64
+ ```sh
65
+ node bin/dotshare-agent.js security status
66
+ node bin/dotshare-agent.js security protect
67
+ node bin/dotshare-agent.js doctor --check-accounts
68
+ ```
69
+
70
+ `status` inventories file formats/permissions without reading platform credentials
71
+ or the master key. It is not a decryption/authentication test. `protect` verifies
72
+ existing account access, tightens owned storage permissions, preflights JSON and
73
+ existing ciphertext, and encrypts legacy records in place under a write lock. Each
74
+ converted record is authenticated/read back and compared with its original content.
75
+ It preserves IDs, revisions and publication receipts. It does not publish, upload,
76
+ refresh tokens, change MCP configuration, export keys or create plaintext backups.
77
+ The migration is resumable; do not reset the vault if any record fails.
78
+
79
+ Restart **all** DotShare MCP clients and VS Code windows afterwards. Older already
80
+ running processes still contain the previous code and cannot be made safe by changing
81
+ files on disk alone. New code refuses legacy plaintext during normal reads instead
82
+ of silently continuing without encryption. `doctor` reports plaintext/unreadable
83
+ records separately, and checks key access only with account checks enabled.
84
+
85
+ Encrypting a file does not securely erase prior disk pages, OS snapshots, sync
86
+ copies, logs or backups. Review existing copies according to your storage/backup
87
+ policy; the application does not delete them automatically.
88
+
89
+ ## Recovery and rotation
90
+
91
+ Back up the encrypted records, `security.json` and the OS keyring using the OS/provider's
92
+ protected backup facilities. Files alone cannot recover a lost master key. Do not
93
+ delete the manifest, generate a replacement key, or copy a key beside ciphertext
94
+ as a recovery shortcut. Restore the matching original key/metadata. Vault master-key
95
+ rotation/export is not implemented by this change; perform a separately reviewed
96
+ re-encryption migration rather than editing `security.json` or the keyring entry.
97
+
98
+ For suspected platform-token compromise, revoke/rotate at the platform, then run
99
+ `accounts add` for that account using hidden prompts. Local account removal deletes
100
+ the local credential; it does not revoke the provider token. Inspect already claimed
101
+ operations before any new publish action.
102
+
103
+ ## Transport and disclosure controls
104
+
105
+ - Credential-bearing API requests do not follow HTTP redirects. Axios defaults and
106
+ direct requests are hardened; extension cloud fetches use `redirect:error`.
107
+ Insecure global TLS verification/agents are refused in these guarded paths.
108
+ - LinkedIn upload destinations must be HTTPS LinkedIn hosts before attaching the
109
+ bearer token. Discord webhooks require the canonical HTTPS Discord API shape.
110
+ - Known configured secrets, standard token patterns and Telegram/Discord credential
111
+ URL segments are redacted from diagnostics. Structured logging omits request
112
+ configs, headers and credential fields and handles circular values safely.
113
+ - Malformed credential JSON and corrupted stored JSON produce generic errors without
114
+ echoing input contents. Credential input files must be owned, private regular files;
115
+ hidden terminal prompts or stdin are preferred.
116
+ - Publishing/scheduling blocks known credentials in the selected content before
117
+ claiming/sending the action. This is a guard for registered secrets, not a general
118
+ proof that source code/images or arbitrary user text contain no secrets.
119
+ - MCP tools never expose the master/platform keys. The UI uses the same server,
120
+ respects configured tool allow/deny lists, escapes content as text, and publishes
121
+ saved drafts only with their exact revision/preview and stable request ID.
122
+
123
+ An unlocked OS account, same-user malware, a compromised extension/agent with code
124
+ execution, root/admin access, memory inspection and a compromised platform/backend
125
+ are outside the protection provided by local-file encryption. Use OS account
126
+ isolation, screen locking and full-disk encryption as appropriate. No application
127
+ can safely claim that keys are inaccessible to code running with the owner's full
128
+ permissions.
129
+
130
+ ## Verification and references
131
+
132
+ Unit/integration tests cover ciphertext-only persistence, tag/nonce/key tampering,
133
+ wrong record identity, missing/substituted keys, explicit migration, private file
134
+ checks, keyring pinning, redaction, redirect rejection and leak blocking.
135
+ `node scripts/verify-security.cjs` tests the real OS keyring and loopback redirects
136
+ with disposable keys/fixtures only. `verify-agent.cjs` and `verify-library.cjs` test
137
+ encrypted records across actual MCP/CLI processes without real publications. Tests
138
+ clean up their temporary keyring master entries. Dependency audit results are a
139
+ point-in-time known-advisory check, not a full supply-chain review.
140
+
141
+ - [Node crypto authenticated-encryption API](https://nodejs.org/api/crypto.html)
142
+ - [Keyring binding and Linux backend selection](https://github.com/Brooooooklyn/keyring-node)
143
+ - [LinkedIn upload URL documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/documents-api)
144
+
145
+ Dotenvy integration remains independent of these protections and has not been added.