Skip to content

Commit ec6e824

Browse files
committed
Remove chalk dependency
1 parent 350fef5 commit ec6e824

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"@traceloop/instrumentation-anthropic": ">=0.11.1",
2020
"@traceloop/instrumentation-cohere": ">=0.11.1",
2121
"@traceloop/instrumentation-openai": ">=0.11.3",
22-
"chalk": "^5.4.1",
2322
"cli-progress": "^3.12.0",
2423
"commander": "^13.1.0",
2524
"form-data": "^4.0.0",
@@ -55,7 +54,7 @@
5554
"webpack": "^5.97.1"
5655
},
5756
"bin": {
58-
"humanloop": "dist/cli.js"
57+
"humanloop": "./dist/cli.js"
5958
},
6059
"browser": {
6160
"fs": false,

src/cli.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env node
22
import * as dotenv from "dotenv";
3-
import chalk from "chalk";
43
import { Command } from "commander";
54

65
import { HumanloopClient } from "./humanloop.client";
6+
import { Logger } from "./utils/logger";
77

88
const { 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

7069
program.parse(process.argv);

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2379,11 +2379,6 @@ chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0:
23792379
ansi-styles "^4.1.0"
23802380
supports-color "^7.1.0"
23812381

2382-
chalk@^5.4.1:
2383-
version "5.4.1"
2384-
resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.4.1.tgz#1b48bf0963ec158dce2aacf69c093ae2dd2092d8"
2385-
integrity sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==
2386-
23872382
char-regex@^1.0.2:
23882383
version "1.0.2"
23892384
resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz"

0 commit comments

Comments
 (0)