Skip to content

fix: remove unreliable init command #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mycoder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export default {
pageFilter: 'none', // 'simple', 'none', or 'readability'

// Model settings
//provider: 'anthropic',
//model: 'claude-3-7-sonnet-20250219',
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
//provider: 'openai',
//model: 'gpt-4o',
provider: 'ollama',
model: 'medragondot/Sky-T1-32B-Preview:latest',
//provider: 'ollama',
//model: 'medragondot/Sky-T1-32B-Preview:latest',
maxTokens: 4096,
temperature: 0.7,

Expand Down
8 changes: 6 additions & 2 deletions packages/agent/src/core/toolAgent/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ import { getModel } from './config.js';

describe('createProvider', () => {
it('should return the correct model for anthropic', () => {
const model = createProvider('anthropic', 'claude-3-7-sonnet-20250219');
const model = createProvider('anthropic', 'claude-3-7-sonnet-20250219', {
apiKey: 'sk-proj-1234567890',
});
expect(model).toBeDefined();
expect(model.provider).toBe('anthropic.messages');
});

it('should return the correct model for openai', () => {
const model = createProvider('openai', 'gpt-4o-2024-05-13');
const model = createProvider('openai', 'gpt-4o-2024-05-13', {
apiKey: 'sk-proj-1234567890',
});
expect(model).toBeDefined();
expect(model.provider).toBe('openai.chat');
});
Expand Down
12 changes: 1 addition & 11 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,7 @@ Requirements for GitHub mode:

MyCoder is configured using a `mycoder.config.js` file in your project root, similar to ESLint and other modern JavaScript tools. This file exports a configuration object with your preferred settings.

To create a default configuration file, run:

```bash
# Create a default configuration file
mycoder init

# Force overwrite an existing configuration file
mycoder init --force
```

This will create a `mycoder.config.js` file in your current directory with default settings that you can customize.
You can create a `mycoder.config.js` file in your project root with your preferred settings.

Example configuration file:

Expand Down
67 changes: 0 additions & 67 deletions packages/cli/src/commands/init.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import yargs, { ArgumentsCamelCase, CommandModule } from 'yargs';
import { hideBin } from 'yargs/helpers';

import { command as defaultCommand } from './commands/$default.js';
import { command as initCommand } from './commands/init.js';
import { command as testProfileCommand } from './commands/test-profile.js';
import { command as testSentryCommand } from './commands/test-sentry.js';
import { command as toolsCommand } from './commands/tools.js';
Expand Down Expand Up @@ -59,7 +58,6 @@ const main = async () => {
testSentryCommand,
testProfileCommand,
toolsCommand,
initCommand,
] as CommandModule[])
.strict()
.showHelpOnFail(true)
Expand Down
51 changes: 0 additions & 51 deletions packages/cli/src/settings/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import * as fs from 'fs';
import * as path from 'path';

import { cosmiconfig } from 'cosmiconfig';
import { ArgumentsCamelCase } from 'yargs';

Expand Down Expand Up @@ -107,51 +104,3 @@ export async function loadConfig(
};
return mergedConfig;
}

/**
* Create a default configuration file if it doesn't exist
* @param filePath Path to create the configuration file
* @returns true if file was created, false if it already exists
*/
export function createDefaultConfigFile(filePath?: string): boolean {
// Default to current directory if no path provided
const configPath = filePath || path.join(process.cwd(), 'mycoder.config.js');

// Check if file already exists
if (fs.existsSync(configPath)) {
return false;
}

// Create default configuration file
const configContent = `// mycoder.config.js
export default {
// GitHub integration
githubMode: true,

// Browser settings
headless: true,
userSession: false,
pageFilter: 'none', // 'simple', 'none', or 'readability'

// Model settings
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
maxTokens: 4096,
temperature: 0.7,

// Custom settings
customPrompt: '',
profile: false,
tokenCache: true,

// Ollama configuration
ollamaBaseUrl: 'http://localhost:11434',

// API keys (better to use environment variables for these)
// ANTHROPIC_API_KEY: 'your-api-key',
};
`;

fs.writeFileSync(configPath, configContent);
return true;
}
Loading