@opentag/cli 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.
Files changed (61) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +77 -0
  3. package/dist/catalogs/executors.d.ts +23 -0
  4. package/dist/catalogs/executors.d.ts.map +1 -0
  5. package/dist/catalogs/languages.d.ts +8 -0
  6. package/dist/catalogs/languages.d.ts.map +1 -0
  7. package/dist/catalogs/platforms.d.ts +16 -0
  8. package/dist/catalogs/platforms.d.ts.map +1 -0
  9. package/dist/commands/executors.d.ts +5 -0
  10. package/dist/commands/executors.d.ts.map +1 -0
  11. package/dist/commands/platforms.d.ts +2 -0
  12. package/dist/commands/platforms.d.ts.map +1 -0
  13. package/dist/commands/setup.d.ts +10 -0
  14. package/dist/commands/setup.d.ts.map +1 -0
  15. package/dist/config.d.ts +638 -0
  16. package/dist/config.d.ts.map +1 -0
  17. package/dist/doctor.d.ts +5 -0
  18. package/dist/doctor.d.ts.map +1 -0
  19. package/dist/health.d.ts +11 -0
  20. package/dist/health.d.ts.map +1 -0
  21. package/dist/index.d.ts +3 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +2320 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/lark-registration.d.ts +2 -0
  26. package/dist/lark-registration.d.ts.map +1 -0
  27. package/dist/platforms/github/display.d.ts +10 -0
  28. package/dist/platforms/github/display.d.ts.map +1 -0
  29. package/dist/platforms/lark/display.d.ts +13 -0
  30. package/dist/platforms/lark/display.d.ts.map +1 -0
  31. package/dist/platforms/lark/registration-ui.d.ts +10 -0
  32. package/dist/platforms/lark/registration-ui.d.ts.map +1 -0
  33. package/dist/platforms/lark/saved-config.d.ts +14 -0
  34. package/dist/platforms/lark/saved-config.d.ts.map +1 -0
  35. package/dist/platforms/ports.d.ts +4 -0
  36. package/dist/platforms/ports.d.ts.map +1 -0
  37. package/dist/setup/builders.d.ts +4 -0
  38. package/dist/setup/builders.d.ts.map +1 -0
  39. package/dist/setup/defaults.d.ts +5 -0
  40. package/dist/setup/defaults.d.ts.map +1 -0
  41. package/dist/setup/flow.d.ts +44 -0
  42. package/dist/setup/flow.d.ts.map +1 -0
  43. package/dist/setup/guides.d.ts +25 -0
  44. package/dist/setup/guides.d.ts.map +1 -0
  45. package/dist/setup/summary.d.ts +5 -0
  46. package/dist/setup/summary.d.ts.map +1 -0
  47. package/dist/setup/types.d.ts +68 -0
  48. package/dist/setup/types.d.ts.map +1 -0
  49. package/dist/setup.d.ts +7 -0
  50. package/dist/setup.d.ts.map +1 -0
  51. package/dist/start.d.ts +34 -0
  52. package/dist/start.d.ts.map +1 -0
  53. package/dist/status.d.ts +25 -0
  54. package/dist/status.d.ts.map +1 -0
  55. package/dist/ui/clack.d.ts +3 -0
  56. package/dist/ui/clack.d.ts.map +1 -0
  57. package/dist/ui/messages.d.ts +12 -0
  58. package/dist/ui/messages.d.ts.map +1 -0
  59. package/dist/ui/prompts.d.ts +30 -0
  60. package/dist/ui/prompts.d.ts.map +1 -0
  61. package/package.json +57 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Amplift
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,77 @@
1
+ # @opentag/cli
2
+
3
+ OpenTag CLI for setting up and running a local OpenTag stack.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @opentag/cli
9
+ ```
10
+
11
+ Then run:
12
+
13
+ ```bash
14
+ opentag setup
15
+ opentag start
16
+ ```
17
+
18
+ `opentag setup` walks through the local configuration:
19
+
20
+ - Choose a language.
21
+ - Choose a platform: Lark / Feishu, Slack, or GitHub.
22
+ - Choose a coding agent: Codex, Claude Code, or Echo for local testing.
23
+ - Configure platform credentials.
24
+ - Bind the selected project.
25
+ - Optionally start OpenTag immediately.
26
+
27
+ ## Commands
28
+
29
+ ```bash
30
+ opentag setup
31
+ opentag start
32
+ opentag status
33
+ opentag doctor
34
+ opentag config path
35
+ opentag config show
36
+ opentag platforms
37
+ opentag executors
38
+ ```
39
+
40
+ ## Local Config
41
+
42
+ OpenTag stores local configuration at:
43
+
44
+ ```text
45
+ ~/.config/opentag/config.json
46
+ ```
47
+
48
+ The config contains local secrets, so the CLI writes it with private file permissions.
49
+
50
+ ## Platform Guides
51
+
52
+ The setup wizard links to the matching guide for each platform:
53
+
54
+ - Lark / Feishu: `docs/platforms/lark.en.md`
55
+ - Slack: `docs/platforms/slack.en.md`
56
+ - GitHub: `docs/platforms/github.en.md`
57
+
58
+ ## Requirements
59
+
60
+ - Node.js 20 or newer.
61
+ - A local coding agent if you choose Codex or Claude Code.
62
+ - Platform credentials for the platform you connect.
63
+
64
+ ## Local Development
65
+
66
+ Inside the OpenTag monorepo, install the development command:
67
+
68
+ ```bash
69
+ corepack pnpm opentag-dev
70
+ ```
71
+
72
+ Then run:
73
+
74
+ ```bash
75
+ opentag-dev setup
76
+ opentag-dev start
77
+ ```
@@ -0,0 +1,23 @@
1
+ export type ExecutorId = "echo" | "codex" | "claude-code";
2
+ export type ExecutorDescriptor = {
3
+ id: ExecutorId;
4
+ label: string;
5
+ command?: string;
6
+ alwaysAvailable?: boolean;
7
+ devOnly?: boolean;
8
+ };
9
+ export type ExecutorDetection = {
10
+ id: ExecutorId;
11
+ available: boolean;
12
+ reason: string;
13
+ };
14
+ export declare const EXECUTOR_CATALOG: ExecutorDescriptor[];
15
+ export declare function parseExecutorId(value: string): ExecutorId;
16
+ export declare function detectExecutors(env?: NodeJS.ProcessEnv): ExecutorDetection[];
17
+ export declare function defaultExecutorId(input?: {
18
+ previous?: ExecutorId;
19
+ detections?: ExecutorDetection[];
20
+ }): ExecutorId;
21
+ export declare function executorLabel(id: ExecutorId): string;
22
+ export declare function formatExecutors(env?: NodeJS.ProcessEnv): string;
23
+ //# sourceMappingURL=executors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executors.d.ts","sourceRoot":"","sources":["../../src/catalogs/executors.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,aAAa,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,UAAU,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,EAiBhD,CAAC;AAWF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAKzD;AAED,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,iBAAiB,EAAE,CAgBzF;AAED,wBAAgB,iBAAiB,CAAC,KAAK,GAAE;IACvC,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC7B,GAAG,UAAU,CAYlB;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,CAEpD;AASD,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAU5E"}
@@ -0,0 +1,8 @@
1
+ export type CliLanguage = "en" | "zh-CN";
2
+ export declare const LANGUAGE_OPTIONS: Array<{
3
+ id: CliLanguage;
4
+ label: string;
5
+ hint: string;
6
+ }>;
7
+ export declare function parseCliLanguage(value: string): CliLanguage;
8
+ //# sourceMappingURL=languages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../src/catalogs/languages.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC;AAEzC,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC;IACnC,EAAE,EAAE,WAAW,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAGA,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAK3D"}
@@ -0,0 +1,16 @@
1
+ import type { CliLanguage } from "./languages.js";
2
+ export type PlatformId = "lark" | "slack" | "github" | "telegram";
3
+ export type PlatformStatus = "setup_ready" | "setup_pending" | "experimental_setup_pending";
4
+ export type PlatformDescriptor = {
5
+ id: PlatformId;
6
+ label: string;
7
+ status: PlatformStatus;
8
+ startable: boolean;
9
+ };
10
+ export declare const PLATFORM_CATALOG: PlatformDescriptor[];
11
+ export declare function parsePlatformId(value: string): PlatformId;
12
+ export declare function platformById(id: PlatformId): PlatformDescriptor;
13
+ export declare function platformSetupGuideUrl(id: PlatformId, language: CliLanguage): string | undefined;
14
+ export declare function formatPlatformStatus(status: PlatformStatus): string;
15
+ export declare function formatPlatforms(): string;
16
+ //# sourceMappingURL=platforms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platforms.d.ts","sourceRoot":"","sources":["../../src/catalogs/platforms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;AAElE,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,eAAe,GAAG,4BAA4B,CAAC;AAE5F,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAmBF,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,EAyBhD,CAAC;AAEF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAKzD;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,UAAU,GAAG,kBAAkB,CAM/D;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAG/F;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CASnE;AAED,wBAAgB,eAAe,IAAI,MAAM,CAOxC"}
@@ -0,0 +1,5 @@
1
+ export type ExecutorsCommandOptions = {
2
+ env?: NodeJS.ProcessEnv;
3
+ };
4
+ export declare function runExecutorsCommand(options?: ExecutorsCommandOptions): void;
5
+ //# sourceMappingURL=executors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executors.d.ts","sourceRoot":"","sources":["../../src/commands/executors.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAAG;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,uBAA4B,GAAG,IAAI,CAE/E"}
@@ -0,0 +1,2 @@
1
+ export declare function runPlatformsCommand(): void;
2
+ //# sourceMappingURL=platforms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platforms.d.ts","sourceRoot":"","sources":["../../src/commands/platforms.ts"],"names":[],"mappings":"AAEA,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C"}
@@ -0,0 +1,10 @@
1
+ import { type SetupCommandOptions, type SetupFlowDependencies } from "../setup/flow.js";
2
+ import { type StartCommandOptions } from "../start.js";
3
+ export type { SetupCommandOptions };
4
+ export type SetupCommandDependencies = Partial<Omit<SetupFlowDependencies, "prompts" | "scanLarkPersonalAgent">> & {
5
+ prompts?: SetupFlowDependencies["prompts"];
6
+ scanLarkPersonalAgent?: SetupFlowDependencies["scanLarkPersonalAgent"];
7
+ startOpenTag?(options: StartCommandOptions): Promise<void>;
8
+ };
9
+ export declare function runSetupCommand(options: SetupCommandOptions, dependencies?: SetupCommandDependencies): Promise<void>;
10
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AAOA,OAAO,EAAqB,KAAK,mBAAmB,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAI3G,OAAO,EAAmB,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAExE,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEpC,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,SAAS,GAAG,uBAAuB,CAAC,CAAC,GAAG;IACjH,OAAO,CAAC,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC3C,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,uBAAuB,CAAC,CAAC;IACvE,YAAY,CAAC,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D,CAAC;AAcF,wBAAsB,eAAe,CAAC,OAAO,EAAE,mBAAmB,EAAE,YAAY,GAAE,wBAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CAoC9H"}