mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
* move agent to langchains_agent * remove old .env * remove the old agent folder * add preliminary version of Agent abstraction * add preliminary version of the main.py * merge controlloop and main into a Agent class * add init * fix json import * fix missing arg * get langchains_agent working after abstraction * rename `research` to `agenthub` * rename: rename research to agenthub --------- Co-authored-by: huybery <huybery@gmail.com>
34 lines
943 B
JavaScript
34 lines
943 B
JavaScript
const process = require('process');
|
|
const commands = require('./commands');
|
|
|
|
function printHelp() {
|
|
const helpText = `
|
|
Usage: node cli.js <command> <string>
|
|
|
|
Commands:
|
|
reverse - Reverses the input string.
|
|
uppercase - Converts the input string to uppercase.
|
|
lowercase - Converts the input string to lowercase.
|
|
spongebob - Converts the input string to spongebob case.
|
|
length - Returns the length of the input string.
|
|
scramble - Randomly scrambles the characters in the input string.
|
|
`;
|
|
console.log(helpText);
|
|
}
|
|
|
|
if (process.argv.length === 3 && process.argv[2] === '--help') {
|
|
printHelp();
|
|
process.exit(0);
|
|
} else if (process.argv.length < 4) {
|
|
console.log('Usage: node cli.js <command> <string>');
|
|
process.exit(1);
|
|
}
|
|
|
|
const command = process.argv[2];
|
|
const inputString = process.argv[3];
|
|
|
|
if (command in commands) {
|
|
console.log(commands[command](inputString));
|
|
} else {
|
|
console.log('Invalid command!');
|
|
} |