11#!/usr/bin/env node
22import * as dotenv from "dotenv" ;
3- import chalk from "chalk" ;
43import { Command } from "commander" ;
54
65import { HumanloopClient } from "./humanloop.client" ;
6+ import { Logger } from "./utils/logger" ;
77
88const { version } = require ( "../package.json" ) ;
99
@@ -33,10 +33,8 @@ function getClient(options: {
3333 if ( options . envFile ) dotenv . config ( { path : options . envFile } ) ;
3434 const apiKey = options . apiKey || process . env . HUMANLOOP_API_KEY ;
3535 if ( ! apiKey ) {
36- console . error (
37- chalk . red (
38- "No API key found. Set HUMANLOOP_API_KEY in .env file or use --api-key" ,
39- ) ,
36+ Logger . error (
37+ "No API key found. Set HUMANLOOP_API_KEY in .env file or use --api-key" ,
4038 ) ;
4139 process . exit ( 1 ) ;
4240 }
@@ -56,15 +54,16 @@ addAuthOptions(
5654 . option ( "-e, --environment <env>" , "Environment to pull from" )
5755 . option ( "--base-dir <baseDir>" , "Base directory for synced files" , "humanloop" ) ,
5856) . action ( async ( options ) => {
59- try {
60- console . log ( chalk . blue ( "Pulling files from Humanloop..." ) ) ;
61- const client = getClient ( options ) ;
62- const files = await client . pull ( options . path , options . environment ) ;
63- console . log ( chalk . green ( `Successfully synced ${ files . length } files` ) ) ;
64- } catch ( error ) {
65- console . error ( chalk . red ( `Error: ${ error } ` ) ) ;
66- process . exit ( 1 ) ;
67- }
57+ Logger . info ( "Pulling files from Humanloop..." ) ;
58+ // try {
59+ // Logger.info("Pulling files from Humanloop...");
60+ // const client = getClient(options);
61+ // const files = await client.pull(options.path, options.environment);
62+ // Logger.success(`Successfully synced ${files.length} files`);
63+ // } catch (error) {
64+ // Logger.error(`Error: ${error}`);
65+ // process.exit(1);
66+ // }
6867} ) ;
6968
7069program . parse ( process . argv ) ;
0 commit comments