Skip to content

Commit 77d4e45

Browse files
committed
feat: moon always shows rich data (eclipses, sunrise/sunset) (v0.2.20)
1 parent 0f19701 commit 77d4e45

2 files changed

Lines changed: 11 additions & 38 deletions

File tree

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "thoth-cli",
3-
"version": "0.2.19",
3+
"version": "0.2.20",
44
"description": "𓅝 Astrological calculations from the command line. Swiss Ephemeris precision. Built for humans and agents.",
55
"author": "AKLO <aklo@aklolabs.com>",
66
"license": "MIT",

packages/cli/src/bin.ts

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import chalk from 'chalk';
99
import ora from 'ora';
1010
import { writeFileSync } from 'fs';
1111
import {
12-
chart, transit, moon, ephemeris, version,
12+
chart, transit, ephemeris, version,
1313
solarReturn, lunarReturn, synastry, progressions, ephemerisRange,
1414
composite, solarArc, horary, score, moonExtended, transitScan, ephemerisMulti
1515
} from './lib/core.js';
1616
import {
17-
formatChart, formatTransits, formatMoon, formatEphemeris,
17+
formatChart, formatTransits, formatEphemeris,
1818
formatSolarReturn, formatLunarReturn, formatSynastry,
1919
formatProgressions, formatEphemerisRange,
2020
formatComposite, formatSolarArc, formatHorary,
@@ -81,7 +81,7 @@ EPHEMERIS & MOON
8181
REFERENCE
8282
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
8383
thoth key # full symbol reference`)
84-
.version('0.2.19');
84+
.version('0.2.20');
8585

8686
// Chart command
8787
program
@@ -624,50 +624,23 @@ program
624624
// Moon command
625625
program
626626
.command('moon')
627-
.description('Get current moon phase and position')
627+
.description('Get moon phase, eclipses, sunrise/sunset')
628628
.option('--date <date>', 'Date (YYYY-MM-DD, default: today)')
629629
.option('--lat <lat>', 'Latitude', parseFloat, 40.7128)
630630
.option('--lng <lng>', 'Longitude', parseFloat, -74.0060)
631-
.option('--tz <tz>', 'Timezone (for extended)', 'America/New_York')
632-
.option('--extended', 'Show extended data (eclipses, sunrise/sunset)')
631+
.option('--tz <tz>', 'Timezone', 'America/New_York')
633632
.option('--json', 'Output raw JSON')
634633
.action(async (options) => {
635634
let year, month, day;
636635
if (options.date) {
637636
[year, month, day] = options.date.split('-').map(Number);
638637
}
639638

640-
// Use extended moon if --extended flag
641-
if (options.extended) {
642-
const spinner = ora('Getting moon details...').start();
643-
644-
const result = await moonExtended({
645-
year, month, day,
646-
lat: options.lat, lng: options.lng, tz: options.tz,
647-
});
648-
649-
spinner.stop();
650-
651-
if (isError(result)) {
652-
console.error(chalk.red(`Error: ${result.error}`));
653-
process.exit(1);
654-
}
655-
656-
if (options.json) {
657-
console.log(JSON.stringify(result, null, 2));
658-
} else {
659-
console.log(formatMoonExtended(result));
660-
}
661-
return;
662-
}
663-
664-
// Standard moon
665-
const spinner = ora('Getting moon phase...').start();
639+
const spinner = ora('Getting moon data...').start();
666640

667-
const result = await moon({
641+
const result = await moonExtended({
668642
year, month, day,
669-
lat: options.lat,
670-
lng: options.lng,
643+
lat: options.lat, lng: options.lng, tz: options.tz,
671644
});
672645

673646
spinner.stop();
@@ -680,7 +653,7 @@ program
680653
if (options.json) {
681654
console.log(JSON.stringify(result, null, 2));
682655
} else {
683-
console.log(formatMoon(result));
656+
console.log(formatMoonExtended(result));
684657
}
685658
});
686659

@@ -1049,7 +1022,7 @@ program
10491022

10501023
// Banner
10511024
console.log(chalk.dim(''));
1052-
console.log(chalk.yellow(' 𓅝') + chalk.dim(' thoth-cli v0.2.19'));
1025+
console.log(chalk.yellow(' 𓅝') + chalk.dim(' thoth-cli v0.2.20'));
10531026
console.log(chalk.dim(''));
10541027

10551028
program.parse();

0 commit comments

Comments
 (0)