@@ -11,14 +11,16 @@ import { writeFileSync } from 'fs';
1111import {
1212 chart , transit , moon , ephemeris , version ,
1313 solarReturn , lunarReturn , synastry , progressions , ephemerisRange ,
14- composite , solarArc , horary , score , moonExtended , transitScan , ephemerisMulti
14+ composite , solarArc , horary , score , moonExtended , transitScan , ephemerisMulti ,
15+ tarotDraw , tarotCard , tarotDeck , tarotSpreads
1516} from './lib/core.js' ;
1617import {
1718 formatChart , formatTransits , formatMoon , formatEphemeris ,
1819 formatSolarReturn , formatLunarReturn , formatSynastry ,
1920 formatProgressions , formatEphemerisRange ,
2021 formatComposite , formatSolarArc , formatHorary ,
21- formatScore , formatMoonExtended , formatTransitScan , formatEphemerisMulti
22+ formatScore , formatMoonExtended , formatTransitScan , formatEphemerisMulti ,
23+ formatTarotDraw , formatTarotCard , formatTarotDeck , formatTarotSpreads
2224} from './lib/format.js' ;
2325import { isError } from './types.js' ;
2426
@@ -1040,9 +1042,111 @@ program
10401042 }
10411043 } ) ;
10421044
1045+ // ═══════════════════════════════════════════════════════════════
1046+ // TAROT COMMANDS
1047+ // ═══════════════════════════════════════════════════════════════
1048+
1049+ // Tarot draw command
1050+ program
1051+ . command ( 'tarot' )
1052+ . alias ( 'draw' )
1053+ . description ( 'Draw tarot cards (cryptographic randomness)' )
1054+ . option ( '-s, --spread <spread>' , 'Spread: single, 3-card, celtic, horseshoe, relationship, decision' , 'single' )
1055+ . option ( '-q, --question <question>' , 'Question for the reading' )
1056+ . option ( '-n, --count <count>' , 'Number of cards (for custom spread)' , parseInt )
1057+ . option ( '--no-reversals' , 'Disable reversed cards' )
1058+ . option ( '--json' , 'Output raw JSON' )
1059+ . action ( async ( options ) => {
1060+ const spinner = ora ( 'Shuffling the deck...' ) . start ( ) ;
1061+
1062+ const result = await tarotDraw ( {
1063+ spread : options . spread ,
1064+ question : options . question ,
1065+ count : options . count ,
1066+ reversals : options . reversals ,
1067+ } ) ;
1068+
1069+ spinner . stop ( ) ;
1070+
1071+ if ( isError ( result ) ) {
1072+ console . error ( chalk . red ( 'Error: ' + result . error ) ) ;
1073+ process . exit ( 1 ) ;
1074+ }
1075+
1076+ if ( options . json ) {
1077+ console . log ( JSON . stringify ( result , null , 2 ) ) ;
1078+ } else {
1079+ console . log ( formatTarotDraw ( result ) ) ;
1080+ }
1081+ } ) ;
1082+
1083+ // Tarot card lookup
1084+ program
1085+ . command ( 'tarot-card <card>' )
1086+ . alias ( 'card' )
1087+ . description ( 'Look up a tarot card by name or number' )
1088+ . option ( '--json' , 'Output raw JSON' )
1089+ . action ( async ( card , options ) => {
1090+ const result = await tarotCard ( card ) ;
1091+
1092+ if ( isError ( result ) ) {
1093+ console . error ( chalk . red ( 'Error: ' + result . error ) ) ;
1094+ process . exit ( 1 ) ;
1095+ }
1096+
1097+ if ( options . json ) {
1098+ console . log ( JSON . stringify ( result , null , 2 ) ) ;
1099+ } else {
1100+ console . log ( formatTarotCard ( result ) ) ;
1101+ }
1102+ } ) ;
1103+
1104+ // Tarot deck listing
1105+ program
1106+ . command ( 'tarot-deck' )
1107+ . alias ( 'deck' )
1108+ . description ( 'List tarot cards' )
1109+ . option ( '-f, --filter <filter>' , 'Filter: major, minor, wands, cups, swords, pentacles' )
1110+ . option ( '--json' , 'Output raw JSON' )
1111+ . action ( async ( options ) => {
1112+ const result = await tarotDeck ( options . filter ) ;
1113+
1114+ if ( isError ( result ) ) {
1115+ console . error ( chalk . red ( 'Error: ' + result . error ) ) ;
1116+ process . exit ( 1 ) ;
1117+ }
1118+
1119+ if ( options . json ) {
1120+ console . log ( JSON . stringify ( result , null , 2 ) ) ;
1121+ } else {
1122+ console . log ( formatTarotDeck ( result ) ) ;
1123+ }
1124+ } ) ;
1125+
1126+ // Tarot spreads listing
1127+ program
1128+ . command ( 'tarot-spreads' )
1129+ . alias ( 'spreads' )
1130+ . description ( 'List available tarot spreads' )
1131+ . option ( '--json' , 'Output raw JSON' )
1132+ . action ( async ( options ) => {
1133+ const result = await tarotSpreads ( ) ;
1134+
1135+ if ( isError ( result ) ) {
1136+ console . error ( chalk . red ( 'Error: ' + result . error ) ) ;
1137+ process . exit ( 1 ) ;
1138+ }
1139+
1140+ if ( options . json ) {
1141+ console . log ( JSON . stringify ( result , null , 2 ) ) ;
1142+ } else {
1143+ console . log ( formatTarotSpreads ( result ) ) ;
1144+ }
1145+ } ) ;
1146+
10431147// Banner
10441148console . log ( chalk . dim ( '' ) ) ;
1045- console . log ( chalk . yellow ( ' 𓅝' ) + chalk . dim ( ' thoth-cli v0.2.21 ' ) ) ;
1149+ console . log ( chalk . yellow ( ' 𓅝' ) + chalk . dim ( ' thoth-cli v0.2.22 ' ) ) ;
10461150console . log ( chalk . dim ( '' ) ) ;
10471151
10481152program . parse ( ) ;
0 commit comments