opencode-context 1.0.2 → 1.0.4

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.
package/README.md CHANGED
@@ -4,6 +4,27 @@ Smart file finder for codebases with relevance scoring. Includes an OpenCode plu
4
4
 
5
5
  ## Installation
6
6
 
7
+ ### For Humans
8
+
9
+ Copy and paste this to your LLM agent (Claude Code, Cursor, etc.):
10
+
11
+ ```
12
+ Install opencode-context by following the instructions here:
13
+ https://raw.githubusercontent.com/Lukasdias/opencontext/refs/heads/main/README.md
14
+ ```
15
+
16
+ Or read the installation guide below.
17
+
18
+ ### For LLM Agents
19
+
20
+ Fetch and follow the installation:
21
+
22
+ ```bash
23
+ curl -s https://raw.githubusercontent.com/Lukasdias/opencontext/refs/heads/main/README.md
24
+ ```
25
+
26
+ ---
27
+
7
28
  ### OpenCode Plugin
8
29
 
9
30
  Add to `~/.config/opencode/opencode.json`:
@@ -60,9 +81,9 @@ find_files query="auth middleware" maxFiles=5
60
81
  ## CLI Usage
61
82
 
62
83
  ```bash
63
- opencontext --query "auth" --max-files 5
64
- opencontext --interactive
65
- opencontext -q "database" --json
84
+ opencode-context --query "auth" --max-files 5
85
+ opencode-context --interactive
86
+ opencode-context -q "database" --json
66
87
  ```
67
88
 
68
89
  ### Options
@@ -90,6 +111,16 @@ opencontext -q "database" --json
90
111
 
91
112
  No index persistence - scans fresh on each query.
92
113
 
114
+ ## Uninstallation
115
+
116
+ Remove from `~/.config/opencode/opencode.json` plugins array:
117
+
118
+ ```json
119
+ {
120
+ "plugin": []
121
+ }
122
+ ```
123
+
93
124
  ## License
94
125
 
95
126
  MIT
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export {};
1
+ import { searchFiles } from './search.js';
2
+ export { searchFiles };
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA4M1C,OAAO,EAAE,WAAW,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -8346,7 +8346,6 @@ async function searchFiles(options) {
8346
8346
  }
8347
8347
 
8348
8348
  // src/index.ts
8349
- var program2 = new Command;
8350
8349
  function formatScore(score) {
8351
8350
  if (score >= 80)
8352
8351
  return import_picocolors3.default.green(score.toString().padStart(3));
@@ -8456,36 +8455,43 @@ async function interactiveMode() {
8456
8455
  process.exit(1);
8457
8456
  }
8458
8457
  }
