klio 1.3.6 → 1.3.7

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/README.md CHANGED
@@ -14,6 +14,53 @@ npm i -g klio
14
14
  npx klio --el
15
15
  ```
16
16
 
17
+ ### Personenverwaltung
18
+
19
+ Das Tool unterstützt die Verwaltung mehrerer Personen für astrologische Analysen.
20
+
21
+ #### Person erstellen oder aktualisieren
22
+
23
+ ```bash
24
+ klio --person <id> "Ort, Land, DD.MM.JJJJ HH:MM"
25
+ ```
26
+
27
+ Beispiele:
28
+ ```bash
29
+ klio --person p1 "Berlin, Deutschland, 20.01.1990 12:00"
30
+ klio --person p2 "Hamburg, Deutschland, 15.05.1985 18:30"
31
+ klio --person p3 "52.52,13.41, 10.10.1995 14:30" # Direkte Koordinateneingabe
32
+ ```
33
+
34
+ #### Person löschen
35
+
36
+ ```bash
37
+ klio --delete-person <id>
38
+ ```
39
+
40
+ Beispiel:
41
+ ```bash
42
+ klio --delete-person p3
43
+ ```
44
+
45
+ #### Alle Personen auflisten
46
+
47
+ ```bash
48
+ klio --people
49
+ ```
50
+
51
+ #### Personendaten verwenden
52
+
53
+ ```bash
54
+ klio <befehl> --p<id>
55
+ ```
56
+
57
+ Beispiele:
58
+ ```bash
59
+ klio mond --p1
60
+ klio --kritisch --p2
61
+ klio --transite --p3
62
+ ```
63
+
17
64
  ### Konfiguration
18
65
 
19
66
  Das Tool verwendet eine Konfigurationsdatei `astrocli-config.json` um Standort, Geburtsdaten und KI-Modell-Einstellungen zu konfigurieren.
@@ -84,6 +131,11 @@ klio --s --hs koch --i
84
131
  klio --s --hs koch --i
85
132
  ```
86
133
 
134
+ #### Mit Personendaten
135
+ ```bash
136
+ klio --s --hs koch --p1
137
+ ```
138
+
87
139
  #### Für ein Datum oder Datum und Zeit
88
140
  ```bash
89
141
  klio sonne --hs koch --d "01.02.2026 12:00"
@@ -106,6 +158,11 @@ Sonne befindet sich in Haus 9
106
158
  ```bash
107
159
  klio mond --a
108
160
  ```
161
+
162
+ #### Aspekte von einem Planeten (mit Personendaten)
163
+ ```bash
164
+ klio mond --a --p1
165
+ ```
109
166
  ```bash
110
167
  Aspekte für Mond:
111
168
  ================================================================================
@@ -156,6 +213,11 @@ K für Konjunktion, O für Opposition, Q für Quadrat, T für Trigon, S für Sex
156
213
  ```bash
157
214
  klio --v 3 saturn k neptun
158
215
  ```
216
+
217
+ #### Aspekte in der Vergangenheit (mit Personendaten)
218
+ ```bash
219
+ klio --v 3 saturn k neptun --p1
220
+ ```
159
221
  ```bash
160
222
  Letzte 3 Konjunktionen zwischen saturn und neptun:
161
223
  ================================================================================
@@ -169,15 +231,33 @@ Letzte 3 Konjunktionen zwischen saturn und neptun:
169
231
 
170
232
  ### Aspekte in der Zukunft
171
233
  K für Konjunktion, O für Opposition, Q für Quadrat, T für Trigon, S für Sextil
234
+ | Datum | Planet 1 Position | Planet 2 Position |
235
+ ================================================================================
236
+ | 20.02.2026 | Widder 0.74° | Widder 0.75° |
237
+ ================================================================================
238
+ ```
239
+ =======
172
240
  ```bash
173
241
  klio --z 3 saturn k neptun
174
242
  ```
243
+
244
+ #### Aspekte in der Zukunft (mit Personendaten)
245
+ ```bash
246
+ klio --z 3 saturn k neptun --p1
247
+ ```
248
+
175
249
  ```bash
176
250
  Nächste 5 Konjunktionen zwischen saturn und neptun:
177
251
  ================================================================================
178
252
  | Datum | Planet 1 Position | Planet 2 Position |
179
253
  ================================================================================
180
254
  | 20.02.2026 | Widder 0.74° | Widder 0.75° |
255
+ ================================================================================
256
+ ```
257
+ ================================================================================
258
+ | Datum | Planet 1 Position | Planet 2 Position |
259
+ ================================================================================
260
+ | 20.02.2026 | Widder 0.74° | Widder 0.75° |
181
261
  | 07.06.2061 | Zwillinge 20.38° | Zwillinge 20.39° |
182
262
  | 27.08.2096 | Jungfrau 8.15° | Jungfrau 8.15° |
183
263
  | 07.02.2132 | Skorpion 26.95° | Skorpion 26.96° |
@@ -192,6 +272,11 @@ klio --af
192
272
  Kombiniere mit `--i`, `--d`, `--hs` oder `--p`
193
273
  ```bash
194
274
  klio --af --d "01.12.2025" --hs koch
275
+
276
+ #### Aspektfiguren (mit Personendaten)
277
+ ```bash
278
+ klio --af --p1
279
+ ```
195
280
  Verwende benutzerdefiniertes Datum: 1.12.2025 19:00
196
281
  Aktive Aspektfiguren:
197
282
  ═══════════════════════════════════════════════════════════════════════════
@@ -223,6 +308,15 @@ Diese Analyse basiert auf der aktuellen Planetenposition.
223
308
 
224
309
  ```
225
310
 
311
+ Feuer : || 2/10 (10.0%)
312
+ Erde : |||| 4/10 (20.0%)
313
+ Luft : |||||||||| 10/10 (50.0%)
314
+ Wasser : |||| 4/10 (20.0%)
315
+ ================================================================================
316
+ ```
317
+
318
+ Mit `--i` das persönliche Horoskop, mit `--d "01.02.2025 15:00"` ein Datum.
319
+ =======
226
320
  #### Elementverteilung
227
321
  ```bash
228
322
  klio --el
@@ -239,6 +333,31 @@ Wasser : |||| 4/10 (20.0%)
239
333
 
240
334
  Mit `--i` das persönliche Horoskop, mit `--d "01.02.2025 15:00"` ein Datum.
241
335
 
336
+ #### Elementverteilung (mit Personendaten)
337
+ ```bash
338
+ klio --el --p1
339
+ ```
340
+ ================================================================================
341
+ Feuer : || 2/10 (10.0%)
342
+ Erde : |||| 4/10 (20.0%)
343
+ Luft : |||||||||| 10/10 (50.0%)
344
+ Wasser : |||| 4/10 (20.0%)
345
+ ================================================================================
346
+ ```
347
+
348
+ Mit `--i` das persönliche Horoskop, mit `--d "01.02.2025 15:00"` ein Datum.
349
+
350
+ | Planet | Zeichen | Grad | Status | Geschwindigkeit |
351
+ =================================================================
352
+ | Jupiter | Krebs | 16.97 | rückläufig | 0.10 °/Tag |
353
+ | Uranus | Stier | 27.46 | stationär | 0.00 °/Tag |
354
+ ...
355
+ ```
356
+ #### Planeten in Rückläufigkeit im Geburtshoroskop
357
+ ```bash
358
+ klio --rx --i
359
+ ```
360
+ =======
242
361
  #### Rückläufigkeit: Aktuelle rückläufigkeit der Planeten abrufen
