Skip to content

Commit

Permalink
Fix the cli error
Browse files Browse the repository at this point in the history
  • Loading branch information
Xm0onh committed Jan 17, 2025
1 parent ba3620d commit 3bbbf94
Show file tree
Hide file tree
Showing 3 changed files with 348 additions and 35 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "auto-agents-framework",
"version": "0.0.1",
"version": "0.1.0",
"description": "Auto Agents Framework",
"main": "dist/index.js",
"type": "module",
"scripts": {
"build": "tsc && yarn copy-characters",
"start": "yarn build && node dist/index.js",
"dev": "tsx watch src/index.ts",
"dev": "NODE_ENV=development tsx --no-cache --watch src/index.ts",
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
"format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"",
"example:twitter": "tsx examples/twitter.ts",
Expand All @@ -33,13 +33,15 @@
"agent-twitter-client": "0.0.18",
"dotenv": "^16.3.1",
"ethers": "^6.13.4",
"inquirer": "^10.2.0",
"winston": "^3.11.0",
"zod": "^3.22.4",
"zod-to-json-schema": "^3.24.1"
},
"devDependencies": {
"@eslint/js": "^9.18.0",
"@tsconfig/node20": "^20.1.4",
"@types/inquirer": "^9.0.7",
"@types/jest": "^29.5.12",
"@types/js-yaml": "^4.0.9",
"@types/node": "22.10.0",
Expand Down
65 changes: 59 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,61 @@
import { config } from './config/index.js';
import { createLogger } from './utils/logger.js';
import { runWorkflow } from './agents/workflows/kol/workflow.js';
import inquirer from 'inquirer';

const logger = createLogger('app');

// Add process ID and timestamp to track instances
const instanceId = `${process.pid}-${Date.now()}`;
logger.info(`Process instance started: ${instanceId}`);

interface UserAnswers {
name: string;
projectType: string;
features: string[];
}

const onboarding = async () => {
const answers: UserAnswers = await inquirer.prompt([
{
type: 'input',
name: 'name',
message: 'What is your project name?',
default: 'my-awesome-project'
},
{
type: 'list',
name: 'projectType',
message: 'What type of project do you want to create?',
choices: [
'Frontend (React)',
'Backend (Node.js)',
'Full Stack',
'Library'
]
},
{
type: 'checkbox',
name: 'features',
message: 'Select additional features:',
choices: [
'TypeScript Configuration',
'ESLint',
'Prettier',
'Jest Testing',
'GitHub Actions',
'Docker Setup'
]
}
]);

console.log('\nProject Configuration:');
console.log('=====================');
console.log(`Project Name: ${answers.name}`);
console.log(`Project Type: ${answers.projectType}`);
console.log('Selected Features:', answers.features.join(', '));
};

// Get character name from command line args
const characterId = process.argv[2];
if (!characterId) {
Expand All @@ -25,13 +77,14 @@ const startWorkflowPolling = async () => {

const main = async () => {
try {
await startWorkflowPolling();
setInterval(startWorkflowPolling, config.twitterConfig.RESPONSE_INTERVAL_MS);
await onboarding();
// await startWorkflowPolling();
// setInterval(startWorkflowPolling, config.twitterConfig.RESPONSE_INTERVAL_MS);

logger.info('Application started successfully', {
checkInterval: config.twitterConfig.RESPONSE_INTERVAL_MS / 1000 / 60,
username: config.twitterConfig.USERNAME,
});
// logger.info('Application started successfully', {
// checkInterval: config.twitterConfig.RESPONSE_INTERVAL_MS / 1000 / 60,
// username: config.twitterConfig.USERNAME,
// });
} catch (error) {
logger.error('Failed to start application:', error);
process.exit(1);
Expand Down
Loading

0 comments on commit 3bbbf94

Please sign in to comment.