social-agent-cli 1.6.0 → 1.7.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.
- package/bin/social-agent.js +19 -33
- package/install.ts +70 -6
- package/package.json +1 -1
package/bin/social-agent.js
CHANGED
|
@@ -80,7 +80,7 @@ switch (command) {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
case "login":
|
|
83
|
-
case "learn":
|
|
83
|
+
case "learn": // gizli - kullanıcıya gösterilmez, sistem kullanır
|
|
84
84
|
case "run":
|
|
85
85
|
case "post":
|
|
86
86
|
case "test":
|
|
@@ -101,46 +101,32 @@ switch (command) {
|
|
|
101
101
|
case "-h":
|
|
102
102
|
case "help":
|
|
103
103
|
console.log(`
|
|
104
|
-
social-agent
|
|
104
|
+
social-agent - AI-powered social media automation
|
|
105
105
|
|
|
106
106
|
Setup:
|
|
107
|
-
social-agent setup First-time setup
|
|
108
|
-
social-agent
|
|
109
|
-
social-agent config
|
|
107
|
+
social-agent setup First-time setup
|
|
108
|
+
social-agent login <platform> Chrome profile select (x, linkedin)
|
|
109
|
+
social-agent config Show config file paths
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
social-agent
|
|
113
|
-
social-agent
|
|
114
|
-
social-agent run
|
|
111
|
+
Post:
|
|
112
|
+
social-agent run x "post this: Hello world"
|
|
113
|
+
social-agent run x "post with image: msg, image: /path/to/img.jpg"
|
|
114
|
+
social-agent run linkedin "share this post: Hello"
|
|
115
|
+
social-agent post "text" --platforms mastodon
|
|
115
116
|
|
|
116
|
-
|
|
117
|
-
social-agent
|
|
117
|
+
Actions:
|
|
118
|
+
social-agent run x "like this: https://x.com/..."
|
|
119
|
+
social-agent run x "like and retweet: https://x.com/..."
|
|
118
120
|
|
|
119
121
|
Info:
|
|
120
|
-
social-agent status
|
|
121
|
-
social-agent history
|
|
122
|
-
social-agent help This help message
|
|
123
|
-
|
|
124
|
-
Examples:
|
|
125
|
-
social-agent login x
|
|
126
|
-
social-agent learn x → learn to post (default)
|
|
127
|
-
social-agent learn "learn to like tweets" x → learn liking
|
|
128
|
-
social-agent run x "like this tweet: https://..."
|
|
129
|
-
social-agent run x "like and retweet: https://..."
|
|
130
|
-
social-agent run linkedin "send 3 connection requests"
|
|
131
|
-
social-agent post "New feature!" --platforms mastodon
|
|
132
|
-
|
|
133
|
-
Data:
|
|
134
|
-
~/.social-agent/ All data lives here
|
|
135
|
-
~/.social-agent/social-mode-prompt.md AI personality (edit with: social-agent config)
|
|
136
|
-
~/.social-agent/config.json API keys (edit with: social-agent config api)
|
|
137
|
-
~/.social-agent/knowledge/ Platform knowledge files
|
|
138
|
-
~/.social-agent/maps/ Learned action maps
|
|
139
|
-
~/.social-agent/history.json Action log
|
|
122
|
+
social-agent status Connected platforms
|
|
123
|
+
social-agent history Action log
|
|
140
124
|
|
|
141
125
|
Claude Code:
|
|
142
|
-
claude-social Social-aware mode
|
|
143
|
-
/social Create post from
|
|
126
|
+
claude-social Social-aware mode
|
|
127
|
+
/social Create post from work context
|
|
128
|
+
/social-suggest on|off Toggle suggestions
|
|
129
|
+
/social-suggest level 1-5 Set suggestion sensitivity
|
|
144
130
|
`);
|
|
145
131
|
break;
|
|
146
132
|
|
package/install.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createInterface } from "node:readline";
|
|
2
|
-
import { writeFileSync, existsSync, mkdirSync, copyFileSync, readFileSync } from "node:fs";
|
|
2
|
+
import { writeFileSync, existsSync, mkdirSync, copyFileSync, readFileSync, readdirSync } from "node:fs";
|
|
3
3
|
import { join, dirname } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { execSync } from "node:child_process";
|
|
@@ -22,6 +22,38 @@ async function main() {
|
|
|
22
22
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
23
23
|
|
|
24
24
|
console.log(`\n Social Agent Setup\n ──────────────────\n`);
|
|
25
|
+
|
|
26
|
+
// Eski kurulumu temizle
|
|
27
|
+
if (existsSync(ROOT)) {
|
|
28
|
+
const { rmSync: rm } = await import("node:fs");
|
|
29
|
+
// maps, profiles, screenshots temizle (config ve knowledge koru)
|
|
30
|
+
for (const dir of ["maps", "profiles", "screenshots"]) {
|
|
31
|
+
const p = join(ROOT, dir);
|
|
32
|
+
if (existsSync(p)) { rm(p, { recursive: true, force: true }); }
|
|
33
|
+
}
|
|
34
|
+
// Eski format map dosyalarını temizle (x_post.json gibi)
|
|
35
|
+
try {
|
|
36
|
+
for (const f of readdirSync(ROOT)) {
|
|
37
|
+
if (f.endsWith(".json") && f.includes("_") && f !== "config.json" && f !== "profile-map.json" && f !== "history.json") {
|
|
38
|
+
rm(join(ROOT, f), { force: true });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
} catch {}
|
|
42
|
+
// social-mode-prompt.md sil (yenisi oluşturulacak)
|
|
43
|
+
const oldPrompt = join(ROOT, "social-mode-prompt.md");
|
|
44
|
+
if (existsSync(oldPrompt)) rm(oldPrompt, { force: true });
|
|
45
|
+
// .social-enabled/.social-disabled sil
|
|
46
|
+
for (const f of [".social-enabled", ".social-disabled"]) {
|
|
47
|
+
const p = join(ROOT, f);
|
|
48
|
+
if (existsSync(p)) rm(p, { force: true });
|
|
49
|
+
}
|
|
50
|
+
console.log(" ✓ Eski kalıntılar temizlendi\n");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Dizinleri oluştur
|
|
54
|
+
for (const dir of ["maps", "profiles", "screenshots", "knowledge"]) {
|
|
55
|
+
mkdirSync(join(ROOT, dir), { recursive: true });
|
|
56
|
+
}
|
|
25
57
|
const name = await ask(rl, "Adın");
|
|
26
58
|
const language = await ask(rl, "Post dili", "tr");
|
|
27
59
|
const style = await ask(rl, "Post stili (developer/casual/professional)", "developer");
|
|
@@ -119,10 +151,6 @@ Gönderme komutları (HER ZAMAN bu komutları kullan, asla cd veya npx tsx kulla
|
|
|
119
151
|
writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
120
152
|
console.log(` ✓ Config oluşturuldu: ${configPath}`);
|
|
121
153
|
|
|
122
|
-
// 4. Dizinleri oluştur
|
|
123
|
-
for (const dir of ["maps", "profiles", "screenshots", "knowledge"]) {
|
|
124
|
-
mkdirSync(join(ROOT, dir), { recursive: true });
|
|
125
|
-
}
|
|
126
154
|
|
|
127
155
|
// Sessiz kurulumlar
|
|
128
156
|
if (!existsSync(join(PKG_DIR, "node_modules"))) {
|
|
@@ -240,7 +268,43 @@ Kullanıcıya "Arka planda gönderiliyor" de ve diğer işlere devam et.
|
|
|
240
268
|
`;
|
|
241
269
|
|
|
242
270
|
writeFileSync(socialCommandDest, socialCommandContent);
|
|
243
|
-
|
|
271
|
+
|
|
272
|
+
// /social-suggest komutu
|
|
273
|
+
const suggestCommandDest = join(commandsDir, "social-suggest.md");
|
|
274
|
+
const suggestContent = `Sosyal medya öneri ayarlarını değiştir.
|
|
275
|
+
|
|
276
|
+
Argümanı parse et: $ARGUMENTS
|
|
277
|
+
|
|
278
|
+
### "on" ise:
|
|
279
|
+
\`\`\`bash
|
|
280
|
+
rm -f ~/.social-agent/.social-disabled
|
|
281
|
+
\`\`\`
|
|
282
|
+
"Sosyal medya önerileri açıldı." de.
|
|
283
|
+
|
|
284
|
+
### "off" ise:
|
|
285
|
+
\`\`\`bash
|
|
286
|
+
touch ~/.social-agent/.social-disabled
|
|
287
|
+
\`\`\`
|
|
288
|
+
"Sosyal medya önerileri kapatıldı. /social-suggest on ile açabilirsin." de.
|
|
289
|
+
|
|
290
|
+
### "level N" ise (N = 1-5):
|
|
291
|
+
~/.social-agent/social-mode-prompt.md dosyasındaki "Öneri hassasiyeti: X/5" satırını "Öneri hassasiyeti: N/5" olarak değiştir.
|
|
292
|
+
Altındaki kural satırını da güncelle:
|
|
293
|
+
- 1: "Çok seçici ol. Oturumda en fazla 1 kez öner. Sadece release veya büyük özellik."
|
|
294
|
+
- 2: "Seçici ol. Oturumda en fazla 1 kez öner. Büyük özellikler ve önemli fix'ler."
|
|
295
|
+
- 3: "Dengeli ol. Oturumda en fazla 2 kez öner. Kayda değer çalışmalarda."
|
|
296
|
+
- 4: "Aktif ol. Oturumda en fazla 3 kez öner. Küçük özellikler dahil."
|
|
297
|
+
- 5: "Çok aktif ol. Oturumda en fazla 5 kez öner. Her kayda değer iş sonrası."
|
|
298
|
+
"Hassasiyet N/5 olarak ayarlandı." de.
|
|
299
|
+
|
|
300
|
+
### Argüman yoksa:
|
|
301
|
+
\`\`\`bash
|
|
302
|
+
test -f ~/.social-agent/.social-disabled && echo "KAPALI" || echo "AÇIK"
|
|
303
|
+
grep "Öneri hassasiyeti" ~/.social-agent/social-mode-prompt.md 2>/dev/null
|
|
304
|
+
\`\`\`
|
|
305
|
+
`;
|
|
306
|
+
writeFileSync(suggestCommandDest, suggestContent);
|
|
307
|
+
console.log(" ✓ /social ve /social-suggest komutları oluşturuldu");
|
|
244
308
|
|
|
245
309
|
// 9. Platform Login & Learn
|
|
246
310
|
console.log(`
|