243
362
  ```bash
244
363
  klio --rx
@@ -252,11 +371,40 @@ Rückläufige und stationäre Planeten:
252
371
  | Uranus | Stier | 27.46 | stationär | 0.00 °/Tag |
253
372
  ...
254
373
  ```
374
+
375
+ #### Rückläufigkeit (mit Personendaten)
376
+ ```bash
377
+ klio --rx --p1
378
+ ```
379
+
380
+ #### Planeten in Rückläufigkeit im Geburtshoroskop
381
+ ```bash
382
+ klio --rx --i
383
+ ```
384
+ =================================================================
385
+ | Planet | Zeichen | Grad | Status | Geschwindigkeit |
386
+ =================================================================
387
+ | Jupiter | Krebs | 16.97 | rückläufig | 0.10 °/Tag |
388
+ | Uranus | Stier | 27.46 | stationär | 0.00 °/Tag |
389
+ ...
390
+ ```
255
391
  #### Planeten in Rückläufigkeit im Geburtshoroskop
256
392
  ```bash
257
393
  klio --rx --i
258
394
  ```
259
395
 
396
+ | Planet | Zeichen | Grad | Typ |
397
+ ========================================================
398
+ | Merkur | Wassermann | 26.14 | Kardinal (0°, 13°, 26°) |
399
+ | Saturn | Fische | 29.02 | Anaretisch (29°) |
400
+ | Neptun | Widder | 0.25 | Kardinal (0°, 13°, 26°) |
401
+ ========================================================
402
+ ```
403
+ ### Oder mit `--i` für das Geburtshoroskop
404
+ ```bash
405
+ klio --kritisch --i
406
+ ```
407
+ =======
260
408
  #### Kritische Grade
261
409
  ```bash
262
410
  klio --kritisch
@@ -270,6 +418,24 @@ klio --kritisch
270
418
  | Neptun | Widder | 0.25 | Kardinal (0°, 13°, 26°) |
271
419
  ========================================================
272
420
  ```
421
+
422
+ #### Kritische Grade (mit Personendaten)
423
+ ```bash
424
+ klio --kritisch --p1
425
+ ```
426
+
427
+ ### Oder mit `--i` für das Geburtshoroskop
428
+ ```bash
429
+ klio --kritisch --i
430
+ ```
431
+ ========================================================
432
+ | Planet | Zeichen | Grad | Typ |
433
+ ========================================================
434
+ | Merkur | Wassermann | 26.14 | Kardinal (0°, 13°, 26°) |
435
+ | Saturn | Fische | 29.02 | Anaretisch (29°) |
436
+ | Neptun | Widder | 0.25 | Kardinal (0°, 13°, 26°) |
437
+ ========================================================
438
+ ```
273
439
  ### Oder mit `--i` für das Geburtshoroskop
274
440
  ```bash
275
441
  klio --kritisch --i
