Skip to content

Commit 08f55bc

Browse files
authored
Merge pull request #226 from drivecore/feature/remove-init-command
fix: remove unreliable init command
2 parents 68d34ab + 65e0235 commit 08f55bc

File tree

6 files changed

+11
-137
lines changed

6 files changed

+11
-137
lines changed

mycoder.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ export default {
99
pageFilter: 'none', // 'simple', 'none', or 'readability'
1010

1111
// Model settings
12-
//provider: 'anthropic',
13-
//model: 'claude-3-7-sonnet-20250219',
12+
provider: 'anthropic',
13+
model: 'claude-3-7-sonnet-20250219',
1414
//provider: 'openai',
1515
//model: 'gpt-4o',
16-
provider: 'ollama',
17-
model: 'medragondot/Sky-T1-32B-Preview:latest',
16+
//provider: 'ollama',
17+
//model: 'medragondot/Sky-T1-32B-Preview:latest',
1818
maxTokens: 4096,
1919
temperature: 0.7,
2020

packages/agent/src/core/toolAgent/config.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ import { getModel } from './config.js';
66

77
describe('createProvider', () => {
88
it('should return the correct model for anthropic', () => {
9-
const model = createProvider('anthropic', 'claude-3-7-sonnet-20250219');
9+
const model = createProvider('anthropic', 'claude-3-7-sonnet-20250219', {
10+
apiKey: 'sk-proj-1234567890',
11+
});
1012
expect(model).toBeDefined();
1113
expect(model.provider).toBe('anthropic.messages');
1214
});
1315

1416
it('should return the correct model for openai', () => {
15-
const model = createProvider('openai', 'gpt-4o-2024-05-13');
17+
const model = createProvider('openai', 'gpt-4o-2024-05-13', {
18+
apiKey: 'sk-proj-1234567890',
19+
});
1620
expect(model).toBeDefined();
1721
expect(model.provider).toBe('openai.chat');
1822
});

packages/cli/README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,7 @@ Requirements for GitHub mode:
9797

9898
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.
9999

100-
To create a default configuration file, run:
101-
102-
```bash
103-
# Create a default configuration file
104-
mycoder init
105-
106-
# Force overwrite an existing configuration file
107-
mycoder init --force
108-
```
109-
110-
This will create a `mycoder.config.js` file in your current directory with default settings that you can customize.
100+
You can create a `mycoder.config.js` file in your project root with your preferred settings.
111101

112102
Example configuration file:
113103

packages/cli/src/commands/init.ts

Lines changed: 0 additions & 67 deletions
This file was deleted.

packages/cli/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import yargs, { ArgumentsCamelCase, CommandModule } from 'yargs';
66
import { hideBin } from 'yargs/helpers';
77

88
import { command as defaultCommand } from './commands/$default.js';
9-
import { command as initCommand } from './commands/init.js';
109
import { command as testProfileCommand } from './commands/test-profile.js';
1110
import { command as testSentryCommand } from './commands/test-sentry.js';
1211
import { command as toolsCommand } from './commands/tools.js';
@@ -59,7 +58,6 @@ const main = async () => {
5958
testSentryCommand,
6059
testProfileCommand,
6160
toolsCommand,
62-
initCommand,
6361
] as CommandModule[])
6462
.strict()
6563
.showHelpOnFail(true)

packages/cli/src/settings/config.ts

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import * as fs from 'fs';
2-
import * as path from 'path';
3-
41
import { cosmiconfig } from 'cosmiconfig';
52
import { ArgumentsCamelCase } from 'yargs';
63

@@ -107,51 +104,3 @@ export async function loadConfig(
107104
};
108105
return mergedConfig;
109106
}
110-
111-
/**
112-
* Create a default configuration file if it doesn't exist
113-
* @param filePath Path to create the configuration file
114-
* @returns true if file was created, false if it already exists
115-
*/
116-
export function createDefaultConfigFile(filePath?: string): boolean {
117-
// Default to current directory if no path provided
118-
const configPath = filePath || path.join(process.cwd(), 'mycoder.config.js');
119-
120-
// Check if file already exists
121-
if (fs.existsSync(configPath)) {
122-
return false;
123-
}
124-
125-
// Create default configuration file
126-
const configContent = `// mycoder.config.js
127-
export default {
128-
// GitHub integration
129-
githubMode: true,
130-
131-
// Browser settings
132-
headless: true,
133-
userSession: false,
134-
pageFilter: 'none', // 'simple', 'none', or 'readability'
135-
136-
// Model settings
137-
provider: 'anthropic',
138-
model: 'claude-3-7-sonnet-20250219',
139-
maxTokens: 4096,
140-
temperature: 0.7,
141-
142-
// Custom settings
143-
customPrompt: '',
144-
profile: false,
145-
tokenCache: true,
146-
147-
// Ollama configuration
148-
ollamaBaseUrl: 'http://localhost:11434',
149-
150-
// API keys (better to use environment variables for these)
151-
// ANTHROPIC_API_KEY: 'your-api-key',
152-
};
153-
`;
154-
155-
fs.writeFileSync(configPath, configContent);
156-
return true;
157-
}

0 commit comments

Comments
 (0)