@opperai/setup 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,161 @@
1
+ models:
2
+ - name: Claude Sonnet 4.5
3
+ provider: openai
4
+ model: anthropic/claude-sonnet-4.5
5
+ apiBase: https://api.opper.ai/v2/openai
6
+ apiKey: OPPER_API_KEY
7
+ roles:
8
+ - chat
9
+ - edit
10
+ - name: Claude Opus 4.5
11
+ provider: openai
12
+ model: anthropic/claude-opus-4.5
13
+ apiBase: https://api.opper.ai/v2/openai
14
+ apiKey: OPPER_API_KEY
15
+ roles:
16
+ - chat
17
+ - edit
18
+ - name: Claude Sonnet 4.5 (EU)
19
+ provider: openai
20
+ model: aws/claude-sonnet-4.5-eu
21
+ apiBase: https://api.opper.ai/v2/openai
22
+ apiKey: OPPER_API_KEY
23
+ roles:
24
+ - chat
25
+ - edit
26
+ - name: Claude Opus 4.5 (EU)
27
+ provider: openai
28
+ model: aws/claude-opus-4.5-eu
29
+ apiBase: https://api.opper.ai/v2/openai
30
+ apiKey: OPPER_API_KEY
31
+ roles:
32
+ - chat
33
+ - edit
34
+ - name: GPT 5.2
35
+ provider: openai
36
+ model: openai/gpt-5.2
37
+ apiBase: https://api.opper.ai/v2/openai
38
+ apiKey: OPPER_API_KEY
39
+ roles:
40
+ - chat
41
+ - edit
42
+ - name: GPT 5 Mini
43
+ provider: openai
44
+ model: openai/gpt-5-mini
45
+ apiBase: https://api.opper.ai/v2/openai
46
+ apiKey: OPPER_API_KEY
47
+ roles:
48
+ - chat
49
+ - edit
50
+ - name: GPT 5 Nano
51
+ provider: openai
52
+ model: openai/gpt-5-nano
53
+ apiBase: https://api.opper.ai/v2/openai
54
+ apiKey: OPPER_API_KEY
55
+ roles:
56
+ - chat
57
+ - edit
58
+ - name: GPT 5 Mini (EU)
59
+ provider: openai
60
+ model: azure/gpt-5-mini
61
+ apiBase: https://api.opper.ai/v2/openai
62
+ apiKey: OPPER_API_KEY
63
+ roles:
64
+ - chat
65
+ - edit
66
+ - name: GPT 5 Nano (EU)
67
+ provider: openai
68
+ model: azure/gpt-5-nano
69
+ apiBase: https://api.opper.ai/v2/openai
70
+ apiKey: OPPER_API_KEY
71
+ roles:
72
+ - chat
73
+ - edit
74
+ - name: Gemini 2.5 Pro
75
+ provider: openai
76
+ model: gcp/gemini-2.5-pro
77
+ apiBase: https://api.opper.ai/v2/openai
78
+ apiKey: OPPER_API_KEY
79
+ roles:
80
+ - chat
81
+ - edit
82
+ - name: Gemini 2.5 Pro (EU)
83
+ provider: openai
84
+ model: gcp/gemini-2.5-pro-eu
85
+ apiBase: https://api.opper.ai/v2/openai
86
+ apiKey: OPPER_API_KEY
87
+ roles:
88
+ - chat
89
+ - edit
90
+ - name: Gemini 2.5 Flash
91
+ provider: openai
92
+ model: gcp/gemini-2.5-flash
93
+ apiBase: https://api.opper.ai/v2/openai
94
+ apiKey: OPPER_API_KEY
95
+ roles:
96
+ - chat
97
+ - edit
98
+ - name: Gemini 2.5 Flash (EU)
99
+ provider: openai
100
+ model: gcp/gemini-2.5-flash-eu
101
+ apiBase: https://api.opper.ai/v2/openai
102
+ apiKey: OPPER_API_KEY
103
+ roles:
104
+ - chat
105
+ - edit
106
+ - name: Gemini 2.5 Flash Lite
107
+ provider: openai
108
+ model: gcp/gemini-2.5-flash-lite
109
+ apiBase: https://api.opper.ai/v2/openai
110
+ apiKey: OPPER_API_KEY
111
+ roles:
112
+ - chat
113
+ - edit
114
+ - name: Gemini 2.5 Flash Lite (EU)
115
+ provider: openai
116
+ model: gcp/gemini-2.5-flash-lite-eu
117
+ apiBase: https://api.opper.ai/v2/openai
118
+ apiKey: OPPER_API_KEY
119
+ roles:
120
+ - chat
121
+ - edit
122
+ - name: Gemini 3 Flash Preview
123
+ provider: openai
124
+ model: gcp/gemini-3-flash-preview
125
+ apiBase: https://api.opper.ai/v2/openai
126
+ apiKey: OPPER_API_KEY
127
+ roles:
128
+ - chat
129
+ - edit
130
+ - name: Kimi K2.5
131
+ provider: openai
132
+ model: fireworks/kimi-k2.5
133
+ apiBase: https://api.opper.ai/v2/openai
134
+ apiKey: OPPER_API_KEY
135
+ roles:
136
+ - chat
137
+ - edit
138
+ - name: GLM 4.7
139
+ provider: openai
140
+ model: fireworks/glm-4.7
141
+ apiBase: https://api.opper.ai/v2/openai
142
+ apiKey: OPPER_API_KEY
143
+ roles:
144
+ - chat
145
+ - edit
146
+ - name: GPT OSS 120B
147
+ provider: openai
148
+ model: groq/gpt-oss-120b
149
+ apiBase: https://api.opper.ai/v2/openai
150
+ apiKey: OPPER_API_KEY
151
+ roles:
152
+ - chat
153
+ - edit
154
+ - name: GPT OSS 120B (EU)
155
+ provider: openai
156
+ model: aws/gpt-oss-120b-eu
157
+ apiBase: https://api.opper.ai/v2/openai
158
+ apiKey: OPPER_API_KEY
159
+ roles:
160
+ - chat
161
+ - edit
@@ -5,7 +5,7 @@
5
5
  "npm": "@ai-sdk/openai-compatible",
