prosicht 1.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.
- package/index.js +89 -0
- package/package.json +19 -0
- package/tasks/todo.md +21 -0
package/index.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { program } = require('commander');
|
|
6
|
+
const prompts = require('prompts');
|
|
7
|
+
|
|
8
|
+
// GitHub Repository Raw URL (Kendi reponuzun URL'si ile eşleştiğinden emin olun)
|
|
9
|
+
const BASE_URL = 'https://raw.githubusercontent.com/ProSicht/ai-standards/main/templates';
|
|
10
|
+
|
|
11
|
+
const TEMPLATES = {
|
|
12
|
+
web: { name: 'Web Application (Next.js, Shadcn, Docker)', file: 'web.md' },
|
|
13
|
+
landing: { name: 'Landing Page (SEO & Speed Focused)', file: 'landing.md' },
|
|
14
|
+
mobile: { name: 'Mobile Application', file: 'mobile.md' },
|
|
15
|
+
backend: { name: 'Backend API Service', file: 'backend.md' }
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
async function fetchAndSaveTemplate(templateKey) {
|
|
19
|
+
const selected = TEMPLATES[templateKey];
|
|
20
|
+
if (!selected) {
|
|
21
|
+
console.error(`Hata: Gecersiz sablon "${templateKey}".`);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const fileUrl = `${BASE_URL}/${selected.file}`;
|
|
26
|
+
console.log(`\n[Pro Sicht] "${selected.name}" sablonu indiriliyor...`);
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
const response = await fetch(fileUrl);
|
|
30
|
+
if (!response.ok) {
|
|
31
|
+
throw new Error(`HTTP ${response.status}: Dosya bulunamadi (${fileUrl})`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const content = await response.text();
|
|
35
|
+
const targetPath = path.join(process.cwd(), 'AGENTS.md');
|
|
36
|
+
|
|
37
|
+
fs.writeFileSync(targetPath, content, 'utf8');
|
|
38
|
+
console.log(`Basarili: AGENTS.md dosyasi olusturuldu! (Sablon: ${templateKey})`);
|
|
39
|
+
console.log(`Konum: ${targetPath}\n`);
|
|
40
|
+
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.error('Indirme hatasi:', error.message);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
program
|
|
47
|
+
.name('prosicht')
|
|
48
|
+
.description('Pro Sicht AI Standards CLI')
|
|
49
|
+
.version('1.0.0');
|
|
50
|
+
|
|
51
|
+
program
|
|
52
|
+
.command('init')
|
|
53
|
+
.description('Projeye AI standartlari dosyasini (AGENTS.md) indirir')
|
|
54
|
+
.option('-t, --template <type>', 'Sablon turu (web, landing, mobile, backend)')
|
|
55
|
+
.action(async (options) => {
|
|
56
|
+
let templateKey = options.template;
|
|
57
|
+
|
|
58
|
+
if (!templateKey) {
|
|
59
|
+
const response = await prompts({
|
|
60
|
+
type: 'select',
|
|
61
|
+
name: 'template',
|
|
62
|
+
message: 'Lutfen bir Pro Sicht AI sablonu secin:',
|
|
63
|
+
choices: Object.entries(TEMPLATES).map(([key, value]) => ({
|
|
64
|
+
title: value.name,
|
|
65
|
+
value: key
|
|
66
|
+
}))
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
templateKey = response.template;
|
|
70
|
+
|
|
71
|
+
// Kullanıcı menüden çıkış yaparsa (Ctrl+C)
|
|
72
|
+
if (!templateKey) {
|
|
73
|
+
console.log('Islem iptal edildi.');
|
|
74
|
+
process.exit(0);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
await fetchAndSaveTemplate(templateKey);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
program
|
|
82
|
+
.command('update')
|
|
83
|
+
.description('Mevcut AGENTS.md dosyasini gunceller (Varsayilan: web)')
|
|
84
|
+
.option('-t, --template <type>', 'Sablon turu', 'web')
|
|
85
|
+
.action(async (options) => {
|
|
86
|
+
await fetchAndSaveTemplate(options.template);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
program.parse(process.argv);
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "prosicht",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Pro Sicht AI Standards CLI",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"prosicht": "./index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
|
+
},
|
|
12
|
+
"keywords": ["ai", "agents", "cli", "prosicht"],
|
|
13
|
+
"author": "Pro Sicht",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"commander": "^11.1.0",
|
|
17
|
+
"prompts": "^2.4.2"
|
|
18
|
+
}
|
|
19
|
+
}
|
package/tasks/todo.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Pro Sicht CLI Kurulumu
|
|
2
|
+
|
|
3
|
+
## Plan
|
|
4
|
+
|
|
5
|
+
- [x] Adım 1: `npm init -y` ile proje başlat
|
|
6
|
+
- [x] Adım 2: `commander` ve `prompts` kur
|
|
7
|
+
- [x] Adım 3: `package.json` (name, bin, metadata)
|
|
8
|
+
- [x] Adım 4: `index.js` CLI kodunu yaz
|
|
9
|
+
- [x] Adım 5: `npm link` ile lokal test
|
|
10
|
+
- [ ] Adım 6: NPM yayınlama (login + publish) — bu oturumda atlandı
|
|
11
|
+
|
|
12
|
+
## Review
|
|
13
|
+
|
|
14
|
+
CLI lokal olarak çalışıyor. `npm link` sonrası:
|
|
15
|
+
|
|
16
|
+
- `prosicht --help` komutları listeliyor (`init`, `update`)
|
|
17
|
+
- `prosicht init -t web` GitHub'dan şablonu çekip geçici dizine `AGENTS.md` yazdı (4446 byte, başlık: Pro Sicht Web Application AI Instructions)
|
|
18
|
+
|
|
19
|
+
Paket adı `prosicht`; `bin.prosicht` `./index.js`. npm yayını yapılmadı.
|
|
20
|
+
|
|
21
|
+
Not: GitHub `templates/` altında şu an yalnızca `web.md` var. `landing.md`, `mobile.md`, `backend.md` 404 dönüyor; CLI bunu hata mesajıyla bildiriyor. Diğer şablonlar repo'ya eklenince komutlar ek değişiklik olmadan çalışır.
|