8459
- program2.name("opencontext").description("Smart file finder for codebases - semantic search with confidence scoring").version("1.0.0");
8460
- program2.option("-q, --query <query>", "Search query").option("-n, --max-files <number>", "Maximum number of results", "5").option("--min-score <score>", "Minimum relevance score (0-100)", "15").option("-p, --path <path>", "Root path to search from", process.cwd()).option("--include-tests", "Include test files", false).option("--include-configs", "Include configuration files", false).option("--include-docs", "Include documentation files", false).option("--no-content", "Skip content search (faster)").option("--max-size <bytes>", "Maximum file size to read", "1048576").option("-j, --json", "Output as JSON", false).option("-d, --detailed", "Show detailed match reasons", false).option("-i, --interactive", "Interactive mode", false).action(async (options) => {
8461
- try {
8462
- if (options.interactive || !options.query) {
8463
- await interactiveMode();
8464
- return;
8465
- }
8466
- const searchOptions = {
8467
- query: options.query,
8468
- maxFiles: parseInt(options.maxFiles, 10),
8469
- minScore: parseInt(options.minScore, 10),
8470
- rootPath: options.path,
8471
- includeTests: options.includeTests,
8472
- includeConfigs: options.includeConfigs,
8473
- includeDocs: options.includeDocs,
8474
- searchContent: options.content !== false,
8475
- maxFileSize: parseInt(options.maxSize, 10)
8476
- };
8477
- const result = await searchFiles(searchOptions);
8478
- if (options.json) {
8479
- console.log(JSON.stringify(result, null, 2));
8480
- } else {
8481
- formatResults(result, options.detailed);
8458
+ function runCLI() {
8459
+ const program2 = new Command;
8460
+ program2.name("opencode-context").description("Smart file finder for codebases - semantic search with confidence scoring").version("1.0.3");
8461
+ program2.option("-q, --query <query>", "Search query").option("-n, --max-files <number>", "Maximum number of results", "5").option("--min-score <score>", "Minimum relevance score (0-100)", "15").option("-p, --path <path>", "Root path to search from", process.cwd()).option("--include-tests", "Include test files", false).option("--include-configs", "Include configuration files", false).option("--include-docs", "Include documentation files", false).option("--no-content", "Skip content search (faster)").option("--max-size <bytes>", "Maximum file size to read", "1048576").option("-j, --json", "Output as JSON", false).option("-d, --detailed", "Show detailed match reasons", false).option("-i, --interactive", "Interactive mode", false).action(async (options) => {
8462
+ try {
8463
+ if (options.interactive || !options.query) {
8464
+ await interactiveMode();
8465
+ return;
8466
+ }
8467
+ const searchOptions = {
8468
+ query: options.query,
8469
+ maxFiles: parseInt(options.maxFiles, 10),
8470
+ minScore: parseInt(options.minScore, 10),
8471
+ rootPath: options.path,
8472
+ includeTests: options.includeTests,
8473
+ includeConfigs: options.includeConfigs,
8474
+ includeDocs: options.includeDocs,
8475
+ searchContent: options.content !== false,
8476
+ maxFileSize: parseInt(options.maxSize, 10)
8477
+ };
8478
+ const result = await searchFiles(searchOptions);
8479
+ if (options.json) {
8480
+ console.log(JSON.stringify(result, null, 2));
8481
+ } else {
8482
+ formatResults(result, options.detailed);
8483
+ }
8484
+ } catch (error) {
8485
+ const message = error instanceof Error ? error.message : String(error);
8486
+ console.error(import_picocolors3.default.red(`Error: ${message}`));
8487
+ process.exit(1);
8482
8488
  }
8483
- } catch (error) {
8484
- const message = error instanceof Error ? error.message : String(error);
8485
- console.error(import_picocolors3.default.red(`Error: ${message}`));
8486
- process.exit(1);
8487
- }
8488
- });
8489
- if (__require.main == __require.module) {
8489
+ });
8490
8490
  program2.parse();
8491
8491
  }
8492
+ if (__require.main == __require.module) {
8493
+ runCLI();
8494
+ }
8495
+ export {
8496
+ searchFiles
8497
+ };
package/dist/install.js CHANGED
@@ -26,7 +26,7 @@ async function writeConfig(config) {
26
26
  `);
27
27
  }
28
28
  async function install() {
29
- console.log(`Installing OpenContext plugin...
29
+ console.log(`Installing opencode-context plugin...
30
30
  `);
31
31
  await ensureConfigDir();
32
32
  const config = await readConfig();
@@ -35,10 +35,10 @@ async function install() {
35
35
  }
36
36
  const pluginName = "opencode-context@latest";
37
37
  if (config.plugin.includes(pluginName)) {
38
- console.log("\u2713 OpenContext already in plugins");
38
+ console.log("\u2713 opencode-context already in plugins");
39
39
  } else {
40
40
  config.plugin.push(pluginName);
41
- console.log("\u2713 Added opencontext to plugins");
41
+ console.log("\u2713 Added opencode-context@latest to plugins");
42
42
  }
43
43
  await writeConfig(config);
44
44
  console.log(`
@@ -50,4 +50,6 @@ To use:`);
50
50
  console.log(` 3. The agent will use find_files tool
51
51
  `);
52
52
  }
53
- install().catch(console.error);
53
+ if (__require.main == __require.module) {
54
+ install().catch(console.error);
55
+ }
package/dist/plugin.js CHANGED
@@ -18092,7 +18092,7 @@ async function searchFiles(options) {
18092
18092
  }
18093
18093
 
18094
18094
  // src/plugin.ts
18095
- var OpenContextPlugin = async (ctx) => {
18095
+ var OpenContextPlugin = async () => {
18096
18096
  return {
18097
18097
  tool: {
18098
18098
  find_files: tool({
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "opencode-context",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Smart file finder for codebases - semantic search with confidence scoring. Also available as an OpenCode plugin.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "bin": {
9
- "opencode-context": "dist/index.js",
10
- "opencode-context-install": "dist/install.js"
9
+ "opencode-context": "dist/index.js"
11
10
  },
12
11
  "files": [
13
12
  "dist/",