btca 0.2.1 → 0.3.1

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
@@ -36,6 +36,7 @@ btca ask --tech svelte --question "How do I create a reactive store?"
36
36
  ```
37
37
 
38
38
  Options:
39
+
39
40
  - `-t, --tech` - The technology/repo to query
40
41
  - `-q, --question` - The question to ask
41
42
 
@@ -49,6 +50,7 @@ btca chat --tech nextjs
49
50
  ```
50
51
 
51
52
  Options:
53
+
52
54
  - `-t, --tech` - The technology/repo to chat about
53
55
 
54
56
  ### `btca serve`
@@ -61,9 +63,11 @@ btca serve -p 3000
61
63
  ```
62
64
 
63
65
  Options:
66
+
64
67
  - `-p, --port` - Port to listen on (default: 8080)
65
68
 
66
69
  Endpoint:
70
+
67
71
  - `POST /question` - Send `{ "tech": "svelte", "question": "..." }` to get answers
68
72
 
69
73
  ### `btca open`
@@ -96,6 +100,7 @@ btca config model --provider anthropic --model claude-3-opus
96
100
  ```
97
101
 
98
102
  Options:
103
+
99
104
  - `-p, --provider` - The provider to use
100
105
  - `-m, --model` - The model to use
101
106
 
@@ -119,6 +124,7 @@ btca config repos add --name react --url https://github.com/facebook/react --bra
119
124
  ```
120
125
 
121
126
  Options:
127
+
122
128
  - `-n, --name` - Unique name for the repo (required)
123
129
  - `-u, --url` - Git repository URL (required)
124
130
  - `-b, --branch` - Branch to use (default: "main")
package/bin.js CHANGED
@@ -12,6 +12,7 @@ const TARGET_MAP = {
12
12
  "darwin-x64": "btca-darwin-x64",
13
13
  "linux-x64": "btca-linux-x64",
14
14
  "linux-arm64": "btca-linux-arm64",
15
+ "win32-x64": "btca-windows-x64.exe",
15
16
  };
16
17
 
17
18
  const binaryName = TARGET_MAP[PLATFORM_ARCH];
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/index.js CHANGED
@@ -60451,7 +60451,6 @@ var repoSchema = exports_Schema.Struct({
60451
60451
  specialNotes: exports_Schema.String.pipe(exports_Schema.optional)
60452
60452
  });
60453
60453
  var configSchema = exports_Schema.Struct({
60454
- promptsDirectory: exports_Schema.String,
60455
60454
  reposDirectory: exports_Schema.String,
60456
60455
  port: exports_Schema.Number,
60457
60456
  maxInstances: exports_Schema.Number,
@@ -60460,8 +60459,7 @@ var configSchema = exports_Schema.Struct({
60460
60459
  provider: exports_Schema.String
60461
60460
  });
60462
60461
  var DEFAULT_CONFIG = {
60463
- promptsDirectory: `${CONFIG_DIRECTORY}/prompts`,
60464
- reposDirectory: `${CONFIG_DIRECTORY}/repos`,
60462
+ reposDirectory: "~/.local/share/btca/repos",
60465
60463
  port: 3420,
60466
60464
  maxInstances: 5,
60467
60465
  repos: [
@@ -60500,7 +60498,6 @@ var writeConfig = (config2) => exports_Effect.gen(function* () {
60500
60498
  const configPath = path2.join(configDir, CONFIG_FILENAME);
60501
60499
  const configToWrite = {
60502
60500
  ...config2,
60503
- promptsDirectory: collapseHome(config2.promptsDirectory),
60504
60501
  reposDirectory: collapseHome(config2.reposDirectory)
60505
60502
  };
60506
60503
  yield* fs.writeFileString(configPath, JSON.stringify(configToWrite, null, 2)).pipe(exports_Effect.catchAll((error4) => exports_Effect.fail(new ConfigError({
@@ -60572,11 +60569,9 @@ var onStartLoadConfig = exports_Effect.gen(function* () {
60572
60569
  cause: error4
60573
60570
  }))));
60574
60571
  yield* exports_Effect.log(`Default config created at ${configPath}`);
60575
- const promptsDir = yield* expandHome(DEFAULT_CONFIG.promptsDirectory);
60576
60572
  const reposDir = yield* expandHome(DEFAULT_CONFIG.reposDirectory);
60577
60573
  const config2 = {
60578
60574
  ...DEFAULT_CONFIG,
60579
- promptsDirectory: promptsDir,
60580
60575
  reposDirectory: reposDir
60581
60576
  };
60582
60577
  return {
@@ -60590,11 +60585,9 @@ var onStartLoadConfig = exports_Effect.gen(function* () {
60590
60585
  }))));
60591
60586
  const parsed = JSON.parse(content);
60592
60587
  return yield* exports_Effect.succeed(parsed).pipe(exports_Effect.flatMap(exports_Schema.decode(configSchema)), exports_Effect.flatMap((loadedConfig) => exports_Effect.gen(function* () {
60593
- const promptsDir = yield* expandHome(loadedConfig.promptsDirectory);
60594
60588
  const reposDir = yield* expandHome(loadedConfig.reposDirectory);
60595
60589
  const config2 = {
60596
60590
  ...loadedConfig,
60597
- promptsDirectory: promptsDir,
60598
60591
  reposDirectory: reposDir
60599
60592
  };
60600
60593
  return {
@@ -60608,10 +60601,7 @@ var configService = exports_Effect.gen(function* () {
60608
60601
  const path2 = yield* exports_Path.Path;
60609
60602
  const loadedConfig = yield* onStartLoadConfig;
60610
60603
  let { config: config2, configPath } = loadedConfig;
60611
- const getRepo = ({
60612
- repoName,
60613
- config: config3
60614
- }) => exports_Effect.gen(function* () {
60604
+ const getRepo = ({ repoName, config: config3 }) => exports_Effect.gen(function* () {
60615
60605
  const repo = config3.repos.find((repo2) => repo2.name === repoName);
60616
60606
  if (!repo) {
60617
60607
  return yield* exports_Effect.fail(new ConfigError({ message: "Repo not found" }));
@@ -60840,7 +60830,7 @@ class OcService extends exports_Effect.Service()("OcService", {
60840
60830
  }
60841
60831
 
60842
60832
  // src/services/cli.ts
60843
- var VERSION = "0.2.1";
60833
+ var VERSION = "0.3.1";
60844
60834
  var programLayer = exports_Layer.mergeAll(OcService.Default, ConfigService.Default);
60845
60835
  var questionOption = exports_Options.text("question").pipe(exports_Options.withAlias("q"));
60846
60836
  var techOption = exports_Options.text("tech").pipe(exports_Options.withAlias("t"));
@@ -61021,13 +61011,7 @@ var configCommand = exports_Command2.make("config", {}, () => exports_Effect.gen
61021
61011
  }).pipe(exports_Effect.provide(programLayer))).pipe(exports_Command2.withSubcommands([configModelCommand, configReposCommand]));
61022
61012
  var mainCommand = exports_Command2.make("btca", {}, () => exports_Effect.sync(() => {
61023
61013
  console.log(`btca v${VERSION}. run btca --help for more information.`);
61024
- })).pipe(exports_Command2.withSubcommands([
61025
- askCommand,
61026
- serveCommand,
61027
- openCommand,
61028
- chatCommand,
61029
- configCommand
61030
- ]));
61014
+ })).pipe(exports_Command2.withSubcommands([askCommand, serveCommand, openCommand, chatCommand, configCommand]));
61031
61015
  var cliService = exports_Effect.gen(function* () {
61032
61016
  return {
61033
61017
  run: (argv) => exports_Command2.run(mainCommand, {
package/package.json CHANGED
@@ -1,51 +1,51 @@
1
1
  {
2
- "name": "btca",
3
- "author": "Ben Davis",
4
- "version": "0.2.1",
5
- "description": "CLI tool for asking questions about technologies using OpenCode",
6
- "type": "module",
7
- "license": "MIT",
8
- "repository": {
9
- "type": "git",
10
- "url": "https://github.com/bmdavis419/better-context"
11
- },
12
- "keywords": [
13
- "cli",
14
- "ai",
15
- "docs"
16
- ],
17
- "engines": {
18
- "bun": ">=1.1.0"
19
- },
20
- "bin": {
21
- "btca": "./bin.js"
22
- },
23
- "files": [
24
- "bin.js",
25
- "dist"
26
- ],
27
- "publishConfig": {
28
- "access": "public"
29
- },
30
- "scripts": {
31
- "build": "bun run scripts/build.ts",
32
- "build:targets": "bun run scripts/build-binaries.ts",
33
- "build:artifacts": "bun run build && bun run build:targets",
34
- "prepublishOnly": "bun run build:artifacts",
35
- "check": "tsc --noEmit",
36
- "prepare": "effect-language-service patch"
37
- },
38
- "devDependencies": {
39
- "@effect/cli": "^0.72.1",
40
- "@effect/language-service": "^0.62.1",
41
- "@effect/platform": "^0.93.5",
42
- "@effect/platform-bun": "^0.85.0",
43
- "@effect/printer": "^0.47.0",
44
- "@effect/printer-ansi": "^0.47.0",
45
- "@effect/typeclass": "^0.38.0",
46
- "@opencode-ai/sdk": "^1.0.119",
47
- "@types/bun": "latest",
48
- "effect": "^3.19.8",
49
- "typescript": "^5.9.3"
50
- }
2
+ "name": "btca",
3
+ "author": "Ben Davis",
4
+ "version": "0.3.1",
5
+ "description": "CLI tool for asking questions about technologies using OpenCode",
6
+ "type": "module",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/bmdavis419/better-context"
11
+ },
12
+ "keywords": [
13
+ "cli",
14
+ "ai",
15
+ "docs"
16
+ ],
17
+ "engines": {
18
+ "bun": ">=1.1.0"
19
+ },
20
+ "bin": {
21
+ "btca": "./bin.js"
22
+ },
23
+ "files": [
24
+ "bin.js",
25
+ "dist"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "scripts": {
31
+ "build": "bun run scripts/build.ts",
32
+ "build:targets": "bun run scripts/build-binaries.ts",
33
+ "build:artifacts": "bun run build && bun run build:targets",
34
+ "prepublishOnly": "bun run build:artifacts",
35
+ "check": "tsc --noEmit",
36
+ "prepare": "effect-language-service patch"
37
+ },
38
+ "devDependencies": {
39
+ "@effect/cli": "^0.72.1",
40
+ "@effect/language-service": "^0.62.1",
41
+ "@effect/platform": "^0.93.5",
42
+ "@effect/platform-bun": "^0.85.0",
43
+ "@effect/printer": "^0.47.0",
44
+ "@effect/printer-ansi": "^0.47.0",
45
+ "@effect/typeclass": "^0.38.0",
46
+ "@opencode-ai/sdk": "^1.0.119",
47
+ "@types/bun": "latest",
48
+ "effect": "^3.19.8",
49
+ "typescript": "^5.9.3"
50
+ }
51
51
  }