@whatcode-ai/whatcode 1.14.0 → 1.16.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.
package/README.md CHANGED
@@ -7,24 +7,9 @@ Full documentation at **[whatcode.app](https://whatcode.app)**.
7
7
  ## Usage
8
8
 
9
9
  ```bash
10
- # start opencode
11
10
  npx @whatcode-ai/whatcode
12
-
13
- # start opencode + expose via Tailscale
14
- npx @whatcode-ai/whatcode --tailscale
15
11
  ```
16
12
 
17
- ## Options
18
-
19
- | Flag | Alias | Default | Description |
20
- | ----------------- | ----- | --------- | ---------------------------------------------------- |
21
- | `--tailscale` | `-t` | `false` | Expose opencode over HTTPS on your Tailscale tailnet |
22
- | `--hostname` | `-H` | `0.0.0.0` | Hostname to bind the opencode server to |
23
- | `--port` | `-p` | `8192` | Port for the Whatcode server |
24
- | `--opencode-port` | | `4096` | Port for the opencode server |
25
- | `--log-level` | | `info` | Log verbosity: `none` \| `info` \| `debug` |
26
- | `--help` | | | Show help |
27
-
28
13
  ## Programmatic usage
29
14
 
30
15
  Use [@whatcode-ai/sdk](https://www.npmjs.com/package/@whatcode-ai/sdk) instead.
package/dist/cli.js CHANGED
@@ -1,43 +1,42 @@
1
1
  #!/usr/bin/env node
2
+ import { config } from "./config.js";
2
3
  import { createWhatcodeServer, resetWhatcodeServer } from '@whatcode-ai/sdk';
3
4
  import { logger, logLevelSchema } from '@whatcode-ai/sdk/logger';
4
5
  import { printQrCode } from "./qrcode.js";
5
- import yargs from 'yargs';
6
6
  import { hideBin } from 'yargs/helpers';
7
7
  import updateNotifier from 'update-notifier';
8
8
  import pkg from '../package.json' with { type: 'json' };
9
+ import yargs from 'yargs';
9
10
  updateNotifier({ pkg }).notify();
10
- const { tailscale, reset, port, opencodePort, logLevel, password } = await yargs(hideBin(process.argv))
11
+ const { tailscale, port, opencodePort, logLevel } = await yargs(hideBin(process.argv))
11
12
  .scriptName('whatcode')
12
13
  .help()
13
14
  .strict()
14
15
  .version(false)
15
16
  .usage('$0 [options]')
16
- .option('reset', { type: 'boolean', description: 'Reset Whatcode server, disconnect all active devices.' })
17
- .option('tailscale', { type: 'boolean', description: 'Expose opencode via Tailscale serve (HTTPS on your tailnet)' })
17
+ .option('tailscale', { type: 'boolean', description: 'Expose OpenCode via Tailscale serve (HTTPS on your tailnet)' })
18
18
  .option('port', { type: 'number', description: 'Port for the Whatcode server (default: 8192)' })
19
- .option('opencode-port', { type: 'number', description: 'Port for the opencode server (default: 4096)' })
19
+ .option('opencode-port', { type: 'number', description: 'Port for the OpenCode server (default: 4096)' })
20
20
  .option('log-level', {
21
21
  type: 'string',
22
22
  choices: ['none', 'info', 'debug'],
23
23
  default: 'info',
24
24
  description: 'Log level: none | info | debug (default: info)',
25
25
  })
26
- .option('password', { type: 'string', description: 'Password to protect the Whatcode and opencode servers (HTTP Basic Auth)' })
27
- .parseAsync();
28
- if (reset) {
26
+ .command('reset', 'Reset stored daemon data (APNs tokens). Use this if notifications stop working.', (y) => y, async () => {
29
27
  await resetWhatcodeServer();
30
- }
28
+ })
29
+ .parseAsync();
31
30
  const { url } = await createWhatcodeServer({
32
31
  tailscale,
33
32
  ...(port !== undefined && { port }),
34
33
  ...(opencodePort !== undefined && { opencodePort }),
35
34
  logLevel: await logLevelSchema.parseAsync(logLevel),
36
- ...(password !== undefined && { password }),
35
+ ...(config.WHATCODE_PASSWORD !== undefined && { password: config.WHATCODE_PASSWORD }),
37
36
  });
38
37
  if (url) {
39
38
  logger.info('whatcode', `use this URL in the app: ${url}`);
40
- printQrCode(url, password);
39
+ printQrCode(url, config.WHATCODE_PASSWORD);
41
40
  }
42
41
  else {
43
42
  logger.info('whatcode', 'could not determine local IP — find your machine IP in your network settings and connect manually');
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBA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AAc,CAAC,UAAU,CAAC,QAAQ,CAAC;IACnD,GAAG,CAAC,MAAM,CAAC,iBAAiB,KAAK,SAAS,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC;CACtF,CAAC,CAAC;AAEH,IAAI,GAAG,EAAE,CAAC;IACR,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,4BAA4B,GAAG,EAAE,CAAC,CAAC;IAC3D,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAC7C,CAAC;KAAM,CAAC;IACN,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,mGAAmG,CAAC,CAAC;AAC/H,CAAC"}
package/dist/config.d.ts CHANGED
@@ -1,2 +1,5 @@
1
- export declare const CLIENT_URL = "https://www.whatcode.app";
1
+ export declare const config: {
2
+ WHATCODE_SERVER_URL?: string | undefined;
3
+ WHATCODE_PASSWORD?: string | undefined;
4
+ };
2
5
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,6BAA6B,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,MAAM;;;CAGjB,CAAC"}
package/dist/config.js CHANGED
@@ -1,2 +1,15 @@
1
- export const CLIENT_URL = 'https://www.whatcode.app';
1
+ /* eslint-disable no-restricted-properties */
2
+ import * as z from 'zod';
3
+ try {
4
+ process.loadEnvFile();
5
+ }
6
+ catch { }
7
+ const envSchema = z.strictObject({
8
+ WHATCODE_SERVER_URL: z.string().optional(),
9
+ WHATCODE_PASSWORD: z.string().optional(),
10
+ });
11
+ export const config = await envSchema.parseAsync({
12
+ WHATCODE_SERVER_URL: process.env['WHATCODE_SERVER_URL'],
13
+ WHATCODE_PASSWORD: process.env['WHATCODE_PASSWORD'],
14
+ });
2
15
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,0BAA0B,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,IAAI,CAAC;IACH,OAAO,CAAC,WAAW,EAAE,CAAC;AACxB,CAAC;AAAC,MAAM,CAAC,CAAA,CAAC;AAEV,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,CAAC;IAC/B,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,UAAU,CAAC;IAC/C,mBAAmB,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;IACvD,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;CACpD,CAAC,CAAC"}
package/dist/qrcode.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import qrcode from 'qrcode-terminal';
2
- import { CLIENT_URL } from "./config.js";
3
2
  export const printQrCode = (url, password) => {
4
3
  const params = new URLSearchParams({ url });
5
4
  if (password)
6
5
  params.set('password', password);
7
- const deepLink = `${CLIENT_URL}/connect?${params.toString()}`;
6
+ const deepLink = `whatcode://connect?${params.toString()}`;
8
7
  qrcode.generate(deepLink, { small: true });
9
8
  };
10
9
  //# sourceMappingURL=qrcode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"qrcode.js","sourceRoot":"","sources":["../src/qrcode.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,QAAiB,EAAQ,EAAE;IAClE,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5C,IAAI,QAAQ;QAAE,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,GAAG,UAAU,YAAY,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC9D,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7C,CAAC,CAAC"}
1
+ {"version":3,"file":"qrcode.js","sourceRoot":"","sources":["../src/qrcode.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,QAAiB,EAAQ,EAAE;IAClE,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5C,IAAI,QAAQ;QAAE,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,sBAAsB,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7C,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,14 +1,17 @@
1
1
  {
2
2
  "name": "@whatcode-ai/whatcode",
3
- "description": "SDK and CLI to start opencode and optionally expose it over HTTPS via Tailscale.",
4
- "version": "1.14.0",
3
+ "description": "CLI to start opencode and optionally expose it over HTTPS via Tailscale — connect to your AI coding assistant from anywhere.",
4
+ "version": "1.16.0",
5
5
  "keywords": [
6
6
  "opencode",
7
7
  "tailscale",
8
8
  "ai",
9
9
  "cli",
10
- "sdk",
11
- "server"
10
+ "server",
11
+ "https",
12
+ "tunnel",
13
+ "remote",
14
+ "whatcode"
12
15
  ],
13
16
  "author": {
14
17
  "email": "simonegauli@gmail.com",
@@ -19,7 +22,7 @@
19
22
  "url": "https://github.com/Pnlvfx/whatcode-ai.git",
20
23
  "directory": "packages/whatcode"
21
24
  },
22
- "homepage": "https://github.com/Pnlvfx/whatcode-ai#readme",
25
+ "homepage": "https://www.whatcode.app/",
23
26
  "bugs": {
24
27
  "url": "https://github.com/Pnlvfx/whatcode-ai/issues"
25
28
  },
@@ -70,20 +73,20 @@
70
73
  "README.md"
71
74
  ],
72
75
  "dependencies": {
73
- "@whatcode-ai/sdk": "1.14.0",
76
+ "@whatcode-ai/sdk": "1.16.0",
74
77
  "qrcode-terminal": "^0.12.0",
75
78
  "update-notifier": "^7.3.1",
76
79
  "yargs": "^18.0.0"
77
80
  },
78
81
  "devDependencies": {
79
- "@goatjs/node-monorepo-eslint": "^2.17.0",
80
- "@goatjs/rimraf": "^2.4.0",
82
+ "@goatjs/node-monorepo-eslint": "^2.22.0",
83
+ "@goatjs/rimraf": "^2.8.0",
81
84
  "@goatjs/typescript-config": "^2.1.0",
82
- "@types/node": "^25.6.2",
85
+ "@types/node": "^25.9.1",
83
86
  "@types/qrcode-terminal": "^0.12.2",
84
87
  "@types/update-notifier": "^6.0.8",
85
88
  "@types/yargs": "^17.0.35",
86
- "eslint": "^10.3.0",
89
+ "eslint": "^10.4.0",
87
90
  "typescript": "^6.0.3"
88
91
  }
89
92
  }