social-agent-cli 1.0.1 → 1.0.3
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/bin/social-agent.js +55 -29
- package/install.ts +70 -16
- package/package.json +1 -1
package/bin/social-agent.js
CHANGED
|
@@ -54,6 +54,23 @@ switch (command) {
|
|
|
54
54
|
run("install.ts");
|
|
55
55
|
break;
|
|
56
56
|
|
|
57
|
+
case "config":
|
|
58
|
+
case "--config": {
|
|
59
|
+
const promptFile = join(DATA_DIR, "social-mode-prompt.md");
|
|
60
|
+
const configFile = join(DATA_DIR, "config.json");
|
|
61
|
+
const target = args[0] === "api" ? configFile : promptFile;
|
|
62
|
+
|
|
63
|
+
if (!existsSync(target)) {
|
|
64
|
+
console.log(`Dosya bulunamadı: ${target}\nÖnce 'social-agent setup' çalıştır.`);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const editor = process.env.EDITOR || "nano";
|
|
69
|
+
const { spawnSync } = await import("node:child_process");
|
|
70
|
+
spawnSync(editor, [target], { stdio: "inherit" });
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
|
|
57
74
|
case "login":
|
|
58
75
|
case "learn":
|
|
59
76
|
case "run":
|
|
@@ -67,43 +84,52 @@ switch (command) {
|
|
|
67
84
|
case undefined:
|
|
68
85
|
case "--help":
|
|
69
86
|
case "-h":
|
|
87
|
+
case "help":
|
|
70
88
|
console.log(`
|
|
71
|
-
social-agent - AI
|
|
89
|
+
social-agent v1.0 - AI-powered social media automation
|
|
90
|
+
|
|
91
|
+
Setup:
|
|
92
|
+
social-agent setup First-time setup wizard
|
|
93
|
+
social-agent config Edit AI personality & preferences
|
|
94
|
+
social-agent config api Edit API keys (config.json)
|
|
95
|
+
|
|
96
|
+
Browser Platforms (X, LinkedIn, Instagram, Facebook):
|
|
97
|
+
social-agent login <platform> Select Chrome profile & verify login
|
|
98
|
+
social-agent learn "<task>" <platform> Teach AI a new action
|
|
99
|
+
social-agent run <platform> "<cmd>" Execute with natural language
|
|
72
100
|
|
|
73
|
-
|
|
74
|
-
social-agent
|
|
101
|
+
API Platforms (Mastodon, Bluesky, Telegram):
|
|
102
|
+
social-agent post "<text>" --platforms mastodon,bluesky
|
|
75
103
|
|
|
76
|
-
|
|
77
|
-
social-agent
|
|
78
|
-
social-agent
|
|
79
|
-
social-agent
|
|
80
|
-
social-agent post "<metin>" --platforms x,mastodon Post at
|
|
81
|
-
social-agent status Bağlı platformları göster
|
|
82
|
-
social-agent history Post geçmişi
|
|
104
|
+
Info:
|
|
105
|
+
social-agent status Show connected platforms
|
|
106
|
+
social-agent history Show action history
|
|
107
|
+
social-agent help This help message
|
|
83
108
|
|
|
84
|
-
|
|
85
|
-
social-agent setup
|
|
109
|
+
Examples:
|
|
86
110
|
social-agent login x
|
|
87
|
-
social-agent learn
|
|
88
|
-
social-agent
|
|
89
|
-
social-agent run
|
|
90
|
-
social-agent
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
~/.social-agent/
|
|
96
|
-
~/.social-agent/
|
|
97
|
-
~/.social-agent/
|
|
98
|
-
~/.social-agent/
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
social-agent learn x → learn to post (default)
|
|
112
|
+
social-agent learn "learn to like tweets" x → learn liking
|
|
113
|
+
social-agent run x "like this tweet: https://..."
|
|
114
|
+
social-agent run x "like and retweet: https://..."
|
|
115
|
+
social-agent run linkedin "send 3 connection requests"
|
|
116
|
+
social-agent post "New feature!" --platforms mastodon
|
|
117
|
+
|
|
118
|
+
Data:
|
|
119
|
+
~/.social-agent/ All data lives here
|
|
120
|
+
~/.social-agent/social-mode-prompt.md AI personality (edit with: social-agent config)
|
|
121
|
+
~/.social-agent/config.json API keys (edit with: social-agent config api)
|
|
122
|
+
~/.social-agent/knowledge/ Platform knowledge files
|
|
123
|
+
~/.social-agent/maps/ Learned action maps
|
|
124
|
+
~/.social-agent/history.json Action log
|
|
125
|
+
|
|
126
|
+
Claude Code:
|
|
127
|
+
claude-social Social-aware mode (suggests posts at milestones)
|
|
128
|
+
/social Create post from current work context
|
|
103
129
|
`);
|
|
104
130
|
break;
|
|
105
131
|
|
|
106
132
|
default:
|
|
107
|
-
console.log(`
|
|
133
|
+
console.log(`Unknown command: ${command}\nRun 'social-agent help' for usage.`);
|
|
108
134
|
process.exit(1);
|
|
109
135
|
}
|
package/install.ts
CHANGED
|
@@ -195,34 +195,88 @@ Bu dosyayı düzenlemek için: ${promptPath}
|
|
|
195
195
|
console.log(" ⚠ /social komutunu ~/.claude/commands/social.md'ye oluşturmalısın");
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
// 9.
|
|
198
|
+
// 9. Platform Login & Learn
|
|
199
|
+
console.log(`
|
|
200
|
+
╔═══════════════════════════════════════╗
|
|
201
|
+
║ TEMEL KURULUM TAMAM! ║
|
|
202
|
+
╚═══════════════════════════════════════╝
|
|
203
|
+
`);
|
|
204
|
+
|
|
205
|
+
const browserPlatforms = [
|
|
206
|
+
{ key: "x", name: "X (Twitter)", url: "https://x.com" },
|
|
207
|
+
{ key: "linkedin", name: "LinkedIn", url: "https://www.linkedin.com" },
|
|
208
|
+
{ key: "instagram", name: "Instagram", url: "https://www.instagram.com" },
|
|
209
|
+
{ key: "facebook", name: "Facebook", url: "https://www.facebook.com" },
|
|
210
|
+
];
|
|
211
|
+
|
|
212
|
+
console.log(" Şimdi browser platformlarını kuralım.\n");
|
|
213
|
+
|
|
214
|
+
for (const platform of browserPlatforms) {
|
|
215
|
+
const wantLogin = await ask(rl, `${platform.name} kurmak ister misin? (e/h)`, "h");
|
|
216
|
+
|
|
217
|
+
if (wantLogin.toLowerCase() !== "e") continue;
|
|
218
|
+
|
|
219
|
+
console.log(`\n [${platform.key}] Chrome açılacak, hesabına giriş yap.`);
|
|
220
|
+
|
|
221
|
+
// Login
|
|
222
|
+
try {
|
|
223
|
+
execSync(`social-agent login ${platform.key}`, { stdio: "inherit" });
|
|
224
|
+
} catch {
|
|
225
|
+
console.log(` ⚠ ${platform.name} login atlandı.`);
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Learn
|
|
230
|
+
const wantLearn = await ask(rl, `${platform.name}'da post atmayı öğreteyim mi? (e/h)`, "e");
|
|
231
|
+
if (wantLearn.toLowerCase() === "e") {
|
|
232
|
+
console.log(` [${platform.key}] AI post atma akışını öğreniyor...`);
|
|
233
|
+
try {
|
|
234
|
+
execSync(`social-agent learn ${platform.key}`, { stdio: "inherit" });
|
|
235
|
+
} catch {
|
|
236
|
+
console.log(` ⚠ ${platform.name} öğrenme atlandı. Sonra yapabilirsin: social-agent learn ${platform.key}`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
console.log(` ✓ ${platform.name} hazır!\n`);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// 10. Özet
|
|
199
244
|
rl.close();
|
|
200
245
|
|
|
201
246
|
console.log(`
|
|
202
247
|
╔═══════════════════════════════════════╗
|
|
203
|
-
║
|
|
248
|
+
║ HER ŞEY HAZIR! ║
|
|
204
249
|
╚═══════════════════════════════════════╝
|
|
205
250
|
|
|
206
|
-
Merhaba ${name}! Social Agent
|
|
251
|
+
Merhaba ${name}! Social Agent kuruldu.
|
|
252
|
+
|
|
253
|
+
Nasıl kullanılır:
|
|
254
|
+
─────────────────
|
|
255
|
+
|
|
256
|
+
Post at:
|
|
257
|
+
social-agent run x "şu mesajı tweetle: Yeni proje yayında!"
|
|
258
|
+
social-agent run linkedin "şu mesajı paylaş: Yeni proje!"
|
|
259
|
+
social-agent post "Mesaj" --platforms mastodon
|
|
207
260
|
|
|
208
|
-
|
|
261
|
+
Beğen / Takip et / Bağlantı isteği:
|
|
262
|
+
social-agent run x "şu tweeti beğen: https://x.com/user/status/123"
|
|
263
|
+
social-agent run x "şu kişiyi takip et: @username"
|
|
264
|
+
social-agent run linkedin "3 insana bağlantı isteği gönder"
|
|
209
265
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
npx tsx cli.ts login linkedin
|
|
266
|
+
Yeni aksiyon öğret:
|
|
267
|
+
social-agent learn "retweet yapmayı öğren" x
|
|
268
|
+
social-agent learn "yorum yapmayı öğren" linkedin
|
|
214
269
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
270
|
+
Geçmiş ve durum:
|
|
271
|
+
social-agent history
|
|
272
|
+
social-agent status
|
|
218
273
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
npx tsx cli.ts run x "şu tweeti beğen: URL"
|
|
274
|
+
Claude Code ile:
|
|
275
|
+
claude-social → çalışırken AI milestone'larda post önerir
|
|
276
|
+
/social → elle post oluştur (git + konuşma analizi)
|
|
223
277
|
|
|
224
278
|
Profil ayarlarını düzenle:
|
|
225
|
-
|
|
279
|
+
nano ~/.social-agent/social-mode-prompt.md
|
|
226
280
|
`);
|
|
227
281
|
}
|
|
228
282
|
|