package/changelog.md CHANGED
@@ -0,0 +1,39 @@
1
+ # Changelog
2
+
3
+ ## 1.3.7 (2026-02-06)
4
+
5
+ ### Neue Funktionen
6
+
7
+ - **Personenverwaltung**: Beliebig viele Personen können jetzt erstellt, verwaltet und verwendet werden
8
+ - `--person <id> <data>`: Erstellt oder aktualisiert eine beliebige Person
9
+ - `--people`: Listet alle gespeicherten Personen auf
10
+ - `--delete-person <id>`: Löscht eine Person
11
+ - `--p1` bis `--p6`: Verwendet die Daten der entsprechenden Person für Berechnungen
12
+ - Unterstützung für Geocoding und direkte Koordinateneingabe
13
+ - Dynamische Personennamen (z.B. p1, p2, p3, etc.)
14
+
15
+ ### Verbesserungen
16
+
17
+ - Erweitert die Konfigurationsstruktur um `people.<id>` für beliebig viele Personen
18
+ - Anpassung aller relevanten Befehle zur Unterstützung der neuen Personendaten
19
+ - Konfigurationsstatus zeigt jetzt alle Personendaten dynamisch an
20
+ - Rückwärtskompatibilität mit bestehenden `--person1` und `--person2` Optionen
21
+
22
+ ### Beispiele
23
+
24
+ ```bash
25
+ # Person erstellen
26
+ klio --person p3 "Berlin, Deutschland, 10.10.1995 14:30"
27
+ klio --person p4 "51.5074, -0.1278, 25.06.1988 11:45"
28
+
29
+ # Person löschen
30
+ klio --delete-person p3
31
+
32
+ # Alle Personen auflisten
33
+ klio --people
34
+
35
+ # Personendaten verwenden
36
+ klio mond --p1
37
+ klio --kritisch --p2
38
+ klio --transite --p3
39
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "klio",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "Eine CLI für astrologische Berechnungen",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -113,6 +113,22 @@ function getBirthDataFromConfig() {
113
113
  return null;
114
114
  }
115
115
 
116
+ // Funktion zum Laden von Personendaten (inkl. Geburtsdaten)
117
+ function getPersonDataFromConfig(personId = 'birth') {
118
+ try {
119
+ const { getPersonData } = require('../config/configService');
120
+
121
+ if (personId === 'birth') {
122
+ return getBirthDataFromConfig();
123
+ } else {
124
+ return getPersonData(personId);
125
+ }
126
+ } catch (error) {
127
+ console.error(`Fehler beim Laden der Daten für ${personId}:`, error.message);
128
+ return null;
129
+ }
130
+ }
131
+
116
132
  // Funktion zur Berechnung des Julian Days in UTC
117
133
  function calculateJulianDayUTC(dateComponents, timezoneOffsetMinutes = 0) {
118
134
  // Berechne den Julian Day in lokaler Zeit
@@ -177,14 +193,7 @@ function calculateHouses(julianDay, houseSystem = 'K', useBirthLocation = false)
177
193
  latitude = config.birthData.location.latitude;
178
194
  longitude = config.birthData.location.longitude;
179
195
  locationName = `${config.birthData.location.name}, ${config.birthData.location.country}`;
180
- } else if (useBirthLocation) {
181
- // Geburtsort ist konfiguriert, aber kein Standort - verwende Standardort
182
- latitude = defaultLatitude;
183
- longitude = defaultLongitude;
184
- locationName = 'Berlin, Deutschland';
185
- console.log(`Verwende Standard-Geburtsort: ${locationName} (${latitude}° Breitengrad, ${longitude}° Längengrad)`);
186
- console.log('⚠️ Kein Geburtsort in der Konfiguration gefunden.');
187
- } else {
196
+ } else {
188
197
  // Verwende aktuellen Standort für aktuelle Berechnungen
189
198
  latitude = config && config.currentLocation ? config.currentLocation.latitude : defaultLatitude;
190
199
  longitude = config && config.currentLocation ? config.currentLocation.longitude : defaultLongitude;
@@ -2465,6 +2474,7 @@ module.exports = {
2465
2474
  getAllActiveAspects,
2466
2475
  showAllActiveAspects,
2467
2476
  getBirthDataFromConfig,
2477
+ getPersonDataFromConfig,
2468
2478
  getCriticalPlanets,
2469
2479
  getCurrentTimeInTimezone,
2470
2480
  getTimezoneOffset,
package/src/cli/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  const { Command } = require('commander');
2
2
  const { planets, signs } = require('../astrology/astrologyConstants');
3
3
  const { showRetrogradePlanets } = require('../astrology/retrogradeService');
4
- const { getCurrentTimeInTimezone, showAspectFigures, analyzeElementDistribution, getTimezoneOffset, calculateJulianDayUTC, calculateHouses, getAstrologicalData, getPlanetHouse, showPlanetAspects, calculatePlanetAspects, getAllActiveAspects, showAllActiveAspects, getBirthDataFromConfig, detectAspectFigures, calculatePersonalTransits, showPersonalTransitAspects, showCombinedAnalysis, calculatePersonalTransitAspects, determineAspectPhase, findExactAspectTime, findLastExactAspectTime, getAspectAngle, getFutureAspects, getPastAspects, analyzeCSVWithDatetime, analyzeHouseDistributionSignificance, analyzeAspectDistributionSignificance, analyzeSignDistributionSignificance, calculateAspectStatistics, calculatePlanetComboAspects, showPlanetComboAspects } = require('../astrology/astrologyService');
5
- const { performSetup, showConfigStatus, loadConfig, setAIModel, askAIModel } = require('../config/configService');
4
+ const { getCurrentTimeInTimezone, showAspectFigures, analyzeElementDistribution, getTimezoneOffset, calculateJulianDayUTC, calculateHouses, getAstrologicalData, getPlanetHouse, showPlanetAspects, calculatePlanetAspects, getAllActiveAspects, showAllActiveAspects, getBirthDataFromConfig, getPersonDataFromConfig, detectAspectFigures, calculatePersonalTransits, showPersonalTransitAspects, showCombinedAnalysis, calculatePersonalTransitAspects, determineAspectPhase, findExactAspectTime, findLastExactAspectTime, getAspectAngle, getFutureAspects, getPastAspects, analyzeCSVWithDatetime, analyzeHouseDistributionSignificance, analyzeAspectDistributionSignificance, analyzeSignDistributionSignificance, calculateAspectStatistics, calculatePlanetComboAspects, showPlanetComboAspects, getCriticalPlanets } = require('../astrology/astrologyService');
5
+ const { performSetup, showConfigStatus, loadConfig, setAIModel, askAIModel, setPerson1, setPerson2, setPerson, getPersonData, listPeople, deletePerson } = require('../config/configService');
6
6
  const { parseAppleHealthXML } = require('../health/healthService');
7
7
  const { analyzeStepsByPlanetSign, analyzeStressByPlanetAspects, analyzePlanetAspectsForSleep } = require('../health/healthAnalysis');
8
8
  const { analyzeHouseDistribution, filterFilesByHouse } = require('../health/fileAnalysis');
@@ -13,7 +13,40 @@ const fs = require('fs');
13
13
 
14
14
  const program = new Command();
15
15
 
16
- // Hilfsfunktion zur Überprüfung, ob Geburtsdaten verwendet werden sollen
16
+ // Hilfsfunktion zur Überprüfung, ob Personendaten verwendet werden sollen (inkl. neuer Optionen)
17
+ const shouldUsePersonData = (options) => {
18
+ return options.ich || options.i || options.p1 || options.p2;
19
+ };
20
+
21
+ // Hilfsfunktion zur Bestimmung, welche Personendaten verwendet werden sollen
22
+ const getPersonDataToUse = (options) => {
23
+ // Dynamische Personennamen (z.B. --p3, --p4, etc.)
24
+ for (const [key, value] of Object.entries(options)) {
25
+ if (key.startsWith('p') && key.length > 1 && !isNaN(key.substring(1))) {
26
+ const personId = key.substring(1); // Extrahiere die Nummer
27
+ return { source: key, data: getPersonDataFromConfig(personId) };
28
+ }
29
+ }
30
+
31
+ if (options.p1) {
32
+ return { source: 'p1', data: getPersonDataFromConfig('p1') };
33
+ } else if (options.p2) {
34
+ return { source: 'p2', data: getPersonDataFromConfig('p2') };
35
+ } else if (options.p3) {
36
+ return { source: 'p3', data: getPersonDataFromConfig('p3') };
37
+ } else if (options.p4) {
38
+ return { source: 'p4', data: getPersonDataFromConfig('p4') };
39
+ } else if (options.p5) {
40
+ return { source: 'p5', data: getPersonDataFromConfig('p5') };
41
+ } else if (options.p6) {
42
+ return { source: 'p6', data: getPersonDataFromConfig('p6') };
43
+ } else if (options.ich || options.i) {
44
+ return { source: 'birth', data: getPersonDataFromConfig('birth') };
45
+ }
46
+ return { source: null, data: null };
47
+ };
48
+
49
+ // Hilfsfunktion zur Überprüfung, ob Geburtsdaten verwendet werden sollen (nur für Rückwärtskompatibilität)
17
50
  const shouldUseBirthData = (options) => {
18
51
  return options.ich || options.i;
19
52
  };
@@ -107,6 +140,17 @@ program
107
140
  .option('--status', 'Zeigt die gespeicherten Konfigurationsdaten an')
108
141
  .option('--ich', 'Verwendet die Geburtsdaten aus dem Setup für die Berechnungen')
109
142
  .option('--i', 'Verwendet die Geburtsdaten aus dem Setup für die Berechnungen (Kurzform)')
143
+ .option('--p1', 'Verwendet die Daten von Person 1 für die Berechnungen')
144
+ .option('--p2', 'Verwendet die Daten von Person 2 für die Berechnungen')
145
+ .option('--p3', 'Verwendet die Daten von Person 3 für die Berechnungen')
146
+ .option('--p4', 'Verwendet die Daten von Person 4 für die Berechnungen')
147
+ .option('--p5', 'Verwendet die Daten von Person 5 für die Berechnungen')
148
+ .option('--p6', 'Verwendet die Daten von Person 6 für die Berechnungen')
149
+ .option('--person1 <data>', 'Erstellt oder aktualisiert Person 1 (Format: "Ort, Land, DD.MM.JJJJ HH:MM")')
150
+ .option('--person2 <data>', 'Erstellt oder aktualisiert Person 2 (Format: "Ort, Land, DD.MM.JJJJ HH:MM")')
151
+ .option('--person <id> <data>', 'Erstellt oder aktualisiert eine beliebige Person (Format: "Ort, Land, DD.MM.JJJJ HH:MM")')
152
+ .option('--people', 'Listet alle gespeicherten Personen auf')
153
+ .option('--delete-person <id>', 'Löscht eine Person')
110
154
  .option('--t <days>', 'Zeitraumbeschränkung (z.B. 7d, 30d, 90d, 14d)')
111
155
  .option('--p <prompt>', 'Stellt eine Frage an das KI-Modell (z.B. "Welche Berufe passen zu dieser Position?")')
112
156
  .option('--el', 'Zeigt die Elementverteilung der Planeten in einem horizontalen Chart an')
@@ -125,18 +169,28 @@ program
125
169
 
126
170
  // Kritische Planeten anzeigen, falls --kritisch Option angegeben (ohne Planet erforderlich)
127
171
  if (actualOptions.kritisch) {
128
- // Geburtsdaten verwenden, falls --ich Option angegeben
172
+ // Personendaten verwenden, falls --p1, --p2 oder --ich Option angegeben
129
173
  let customDate = null;
130
- if (shouldUseBirthData(options)) {
131
- const birthData = getBirthDataFromConfig();
132
- if (birthData) {
133
- customDate = birthData;
134
- console.log(`Verwende Geburtsdaten: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
135
- if (birthData.location) {
136
- console.log(`Geburtsort: ${birthData.location.name}, ${birthData.location.country}`);
137
- }
174
+ let personSource = null;
175
+ const personDataToUse = getPersonDataToUse(options);
176
+
177
+ if (personDataToUse.data) {
178
+ customDate = personDataToUse.data;
179
+ personSource = personDataToUse.source;
180
+
181
+ if (personSource === 'p1') {
182
+ console.log(`Verwende Person 1 Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
183
+ } else if (personSource === 'p2') {
184
+ console.log(`Verwende Person 2 Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
185
+ } else if (personSource.startsWith('p')) {
186
+ const personId = personSource.substring(1);
187
+ console.log(`Verwende Person ${personId} Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
138
188
  } else {
139
- console.log(' Keine Geburtsdaten in der Konfiguration gefunden. Verwende aktuelle Daten.');
189
+ console.log(`Verwende Geburtsdaten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
190
+ }
191
+
192
+ if (customDate.location) {
193
+ console.log(`Ort: ${customDate.location.name}, ${customDate.location.country}`);
140
194
  }
141
195
  }
142
196
 
@@ -225,25 +279,34 @@ program
225
279
 
226
280
  // Elementverteilung anzeigen, falls --el Option angegeben (ohne Planet erforderlich)
227
281
  if (options.el) {
228
- // Geburtsdaten verwenden, falls --ich Option angegeben
282
+ // Personendaten verwenden, falls --p1, --p2 oder --ich Option angegeben
229
283
  let customDate = null;
230
284
  let useBirthData = false;
285
+ let personSource = null;
231
286
 
232
- if (shouldUseBirthData(options)) {
233
- const birthData = getBirthDataFromConfig();
234
- if (birthData) {
235
- customDate = birthData;
236
- useBirthData = true;
237
- console.log(`Verwende Geburtsdaten: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
238
- if (birthData.location) {
239
- console.log(`Geburtsort: ${birthData.location.name}, ${birthData.location.country}`);
240
- }
287
+ const personDataToUse = getPersonDataToUse(options);
288
+ if (personDataToUse.data) {
289
+ customDate = personDataToUse.data;
290
+ personSource = personDataToUse.source;
291
+ useBirthData = personSource === 'birth'; // Nur true für Geburtsdaten
292
+
293
+ if (personSource === 'p1') {
294
+ console.log(`Verwende Person 1 Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
295
+ } else if (personSource === 'p2') {
296
+ console.log(`Verwende Person 2 Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
297
+ } else if (personSource.startsWith('p')) {
298
+ const personId = personSource.substring(1);
299
+ console.log(`Verwende Person ${personId} Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
241
300
  } else {
242
- console.log('Keine Geburtsdaten in der Konfiguration gefunden. Verwende aktuelle Daten.');
301
+ console.log(`Verwende Geburtsdaten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
302
+ }
303
+
304
+ if (customDate.location) {
305
+ console.log(`Ort: ${customDate.location.name}, ${customDate.location.country}`);
243
306
  }
244
307
  }
245
- // Benutzerdefiniertes Datum verwenden, falls angegeben (überschreibt --ich Option)
246
- else if (options.d) {
308
+ // Benutzerdefiniertes Datum verwenden, falls angegeben (überschreibt --p1, --p2 und --ich Option)
309
+ if (options.d) {
247
310
  // Versuche, das Datum als DD.MM.YYYY oder DD.MM.YYYY HH:MM zu parsen
248
311
  const dateRegex = /^(\d{1,2})\.(\d{1,2})\.(\d{4})(?:\s+(\d{1,2}):(\d{2}))?$/;
249
312
  const match = options.d.match(dateRegex);
@@ -316,12 +379,14 @@ program
316
379
 
317
380
  // Persönliche Transite anzeigen, falls --transite Option angegeben (ohne Planet erforderlich)
318
381
  if (options.transite) {
319
- // Geburtsdaten sind für Transite erforderlich
320
- const birthData = getBirthDataFromConfig();
321
- if (!birthData) {
322
- console.error('Fehler: Persönliche Transite erfordern Geburtsdaten. Bitte führe --setup aus, um deine Geburtsdaten zu konfigurieren.');
382
+ // Personendaten sind für Transite erforderlich
383
+ const personDataToUse = getPersonDataToUse(options);
384
+ if (!personDataToUse.data) {
385
+ console.error('Fehler: Persönliche Transite erfordern Personendaten. Bitte führe --setup aus oder erstelle eine Person mit --person1/--person2.');
323
386
  process.exit(1);
324
387
  }
388
+
389
+ const birthData = personDataToUse.data;
325
390
 
326
391
  // Benutzerdefiniertes Datum verwenden, falls angegeben
327
392
  let transitDate = null;
@@ -368,10 +433,16 @@ program
368
433
  process.exit(1);
369
434
  }
370
435
 
371
- // Zeige Geburtsdaten an
372
- console.log(`Geburtsdaten: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
436
+ // Zeige Personendaten an
437
+ if (personDataToUse.source === 'p1') {
438
+ console.log(`Person 1 Daten: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
439
+ } else if (personDataToUse.source === 'p2') {
440
+ console.log(`Person 2 Daten: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
441
+ } else {
442
+ console.log(`Geburtsdaten: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
443
+ }
373
444
  if (birthData.location) {
374
- console.log(`Geburtsort: ${birthData.location.name}, ${birthData.location.country}`);
445
+ console.log(`Ort: ${birthData.location.name}, ${birthData.location.country}`);
375
446
  }
376
447
 
377
448
  // Zeige Transitdatum an
@@ -421,12 +492,14 @@ program
421
492
  // Dadurch wird sichergestellt, dass `--tr` ohne `--hs` ausschließlich persönliche Transit-Aspekte zeigt
422
493
  if ((options.transitAspekte || options.tr) && options.hs) {
423
494
 
424
- // Geburtsdaten sind erforderlich
425
- const birthData = getBirthDataFromConfig();
426
- if (!birthData) {
427
- console.error('Fehler: Kombinierte Analyse erfordert Geburtsdaten. Bitte führe --setup aus.');
495
+ // Personendaten sind erforderlich
496
+ const personDataToUse = getPersonDataToUse(options);
497
+ if (!personDataToUse.data) {
498
+ console.error('Fehler: Kombinierte Analyse erfordert Personendaten. Bitte führe --setup aus oder erstelle eine Person mit --person1/--person2.');
428
499
  process.exit(1);
429
500
  }
501
+
502
+ const birthData = personDataToUse.data;
430
503
 
431
504
  // Benutzerdefiniertes Datum verwenden, falls angegeben
432
505
  let transitDate = null;
@@ -544,12 +617,14 @@ program
544
617
 
545
618
  // Persönliche Transit-Aspekte anzeigen, falls --transit-aspekte oder --tr Option angegeben
546
619
  if (options.transitAspekte || options.tr) {
547
- // Geburtsdaten sind für Transit-Aspekte erforderlich
548
- const birthData = getBirthDataFromConfig();
549
- if (!birthData) {
550
- console.error('Fehler: Persönliche Transit-Aspekte erfordern Geburtsdaten. Bitte führe --setup aus, um deine Geburtsdaten zu konfigurieren.');
620
+ // Personendaten sind für Transit-Aspekte erforderlich
621
+ const personDataToUse = getPersonDataToUse(options);
622
+ if (!personDataToUse.data) {
623
+ console.error('Fehler: Persönliche Transit-Aspekte erfordern Personendaten. Bitte führe --setup aus oder erstelle eine Person mit --person1/--person2.');
551
624
  process.exit(1);
552
625
  }
626
+
627
+ const birthData = personDataToUse.data;
553
628
 
554
629
  // Benutzerdefiniertes Datum verwenden, falls angegeben
555
630
  let transitDate = null;
@@ -598,25 +673,34 @@ program
598
673
 
599
674
  // Aspektfiguren anzeigen, falls --af Option angegeben (ohne Planet erforderlich)
600
675
  if (options.af) {
601
- // Geburtsdaten verwenden, falls --ich Option angegeben
676
+ // Personendaten verwenden, falls --p1, --p2 oder --ich Option angegeben
602
677
  let customDate = null;
603
678
  let useBirthData = false;
679
+ let personSource = null;
604
680
 
605
- if (shouldUseBirthData(options)) {
606
- const birthData = getBirthDataFromConfig();
607
- if (birthData) {
608
- customDate = birthData;
609
- useBirthData = true;
610
- console.log(`Verwende Geburtsdaten: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
611
- if (birthData.location) {
612
- console.log(`Geburtsort: ${birthData.location.name}, ${birthData.location.country}`);
613
- }
681
+ const personDataToUse = getPersonDataToUse(options);
682
+ if (personDataToUse.data) {
683
+ customDate = personDataToUse.data;
684
+ personSource = personDataToUse.source;
685
+ useBirthData = personSource === 'birth'; // Nur true für Geburtsdaten
686
+
687
+ if (personSource === 'p1') {
688
+ console.log(`Verwende Person 1 Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
689
+ } else if (personSource === 'p2') {
690
+ console.log(`Verwende Person 2 Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
691
+ } else if (personSource.startsWith('p')) {
692
+ const personId = personSource.substring(1);
693
+ console.log(`Verwende Person ${personId} Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
614
694
  } else {
615
- console.log('Keine Geburtsdaten in der Konfiguration gefunden. Verwende aktuelle Daten.');
695
+ console.log(`Verwende Geburtsdaten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
696
+ }
697
+
698
+ if (customDate.location) {
699
+ console.log(`Ort: ${customDate.location.name}, ${customDate.location.country}`);
616
700
  }
617
701
  }
618
- // Benutzerdefiniertes Datum verwenden, falls angegeben (überschreibt --ich Option)
619
- else if (options.d) {
702
+ // Benutzerdefiniertes Datum verwenden, falls angegeben (überschreibt --p1, --p2 und --ich Option)
703
+ if (options.d) {
620
704
  // Versuche, das Datum als DD.MM.YYYY oder DD.MM.YYYY HH:MM zu parsen
621
705
  const dateRegex = /^(\d{1,2})\.(\d{1,2})\.(\d{4})(?:\s+(\d{1,2}):(\d{2}))?$/;
622
706
  const match = options.d.match(dateRegex);
@@ -714,6 +798,47 @@ program
714
798
  return;
715
799
  }
716
800
 
801
+ // Person 1 erstellen/aktualisieren, falls --person1 Option angegeben (ohne Planet erforderlich)
802
+ if (options.person1) {
803
+ await setPerson1(options.person1);
804
+ return;
805
+ }
806
+
807
+ // Person 2 erstellen/aktualisieren, falls --person2 Option angegeben (ohne Planet erforderlich)
808
+ if (options.person2) {
809
+ await setPerson2(options.person2);
810
+ return;
811
+ }
812
+
813
+ // Beliebige Person erstellen/aktualisieren, falls --person Option angegeben (ohne Planet erforderlich)
814
+ if (options.person) {
815
+ // Die Option --person erwartet zwei Argumente: <id> <data>
816
+ // Wir müssen die Argumente aus der Befehlszeile extrahieren
817
+ const args = process.argv.slice(2);
818
+ const personIndex = args.findIndex(arg => arg === '--person');
819
+ if (personIndex !== -1 && args.length > personIndex + 2) {
820
+ const personId = args[personIndex + 1];
821
+ const personData = args.slice(personIndex + 2).join(' ');
822
+ await setPerson(personId, personData);
823
+ } else {
824
+ console.error('Fehler: --person erfordert eine Person-ID und Daten.');
825
+ console.error('Format: --person <id> "Ort, Land, DD.MM.JJJJ HH:MM"');
826
+ }
827
+ return;
828
+ }
829
+
830
+ // Personen auflisten, falls --people Option angegeben (ohne Planet erforderlich)
831
+ if (options.people) {
832
+ listPeople();
833
+ return;
834
+ }
835
+
836
+ // Person löschen, falls --delete-person Option angegeben (ohne Planet erforderlich)
837
+ if (options.deletePerson) {
838
+ deletePerson(options.deletePerson);
839
+ return;
840
+ }
841
+
717
842
  // System-Prompt setzen, falls --system Option angegeben (ohne Planet erforderlich)
718
843
  if (options.system) {
719
844
  const { setSystemPrompt } = require('../config/configService');
@@ -742,22 +867,34 @@ program
742
867
 
743
868
  // Tabellarische Übersicht aller Planetenpositionen anzeigen, falls --s Option angegeben
744
869
  if (options.s) {
745
- // Geburtsdaten für Hausberechnung verwenden, falls --ich Option angegeben
870
+ // Personendaten für Hausberechnung verwenden, falls --p1, --p2 oder --ich Option angegeben
746
871
  let customDate = null;
747
872
  let birthData = null;
748
873
  let houseSystem = options.hs ? options.hs.toLowerCase() : 'koch';
874
+ let personSource = null;
749
875
 
750
- // Prüfe, ob Geburtsdaten für Hausberechnung verwendet werden sollen
751
- if (shouldUseBirthData(options)) {
752
- birthData = getBirthDataFromConfig();
753
- if (birthData) {
754
- console.log(`Verwende Geburtsdaten für Hausberechnung: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
755
- if (birthData.location) {
756
- console.log(`Geburtsort: ${birthData.location.name}, ${birthData.location.country}`);
757
- }
876
+ // Prüfe, ob Personendaten für Hausberechnung verwendet werden sollen
877
+ const personDataToUse = getPersonDataToUse(options);
878
+ if (personDataToUse.data) {
879
+ birthData = personDataToUse.data;
880
+ personSource = personDataToUse.source;
881
+
882
+ if (personSource === 'p1') {
883
+ console.log(`Verwende Person 1 Daten für Hausberechnung: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
884
+ } else if (personSource === 'p2') {
885
+ console.log(`Verwende Person 2 Daten für Hausberechnung: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
886
+ } else if (personSource.startsWith('p')) {
887
+ const personId = personSource.substring(1);
888
+ console.log(`Verwende Person ${personId} Daten für Hausberechnung: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
758
889
  } else {
759
- console.log('Keine Geburtsdaten in der Konfiguration gefunden. Verwende aktuellen Standort für Hausberechnung.');
890
+ console.log(`Verwende Geburtsdaten für Hausberechnung: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
760
891
  }
892
+
893
+ if (birthData.location) {
894
+ console.log(`Ort: ${birthData.location.name}, ${birthData.location.country}`);
895
+ }
896
+ } else {
897
+ console.log('Keine Personendaten gefunden. Verwende aktuellen Standort für Hausberechnung.');
761
898
  }
762
899
 
763
900
  // Benutzerdefiniertes Datum verwenden, falls angegeben (für Planetenpositionen)
@@ -1075,25 +1212,34 @@ program
1075
1212
  const planet = planetArg ? planetArg.toLowerCase() : null;
1076
1213
 
1077
1214
  if (options.a) {
1078
- // Geburtsdaten verwenden, falls --ich oder --i Option angegeben
1215
+ // Personendaten verwenden, falls --p1, --p2 oder --ich Option angegeben
1079
1216
  let customDate = null;
1080
1217
  let useBirthData = false;
1218
+ let personSource = null;
1081
1219
 
1082
- if (shouldUseBirthData(options)) {
1083
- const birthData = getBirthDataFromConfig();
1084
- if (birthData) {
1085
- customDate = birthData;
1086
- useBirthData = true;
1087
- console.log(`Verwende Geburtsdaten: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
1088
- if (birthData.location) {
1089
- console.log(`Geburtsort: ${birthData.location.name}, ${birthData.location.country}`);
1090
- }
1220
+ const personDataToUse = getPersonDataToUse(options);
1221
+ if (personDataToUse.data) {
1222
+ customDate = personDataToUse.data;
1223
+ personSource = personDataToUse.source;
1224
+ useBirthData = personSource === 'birth'; // Nur true für Geburtsdaten
1225
+
1226
+ if (personSource === 'p1') {
1227
+ console.log(`Verwende Person 1 Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
1228
+ } else if (personSource === 'p2') {
1229
+ console.log(`Verwende Person 2 Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
1230
+ } else if (personSource.startsWith('p')) {
1231
+ const personId = personSource.substring(1);
1232
+ console.log(`Verwende Person ${personId} Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
1091
1233
  } else {
1092
- console.log('Keine Geburtsdaten in der Konfiguration gefunden. Verwende aktuelle Daten.');
1234
+ console.log(`Verwende Geburtsdaten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
1235
+ }
1236
+
1237
+ if (customDate.location) {
1238
+ console.log(`Ort: ${customDate.location.name}, ${customDate.location.country}`);
1093
1239
  }
1094
1240
  }
1095
- // Benutzerdefiniertes Datum verwenden, falls angegeben (überschreibt --ich Option)
1096
- else if (options.d) {
1241
+ // Benutzerdefiniertes Datum verwenden, falls angegeben (überschreibt --p1, --p2 und --ich Option)
1242
+ if (options.d) {
1097
1243
  // Versuche, das Datum als DD.MM.YYYY oder DD.MM.YYYY HH:MM zu parsen
1098
1244
  const dateRegex = /^(\d{1,2})\.(\d{1,2})\.(\d{4})(?:\s+(\d{1,2}):(\d{2}))?$/;
1099
1245
  const match = options.d.match(dateRegex);
@@ -1200,25 +1346,34 @@ program
1200
1346
  process.exit(1);
1201
1347
  }
1202
1348
 
1203
- // Geburtsdaten verwenden, falls --ich oder --i Option angegeben
1349
+ // Personendaten verwenden, falls --p1, --p2 oder --ich Option angegeben
1204
1350
  let customDate = null;
1205
1351
  let useBirthData = false;
1352
+ let personSource = null;
1206
1353
 
1207
- if (shouldUseBirthData(options)) {
1208
- const birthData = getBirthDataFromConfig();
1209
- if (birthData) {
1210
- customDate = birthData;
1211
- useBirthData = true;
1212
- console.log(`Verwende Geburtsdaten: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
1213
- if (birthData.location) {
1214
- console.log(`Geburtsort: ${birthData.location.name}, ${birthData.location.country}`);
1215
- }
1354
+ const personDataToUse = getPersonDataToUse(options);
1355
+ if (personDataToUse.data) {
1356
+ customDate = personDataToUse.data;
1357
+ personSource = personDataToUse.source;
1358
+ useBirthData = personSource === 'birth'; // Nur true für Geburtsdaten
1359
+
1360
+ if (personSource === 'p1') {
1361
+ console.log(`Verwende Person 1 Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
1362
+ } else if (personSource === 'p2') {
1363
+ console.log(`Verwende Person 2 Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
1364
+ } else if (personSource.startsWith('p')) {
1365
+ const personId = personSource.substring(1);
1366
+ console.log(`Verwende Person ${personId} Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
1216
1367
  } else {
1217
- console.log('Keine Geburtsdaten in der Konfiguration gefunden. Verwende aktuelle Daten.');
1368
+ console.log(`Verwende Geburtsdaten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
1369
+ }
1370
+
1371
+ if (customDate.location) {
1372
+ console.log(`Ort: ${customDate.location.name}, ${customDate.location.country}`);
1218
1373
  }
1219
1374
  }
1220
- // Benutzerdefiniertes Datum verwenden, falls angegeben (überschreibt --ich Option)
1221
- else if (options.d) {
1375
+ // Benutzerdefiniertes Datum verwenden, falls angegeben (überschreibt --p1, --p2 und --ich Option)
1376
+ if (options.d) {
1222
1377
  // Versuche, das Datum als DD.MM.YYYY oder DD.MM.YYYY HH:MM zu parsen
1223
1378
  const dateRegex = /^(\d{1,2})\.(\d{1,2})\.(\d{4})(?:\s+(\d{1,2}):(\d{2}))?$/;
1224
1379
  const match = options.d.match(dateRegex);
@@ -1358,22 +1513,29 @@ program
1358
1513
  return;
1359
1514
  }
1360
1515
 
1361
- // Geburtsdaten verwenden, falls --ich Option angegeben
1516
+ // Personendaten verwenden, falls --p1, --p2 oder --ich Option angegeben
1362
1517
  let customDate = null;
1363
- if (shouldUseBirthData(options)) {
1364
- const birthData = getBirthDataFromConfig();
1365
- if (birthData) {
1366
- customDate = birthData;
1367
- console.log(`Verwende Geburtsdaten: ${birthData.day}.${birthData.month}.${birthData.year} ${birthData.hour}:${birthData.minute.toString().padStart(2, '0')}`);
1368
- if (birthData.location) {
1369
- console.log(`Geburtsort: ${birthData.location.name}, ${birthData.location.country}`);
1370
- }
1518
+ const personDataToUse = getPersonDataToUse(options);
1519
+ if (personDataToUse.data) {
1520
+ customDate = personDataToUse.data;
1521
+
1522
+ if (personDataToUse.source === 'p1') {
1523
+ console.log(`Verwende Person 1 Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
1524
+ } else if (personDataToUse.source === 'p2') {
1525
+ console.log(`Verwende Person 2 Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
1526
+ } else if (personDataToUse.source.startsWith('p')) {
1527
+ const personId = personDataToUse.source.substring(1);
1528
+ console.log(`Verwende Person ${personId} Daten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
1371
1529
  } else {
1372
- console.log('Keine Geburtsdaten in der Konfiguration gefunden. Verwende aktuelle Daten.');
1530
+ console.log(`Verwende Geburtsdaten: ${customDate.day}.${customDate.month}.${customDate.year} ${customDate.hour}:${customDate.minute.toString().padStart(2, '0')}`);
1531
+ }
1532
+
1533
+ if (customDate.location) {
1534
+ console.log(`Ort: ${customDate.location.name}, ${customDate.location.country}`);
1373
1535
  }
1374
1536
  }
1375
- // Benutzerdefiniertes Datum verwenden, falls angegeben (überschreibt --ich Option)
1376
- else if (options.d) {
1537
+ // Benutzerdefiniertes Datum verwenden, falls angegeben (überschreibt --p1, --p2 und --ich Option)
1538
+ if (options.d) {
1377
1539
  // Versuche, das Datum als DD.MM.YYYY oder DD.MM.YYYY HH:MM zu parsen
1378
1540
  const dateRegex = /^(\d{1,2})\.(\d{1,2})\.(\d{4})(?:\s+(\d{1,2}):(\d{2}))?$/;
1379
1541
  const match = options.d.match(dateRegex);
@@ -1455,8 +1617,8 @@ program
1455
1617
 
1456
1618
  // Nur Häusertabelle anzeigen (ohne Planeteninfo)
1457
1619
  if (options.hl) {
1458
- const julianDay = getJulianDay(null, shouldUseBirthData(options));
1459
- const useBirthLocation = shouldUseBirthData(options); // Verwende Geburtsort, wenn --ich oder --i Option angegeben
1620
+ const julianDay = getJulianDay(null, shouldUsePersonData(options));
1621
+ const useBirthLocation = shouldUsePersonData(options); // Verwende Geburtsort, wenn --p1, --p2 oder --ich Option angegeben
1460
1622
 
1461
1623
  try {
1462
1624
  let houses;
@@ -1782,20 +1944,20 @@ program
1782
1944
 
1783
1945
  // Hausberechnung mit Planetenposition
1784
1946
  if (options.hs) {
1785
- // Geburtsdaten verwenden, falls --ich Option angegeben
1947
+ // Personendaten verwenden, falls --p1, --p2 oder --ich Option angegeben
1786
1948
  let customDate = null;
1787
1949
  let useBirthData = false;
1950
+ let personSource = null;
1788
1951
 
1789
- if (shouldUseBirthData(options)) {
1790
- const birthData = getBirthDataFromConfig();
1791
- if (birthData) {
1792
- customDate = birthData;
1793
- useBirthData = true;
1794
- }
1952
+ const personDataToUse = getPersonDataToUse(options);
1953
+ if (personDataToUse.data) {
1954
+ customDate = personDataToUse.data;
1955
+ personSource = personDataToUse.source;
1956
+ useBirthData = personSource === 'birth'; // Nur true für Geburtsdaten
1795
1957
  }
1796
1958
 
1797
1959
  const julianDay = getJulianDay(customDate, useBirthData);
1798
- const useBirthLocation = useBirthData; // Verwende Geburtsort, wenn --ich Option angegeben
1960
+ const useBirthLocation = useBirthData && personDataToUse.data && personDataToUse.data.location; // Verwende Standort der ausgewählten Person
1799
1961
 
1800
1962
  try {
1801
1963
  let houses;
@@ -1816,6 +1978,19 @@ program
1816
1978
  console.log('Haus-System: Koch');
1817
1979
  }
1818
1980
 
1981
+ // Zeige an, welche Personendaten verwendet werden
1982
+ if (personDataToUse && personDataToUse.source) {
1983
+ if (personDataToUse.source === 'p1') {
1984
+ console.log('Diese Analyse basiert auf Person 1 Daten.');
1985
+ } else if (personDataToUse.source === 'p2') {
1986
+ console.log('Diese Analyse basiert auf Person 2 Daten.');
1987
+ } else {
1988
+ console.log('Diese Analyse basiert auf deinen Geburtsdaten.');
1989
+ }
1990
+ } else {
1991
+ console.log('Diese Analyse basiert auf der aktuellen Planetenposition.');
1992
+ }
1993
+
1819
1994
  // Bestimme das Haus des Planeten
1820
1995
  const planetHouse = getPlanetHouse(parseFloat(data.degreeInSign) + (signs.indexOf(data.sign) * 30), houses.house);
1821
1996
  const planetNameCapitalized = data.planet.charAt(0).toUpperCase() + data.planet.slice(1);
@@ -95,6 +95,173 @@ function saveConfig(config) {
95
95
  }
96
96
  }
97
97
 
98
+ // Funktion zum Parsen von Personenangaben (z.B. "Berlin, Deutschland, 20.01.1990 12:00")
99
+ async function parsePersonData(personString) {
100
+ // Format: "Ort, Land, DD.MM.JJJJ HH:MM" oder "lat,long, DD.MM.JJJJ HH:MM"
101
+ const parts = personString.split(',').map(part => part.trim());
102
+
103
+ if (parts.length < 3) {
104
+ console.error('Ungültiges Format. Erwartet: "Ort, Land, DD.MM.JJJJ HH:MM" oder "lat,long, DD.MM.JJJJ HH:MM"');
105
+ return null;
106
+ }
107
+
108
+ // Prüfe, ob es sich um Koordinaten handelt (erster Teil enthält einen Punkt)
109
+ let locationData, dateTimeParts;
110
+ if (parts[0].includes('.') && parts[1].includes('.')) {
111
+ // Direkte Koordinateneingabe
112
+ const lat = parseFloat(parts[0]);
113
+ const long = parseFloat(parts[1]);
114
+ locationData = {
115
+ latitude: lat,
116
+ longitude: long,
117
+ name: `Benutzerdefinierter Standort (${lat}°, ${long}°)`,
118
+ country: 'Benutzerdefiniert',
119
+ timezone: 'UTC'
120
+ };
121
+ dateTimeParts = parts.slice(2);
122
+ } else {
123
+ // Standortsuche
124
+ const locationName = `${parts[0]}, ${parts[1]}`;
125
+ locationData = await geocodeLocation(locationName);
126
+
127
+ if (!locationData) {
128
+ console.error('Konnte den Standort nicht finden:', locationName);
129
+ return null;
130
+ }
131
+ dateTimeParts = parts.slice(2);
132
+ }
133
+
134
+ // Parse Datum und Zeit (Format: "DD.MM.JJJJ HH:MM")
135
+ const dateTimeStr = dateTimeParts.join(' ').trim();
136
+ const dateTimeRegex = /^(\d{1,2})\.(\d{1,2})\.(\d{4})\s+(\d{1,2}):(\d{2})$/;
137
+ const match = dateTimeStr.match(dateTimeRegex);
138
+
139
+ if (!match) {
140
+ console.error('Ungültiges Datum/Zeit-Format. Erwartet: DD.MM.JJJJ HH:MM');
141
+ return null;
142
+ }
143
+
144
+ return {
145
+ date: `${match[1]}.${match[2]}.${match[3]}`,
146
+ time: `${match[4]}:${match[5]}`,
147
+ location: locationData
148
+ };
149
+ }
150
+
151
+ // Funktion zum Erstellen/Setzen einer beliebigen Person
152
+ async function setPerson(personId, personString) {
153
+ const personData = await parsePersonData(personString);
154
+
155
+ if (!personData) {
156
+ console.error('Fehler beim Parsen der Personendaten.');
157
+ return false;
158
+ }
159
+
160
+ const config = loadConfig() || {
161
+ currentLocation: null,
162
+ birthData: null,
163
+ setupDate: new Date().toISOString()
164
+ };
165
+
166
+ // Erstelle people-Objekt, falls nicht vorhanden
167
+ if (!config.people) {
168
+ config.people = {};
169
+ }
170
+
171
+ // Setze die Person
172
+ config.people[personId] = personData;
173
+
174
+ console.log(`✓ Person "${personId}" erfolgreich erstellt/aktualisiert!`);
175
+ return saveConfig(config);
176
+ }
177
+
178
+ // Funktion zum Laden der Daten einer bestimmten Person
179
+ function getPersonData(personId) {
180
+ const config = loadConfig();
181
+
182
+ if (!config || !config.people || !config.people[personId]) {
183
+ return null;
184
+ }
185
+
186
+ // Parse die Daten in das gleiche Format wie birthData
187
+ const personData = config.people[personId];
188
+ const dateParts = personData.date.split('.');
189
+ const day = parseInt(dateParts[0]);
190
+ const month = parseInt(dateParts[1]);
191
+ const year = parseInt(dateParts[2]);
192
+
193
+ const timeParts = personData.time.split(':');
194
+ const hour = parseInt(timeParts[0]);
195
+ const minute = parseInt(timeParts[1]);
196
+
197
+ return {
198
+ year: year,
199
+ month: month,
200
+ day: day,
201
+ hour: hour,
202
+ minute: minute,
203
+ location: personData.location
204
+ };
205
+ }
206
+
207
+ // Funktion zum Auflisten aller Personen
208
+ function listPeople() {
209
+ const config = loadConfig();
210
+
211
+ if (!config || !config.people || Object.keys(config.people).length === 0) {
212
+ console.log('Keine Personen in der Konfiguration gefunden.');
213
+ return [];
214
+ }
215
+
216
+ console.log('Gespeicherte Personen:');
217
+ console.log('======================');
218
+
219
+ const peopleList = [];
220
+ for (const [personId, personData] of Object.entries(config.people)) {
221
+ console.log(`Person-ID: ${personId}`);
222
+ console.log(` Datum: ${personData.date}`);
223
+ console.log(` Zeit: ${personData.time}`);
224
+ if (personData.location) {
225
+ console.log(` Ort: ${personData.location.name}, ${personData.location.country}`);
226
+ }
227
+ console.log('');
228
+ peopleList.push(personId);
229
+ }
230
+
231
+ return peopleList;
232
+ }
233
+
234
+ // Funktion zum Löschen einer Person
235
+ function deletePerson(personId) {
236
+ const config = loadConfig();
237
+
238
+ if (!config || !config.people || !config.people[personId]) {
239
+ console.error(`Person "${personId}" nicht gefunden.`);
240
+ return false;
241
+ }
242
+
243
+ // Lösche die Person
244
+ delete config.people[personId];
245
+
246
+ // Falls keine Personen mehr vorhanden sind, lösche das people-Objekt
247
+ if (Object.keys(config.people).length === 0) {
248
+ delete config.people;
249
+ }
250
+
251
+ console.log(`✓ Person "${personId}" erfolgreich gelöscht!`);
252
+ return saveConfig(config);
253
+ }
254
+
255
+ // Funktion zum Erstellen/Setzen von Person 1 (für Rückwärtskompatibilität)
256
+ async function setPerson1(personString) {
257
+ return await setPerson('p1', personString);
258
+ }
259
+
260
+ // Funktion zum Erstellen/Setzen von Person 2 (für Rückwärtskompatibilität)
261
+ async function setPerson2(personString) {
262
+ return await setPerson('p2', personString);
263
+ }
264
+
98
265
  // Funktion zum Laden der Konfiguration
99
266
  function loadConfig() {
100
267
  try {
@@ -198,6 +365,23 @@ function showConfigStatus() {
198
365
  } else {
199
366
  console.log('Geburtsort: Nicht konfiguriert');
200
367
  }
368
+
369
+ // Zeige Personendaten, falls vorhanden
370
+ if (config.people && Object.keys(config.people).length > 0) {
371
+ console.log('\nPersonendaten:');
372
+ console.log('================');
373
+
374
+ // Zeige alle Personen dynamisch
375
+ for (const [personId, personData] of Object.entries(config.people)) {
376
+ console.log(`\nPerson ${personId}:`);
377
+ console.log(` Datum: ${personData.date}`);
378
+ console.log(` Zeit: ${personData.time}`);
379
+ if (personData.location) {
380
+ console.log(` Ort: ${personData.location.name}, ${personData.location.country}`);
381
+ console.log(` Koordinaten: ${personData.location.latitude.toFixed(4)}° Breitengrad, ${personData.location.longitude.toFixed(4)}° Längengrad`);
382
+ }
383
+ }
384
+ }
201
385
 
202
386
  console.log('\nSetup-Datum:');
203
387
  console.log(`${new Date(config.setupDate).toLocaleString()}`);
@@ -512,5 +696,11 @@ module.exports = {
512
696
  showConfigStatus,
513
697
  setAIModel,
514
698
  setSystemPrompt,
515
- askAIModel
699
+ askAIModel,
700
+ setPerson1,
701
+ setPerson2,
702
+ setPerson,
703
+ getPersonData,
704
+ listPeople,
705
+ deletePerson
516
706
  };