6
6
  "name": "Opper",
7
7
  "options": {
8
- "baseURL": "http://localhost:8000/v2/openai",
8
+ "baseURL": "https://api.opper.ai/v2/openai",
9
9
  "apiKey": "{env:OPPER_API_KEY}"
10
10
  },
11
11
  "models": {
@@ -0,0 +1 @@
1
+ export declare function setupContinue(location: "global" | "local"): Promise<void>;
@@ -0,0 +1,65 @@
1
+ import { readFileSync, mkdirSync, writeFileSync, existsSync } from "node:fs";
2
+ import { join, dirname } from "node:path";
3
+ import { homedir } from "node:os";
4
+ import { fileURLToPath } from "node:url";
5
+ import { confirm } from "@inquirer/prompts";
6
+ import { parse, stringify } from "yaml";
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const OPPER_API_BASE = "https://api.opper.ai/v2/openai";
9
+ export async function setupContinue(location) {
10
+ console.log("\n--- Continue.dev Setup ---\n");
11
+ // Read embedded template
12
+ const templatePath = join(__dirname, "..", "data", "continue.yaml");
13
+ const template = parse(readFileSync(templatePath, "utf-8"));
14
+ const configDir = location === "global"
15
+ ? join(homedir(), ".continue")
16
+ : join(process.cwd(), ".continue");
17
+ const configPath = join(configDir, "config.yaml");
18
+ let config = {};
19
+ if (existsSync(configPath)) {
20
+ try {
21
+ config = parse(readFileSync(configPath, "utf-8")) || {};
22
+ }
23
+ catch {
24
+ // If we can't parse, start fresh
25
+ }
26
+ // Check if any Opper entries already exist
27
+ const models = Array.isArray(config.models) ? config.models : [];
28
+ const hasOpper = models.some((m) => m.apiBase === OPPER_API_BASE);
29
+ if (hasOpper) {
30
+ const overwrite = await confirm({
31
+ message: "Continue config already has Opper models. Overwrite them?",
32
+ default: false,
33
+ });
34
+ if (!overwrite) {
35
+ console.log("Skipping Continue.dev setup.");
36
+ return;
37
+ }
38
+ // Remove existing Opper entries
39
+ config.models = models.filter((m) => m.apiBase !== OPPER_API_BASE);
40
+ }
41
+ }
42
+ // Inject actual API key into template models
43
+ const apiKey = process.env.OPPER_API_KEY;
44
+ if (!apiKey) {
45
+ console.log("⚠ OPPER_API_KEY is not set. Cannot write Continue config without it.\n" +
46
+ "\n export OPPER_API_KEY=<your-api-key>\n" +
47
+ "\nGet your API key at https://platform.opper.ai\n" +
48
+ "Then re-run this setup.\n");
49
+ return;
50
+ }
51
+ const models = template.models.map((m) => ({
52
+ ...m,
53
+ apiKey,
54
+ }));
55
+ // Add Opper models
56
+ if (!Array.isArray(config.models)) {
57
+ config.models = [];
58
+ }
59
+ config.models.push(...models);
60
+ // Write config
61
+ mkdirSync(configDir, { recursive: true });
62
+ writeFileSync(configPath, stringify(config), "utf-8");
63
+ console.log(`Wrote ${template.models.length} Opper models to ${configPath}`);
64
+ console.log("API key written to config.");
65
+ }
package/dist/index.js CHANGED
@@ -1,43 +1,35 @@
1
1
  #!/usr/bin/env node
2
- import { checkbox, Separator } from "@inquirer/prompts";
2
+ import { checkbox, select, Separator } from "@inquirer/prompts";
3
+ import { exec } from "node:child_process";
3
4
  import { setupOpenCode } from "./opencode.js";
5
+ import { setupContinue } from "./continue.js";
4
6
  import { setupSkills } from "./skills.js";
5
7
  import { setupApiKey } from "./apikey.js";
6
- import { installPackage, installCli } from "./install.js";
8
+ import { installCli } from "./install.js";
7
9
  async function main() {
8
10
  console.log();
9
11
  await setupApiKey();
10
12
  const selections = await checkbox({
11
13
  message: "What would you like to set up? (space to select/deselect, enter to confirm)",
14
+ pageSize: 15,
12
15
  choices: [
13
16
  new Separator(" "),
14
17
  new Separator("── AI Code Editors ──"),
15
18
  {
16
19
  name: "Skills — Add Opper skills to your AI code editor",
17
20
  value: "skills",
18
- checked: true,
19
21
  },
20
22
  {
21
23
  name: "OpenCode — Use Opper models in OpenCode",
22
24
  value: "opencode",
23
25
  },
24
- new Separator(" "),
25
- new Separator("── SDKs ──"),
26
- {
27
- name: "Node SDK — AI functions, RAG, and tracing for TypeScript (opperai)",
28
- value: "node-sdk",
29
- },
30
- {
31
- name: "Node Agent SDK — Build agents with tool use and reasoning (@opperai/agents)",
32
- value: "node-agents",
33
- },
34
26
  {
35
- name: "Python SDK AI functions, RAG, and tracing for Python (opperai)",
36
- value: "python-sdk",
27
+ name: "ContinueUse Opper models in Continue.dev",
28
+ value: "continue",
37
29
  },
38
30
  {
39
- name: "Python Agent SDK Build agents with tool use and reasoning (opper-agents)",
40
- value: "python-agents",
31
+ name: "Other editorsOpen setup guide for Cursor, Cline, and more",
32
+ value: "other-editors",
41
33
  },
42
34
  new Separator(" "),
43
35
  new Separator("── Tools ──"),
@@ -51,27 +43,45 @@ async function main() {
51
43
  console.log("Nothing selected. Exiting.");
52
44
  return;
53
45
  }
46
+ // Ask for config location if OpenCode or Continue is selected
47
+ let configLocation = "global";
48
+ if (selections.includes("opencode") || selections.includes("continue")) {
49
+ configLocation = await select({
50
+ message: "Where should the config be written?",
51
+ choices: [
52
+ {
53
+ name: "Global — applies to all projects",
54
+ value: "global",
55
+ },
56
+ {
57
+ name: "Local — current directory only",
58
+ value: "local",
59
+ },
60
+ ],
61
+ });
62
+ }
54
63
  if (selections.includes("skills")) {
55
64
  await setupSkills();
56
65
  }
57
66
  if (selections.includes("opencode")) {
58
- await setupOpenCode();
59
- }
60
- if (selections.includes("node-sdk")) {
61
- await installPackage("npm", "opperai", "Opper Node SDK");
62
- }
63
- if (selections.includes("node-agents")) {
64
- await installPackage("npm", "@opperai/agents", "Opper Node Agent SDK");
67
+ await setupOpenCode(configLocation);
65
68
  }
66
- if (selections.includes("python-sdk")) {
67
- await installPackage("pip", "opperai", "Opper Python SDK");
68
- }
69
- if (selections.includes("python-agents")) {
70
- await installPackage("pip", "opper-agents", "Opper Python Agent SDK");
69
+ if (selections.includes("continue")) {
70
+ await setupContinue(configLocation);
71
71
  }
72
72
  if (selections.includes("cli")) {
73
73
  await installCli();
74
74
  }
75
+ if (selections.includes("other-editors")) {
76
+ const url = "https://docs.opper.ai/building/ai-editors";
77
+ const cmd = process.platform === "darwin"
78
+ ? `open "${url}"`
79
+ : process.platform === "win32"
80
+ ? `start "${url}"`
81
+ : `xdg-open "${url}"`;
82
+ exec(cmd);
83
+ console.log(`\nOpened ${url} in your browser.`);
84
+ }
75
85
  console.log("\nDone!");
76
86
  }
77
87
  main().catch((error) => {
package/dist/install.d.ts CHANGED
@@ -1,2 +1 @@
1
- export declare function installPackage(manager: "npm" | "pip", pkg: string, label: string): Promise<void>;
2
1
  export declare function installCli(): Promise<void>;
package/dist/install.js CHANGED
@@ -1,11 +1,4 @@
1
1
  import { execSync } from "node:child_process";
2
- export async function installPackage(manager, pkg, label) {
3
- console.log(`\n--- ${label} ---\n`);
4
- const cmd = manager === "npm" ? `npm install ${pkg}` : `pip install ${pkg}`;
5
- console.log(`Running: ${cmd}\n`);
6
- execSync(cmd, { stdio: "inherit" });
7
- console.log(`\n${label} installed.`);
8
- }
9
2
  export async function installCli() {
10
3
  console.log("\n--- Opper CLI ---\n");
11
4
  if (process.platform !== "darwin") {
@@ -1 +1 @@
1
- export declare function setupOpenCode(): Promise<void>;
1
+ export declare function setupOpenCode(location: "global" | "local"): Promise<void>;
package/dist/opencode.js CHANGED
@@ -4,12 +4,14 @@ import { homedir } from "node:os";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { confirm } from "@inquirer/prompts";
6
6
  const __dirname = dirname(fileURLToPath(import.meta.url));
7
- export async function setupOpenCode() {
7
+ export async function setupOpenCode(location) {
8
8
  console.log("\n--- OpenCode Setup ---\n");
9
9
  // Read embedded config template
10
10
  const templatePath = join(__dirname, "..", "data", "opencode.json");
11
11
  const config = readFileSync(templatePath, "utf-8");
12
- const configDir = join(homedir(), ".config", "opencode");
12
+ const configDir = location === "global"
13
+ ? join(homedir(), ".config", "opencode")
14
+ : process.cwd();
13
15
  const configPath = join(configDir, "opencode.json");
14
16
  // Check if config already exists with opper provider
15
17
  if (existsSync(configPath)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opperai/setup",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Set up Opper tooling for AI code editors",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,8 @@
16
16
  "prepublishOnly": "npm run build"
17
17
  },
18
18
  "dependencies": {
19
- "@inquirer/prompts": "^7"
19
+ "@inquirer/prompts": "^7",
20
+ "yaml": "^2.8.2"
20
21
  },
21
22
  "devDependencies": {
22
23
  "@types/node": "^25.2.0",