You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
758 B

#!/usr/bin/env tsx
/**
* 直连 MotherShip axel API 获取真实报价(完全绕过页面 widget 交互)
*
* 用法:
* npm run quote -- --origin "3131 Western Ave, West Seattle, WA 98126" --dest "123 Main St, Los Angeles, CA 90001" --pallets 2 --weight 500
*/
import { fetchAxelQuote } from "@/lib/axel/client";
import { parseQuoteCliArgs } from "@/lib/axel/parse-cli-args";
async function main(): Promise<void> {
const input = parseQuoteCliArgs(process.argv.slice(2));
const result = await fetchAxelQuote(input);
console.log(JSON.stringify(result, null, 2));
}
main().catch((err: unknown) => {
const message = err instanceof Error ? err.message : String(err);
console.error(JSON.stringify({ error: message }));
process.exit(1);
});