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
22 changes: 11 additions & 11 deletions crates/jcode-provider-metadata/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub const OPENCODE_PROFILE: OpenAiCompatibleProfile = OpenAiCompatibleProfile {
api_base: "https://opencode.ai/zen/v1",
api_key_env: "OPENCODE_API_KEY",
env_file: "opencode.env",
setup_url: "https://opencode.ai/docs/providers#opencode-zen",
setup_url: "https://github.com/quangdang46/jcode#oauth-and-providers",
default_model: Some("minimax-m2.7"),
requires_api_key: true,
};
Expand All @@ -20,7 +20,7 @@ pub const OPENCODE_GO_PROFILE: OpenAiCompatibleProfile = OpenAiCompatibleProfile
api_base: "https://opencode.ai/zen/go/v1",
api_key_env: "OPENCODE_GO_API_KEY",
env_file: "opencode-go.env",
setup_url: "https://opencode.ai/docs/providers#opencode-go",
setup_url: "https://github.com/quangdang46/jcode#oauth-and-providers",
default_model: Some("kimi-k2.5"),
requires_api_key: true,
};
Expand Down Expand Up @@ -53,7 +53,7 @@ pub const AI302_PROFILE: OpenAiCompatibleProfile = OpenAiCompatibleProfile {
api_base: "https://api.302.ai/v1",
api_key_env: "302AI_API_KEY",
env_file: "302ai.env",
setup_url: "https://opencode.ai/docs/providers#302ai",
setup_url: "https://github.com/quangdang46/jcode#oauth-and-providers",
default_model: Some("qwen3-235b-a22b-instruct-2507"),
requires_api_key: true,
};
Expand All @@ -64,7 +64,7 @@ pub const BASETEN_PROFILE: OpenAiCompatibleProfile = OpenAiCompatibleProfile {
api_base: "https://inference.baseten.co/v1",
api_key_env: "BASETEN_API_KEY",
env_file: "baseten.env",
setup_url: "https://opencode.ai/docs/providers#baseten",
setup_url: "https://github.com/quangdang46/jcode#oauth-and-providers",
default_model: Some("zai-org/GLM-4.7"),
requires_api_key: true,
};
Expand All @@ -75,7 +75,7 @@ pub const CORTECS_PROFILE: OpenAiCompatibleProfile = OpenAiCompatibleProfile {
api_base: "https://api.cortecs.ai/v1",
api_key_env: "CORTECS_API_KEY",
env_file: "cortecs.env",
setup_url: "https://opencode.ai/docs/providers#cortecs",
setup_url: "https://github.com/quangdang46/jcode#oauth-and-providers",
default_model: Some("kimi-k2.5"),
requires_api_key: true,
};
Expand Down Expand Up @@ -119,7 +119,7 @@ pub const FIRMWARE_PROFILE: OpenAiCompatibleProfile = OpenAiCompatibleProfile {
api_base: "https://app.frogbot.ai/api/v1",
api_key_env: "FIRMWARE_API_KEY",
env_file: "firmware.env",
setup_url: "https://opencode.ai/docs/providers#firmware",
setup_url: "https://github.com/quangdang46/jcode#oauth-and-providers",
default_model: Some("kimi-k2.5"),
requires_api_key: true,
};
Expand All @@ -130,7 +130,7 @@ pub const HUGGING_FACE_PROFILE: OpenAiCompatibleProfile = OpenAiCompatibleProfil
api_base: "https://router.huggingface.co/v1",
api_key_env: "HF_TOKEN",
env_file: "huggingface.env",
setup_url: "https://opencode.ai/docs/providers#hugging-face",
setup_url: "https://github.com/quangdang46/jcode#oauth-and-providers",
default_model: Some("zai-org/GLM-4.7"),
requires_api_key: true,
};
Expand All @@ -141,7 +141,7 @@ pub const MOONSHOT_PROFILE: OpenAiCompatibleProfile = OpenAiCompatibleProfile {
api_base: "https://api.moonshot.ai/v1",
api_key_env: "MOONSHOT_API_KEY",
env_file: "moonshotai.env",
setup_url: "https://opencode.ai/docs/providers#moonshot-ai",
setup_url: "https://github.com/quangdang46/jcode#oauth-and-providers",
default_model: Some("kimi-k2.5"),
requires_api_key: true,
};
Expand All @@ -152,7 +152,7 @@ pub const NEBIUS_PROFILE: OpenAiCompatibleProfile = OpenAiCompatibleProfile {
api_base: "https://api.tokenfactory.nebius.com/v1",
api_key_env: "NEBIUS_API_KEY",
env_file: "nebius.env",
setup_url: "https://opencode.ai/docs/providers#nebius-token-factory",
setup_url: "https://github.com/quangdang46/jcode#oauth-and-providers",
default_model: Some("openai/gpt-oss-120b"),
requires_api_key: true,
};
Expand All @@ -163,7 +163,7 @@ pub const SCALEWAY_PROFILE: OpenAiCompatibleProfile = OpenAiCompatibleProfile {
api_base: "https://api.scaleway.ai/v1",
api_key_env: "SCALEWAY_API_KEY",
env_file: "scaleway.env",
setup_url: "https://opencode.ai/docs/providers#scaleway",
setup_url: "https://github.com/quangdang46/jcode#oauth-and-providers",
default_model: Some("qwen3-coder-30b-a3b-instruct"),
requires_api_key: true,
};
Expand All @@ -174,7 +174,7 @@ pub const STACKIT_PROFILE: OpenAiCompatibleProfile = OpenAiCompatibleProfile {
api_base: "https://api.openai-compat.model-serving.eu01.onstackit.cloud/v1",
api_key_env: "STACKIT_API_KEY",
env_file: "stackit.env",
setup_url: "https://opencode.ai/docs/providers#stackit",
setup_url: "https://github.com/quangdang46/jcode#oauth-and-providers",
default_model: Some("openai/gpt-oss-120b"),
requires_api_key: true,
};
Expand Down
26 changes: 26 additions & 0 deletions src/provider_catalog_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,32 @@ fn auth_issue_profile_metadata_matches_direct_provider_endpoints() {
Some("qwen-3-235b-a22b-instruct-2507")
);
assert!(!OPENAI_COMPAT_PROFILE.setup_url.contains("opencode.ai"));
// Issue #80: aggregator providers previously pointed users at
// `opencode.ai/docs/providers#...` which 404s for jcode. Every preset
// should now point at the fork's README OAuth section instead, so
// `jcode login --provider <id>` flows surface a useful URL.
for profile in [
OPENCODE_PROFILE,
OPENCODE_GO_PROFILE,
ZAI_PROFILE,
DEEPSEEK_PROFILE,
MINIMAX_PROFILE,
] {
assert!(
!profile.setup_url.contains("opencode.ai/docs"),
"{} setup_url should not point to opencode.ai/docs (got {:?})",
profile.id,
profile.setup_url
);
}
assert_eq!(
OPENCODE_PROFILE.setup_url,
"https://github.com/quangdang46/jcode#oauth-and-providers"
);
assert_eq!(
OPENCODE_GO_PROFILE.setup_url,
"https://github.com/quangdang46/jcode#oauth-and-providers"
);
}

#[test]
Expand Down