Skip to content
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
run: cd packages/agent && pnpm exec playwright install --with-deps chromium

- name: Test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: pnpm test

- name: Lint
Expand Down
12 changes: 10 additions & 2 deletions packages/cli/src/commands/$default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,16 @@ export const command: CommandModule<SharedOptions, DefaultArgs> = {
tokenTracker.tokenCache =
argv.tokenCache !== undefined ? argv.tokenCache : userConfig.tokenCache;

const userModelProvider = argv.modelProvider || userConfig.modelProvider;
const userModelName = argv.modelName || userConfig.modelName;
const userModelProvider =
argv.provider ||
argv.modelProvider ||
userConfig.provider ||
userConfig.modelProvider;
const userModelName =
argv.model ||
argv.modelName ||
userConfig.model ||
userConfig.modelName;
const userMaxTokens = argv.maxTokens || userConfig.maxTokens;
const userTemperature = argv.temperature || userConfig.temperature;

Expand Down
8 changes: 5 additions & 3 deletions packages/cli/src/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,16 @@ export const command: CommandModule<SharedOptions, ConfigOptions> = {
return;
}

// Validate that the key exists in default config
// Check if the key exists in default config
const defaultConfig = getDefaultConfig();
if (!(argv.key in defaultConfig)) {
logger.error(`Invalid configuration key '${argv.key}'`);
logger.warn(
`Warning: '${argv.key}' is not a standard configuration key`,
);
logger.info(
`Valid configuration keys: ${Object.keys(defaultConfig).join(', ')}`,
);
return;
// Continue with the operation instead of returning
}

// Check if this is an API key and add a warning
Expand Down
19 changes: 17 additions & 2 deletions packages/cli/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export type SharedOptions = {
readonly userSession?: boolean;
readonly pageFilter?: 'simple' | 'none' | 'readability';
readonly sentryDsn?: string;
readonly provider?: string;
readonly model?: string;
// Legacy options - will be removed in a future version
readonly modelProvider?: string;
readonly modelName?: string;
readonly maxTokens?: number;
Expand All @@ -28,15 +31,27 @@ export const sharedOptions = {
description: 'Enable performance profiling of CLI startup',
default: false,
} as const,
modelProvider: {
provider: {
type: 'string',
description: 'AI model provider to use',
choices: ['anthropic', 'openai', 'ollama', 'xai', 'mistral'],
} as const,
modelName: {
model: {
type: 'string',
description: 'AI model name to use',
} as const,
// Legacy options - will be removed in a future version
modelProvider: {
type: 'string',
description: 'AI model provider to use (deprecated, use provider instead)',
choices: ['anthropic', 'openai', 'ollama', 'xai', 'mistral'],
hidden: true,
} as const,
modelName: {
type: 'string',
description: 'AI model name to use (deprecated, use model instead)',
hidden: true,
} as const,
maxTokens: {
type: 'number',
description: 'Maximum number of tokens to generate',
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/src/settings/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const defaultConfig = {
headless: true,
userSession: false,
pageFilter: 'none' as 'simple' | 'none' | 'readability',
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
// Legacy names - will be removed in a future version
modelProvider: 'anthropic',
modelName: 'claude-3-7-sonnet-20250219',
maxTokens: 4096,
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/tests/settings/config-defaults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ describe('Config Defaults for CLI Options', () => {
headless: true,
userSession: false,
pageFilter: 'none',
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
modelProvider: 'anthropic',
modelName: 'claude-3-7-sonnet-20250219',
ollamaBaseUrl: 'http://localhost:11434/api',
Expand Down Expand Up @@ -95,6 +97,8 @@ describe('Config Defaults for CLI Options', () => {
headless: true, // Default is true
userSession: false, // Default is false
pageFilter: 'none', // Default is none
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
modelProvider: 'anthropic',
modelName: 'claude-3-7-sonnet-20250219',
ollamaBaseUrl: 'http://localhost:11434/api',
Expand Down Expand Up @@ -132,6 +136,8 @@ describe('Config Defaults for CLI Options', () => {
headless: true,
userSession: false,
pageFilter: 'none',
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
modelProvider: 'anthropic',
modelName: 'claude-3-7-sonnet-20250219',
ollamaBaseUrl: 'http://localhost:11434/api',
Expand Down Expand Up @@ -181,6 +187,8 @@ describe('Config Defaults for CLI Options', () => {
headless: true, // Default is true
userSession: false, // Default is false
pageFilter: 'none', // Default is none
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
modelProvider: 'anthropic',
modelName: 'claude-3-7-sonnet-20250219',
ollamaBaseUrl: 'http://localhost:11434/api',
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/tests/settings/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ describe('Config', () => {
headless: true,
userSession: false,
pageFilter: 'none',
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
modelProvider: 'anthropic',
modelName: 'claude-3-7-sonnet-20250219',
maxTokens: 4096,
Expand Down Expand Up @@ -83,6 +85,8 @@ describe('Config', () => {
headless: true,
userSession: false,
pageFilter: 'none',
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
modelProvider: 'anthropic',
modelName: 'claude-3-7-sonnet-20250219',
maxTokens: 4096,
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/tests/settings/configDefaults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ describe('Config Defaults for CLI Options', () => {
headless: true,
userSession: false,
pageFilter: 'none',
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
modelProvider: 'anthropic',
modelName: 'claude-3-7-sonnet-20250219',
ollamaBaseUrl: 'http://localhost:11434/api',
Expand Down Expand Up @@ -95,6 +97,8 @@ describe('Config Defaults for CLI Options', () => {
headless: true, // Default is true
userSession: false, // Default is false
pageFilter: 'none', // Default is none
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
modelProvider: 'anthropic',
modelName: 'claude-3-7-sonnet-20250219',
ollamaBaseUrl: 'http://localhost:11434/api',
Expand Down Expand Up @@ -132,6 +136,8 @@ describe('Config Defaults for CLI Options', () => {
headless: true,
userSession: false,
pageFilter: 'none',
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
modelProvider: 'anthropic',
modelName: 'claude-3-7-sonnet-20250219',
ollamaBaseUrl: 'http://localhost:11434/api',
Expand Down Expand Up @@ -181,6 +187,8 @@ describe('Config Defaults for CLI Options', () => {
headless: true, // Default is true
userSession: false, // Default is false
pageFilter: 'none', // Default is none
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
modelProvider: 'anthropic',
modelName: 'claude-3-7-sonnet-20250219',
ollamaBaseUrl: 'http://localhost:11434/api',
Expand Down
Loading