@milisp/keke 0.1.2

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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 OpenAI
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,98 @@
1
+ # keke
2
+
3
+ [中文文档](README.zh-CN.md) | [Architecture](docs/architecture.md) | [Roadmap](docs/ROADMAP.md)
4
+
5
+ keke is a local terminal coding agent built for zero-vendor lock-in.
6
+ Works with subscriptions you already have, standard API keys, or self-hosted local models.
7
+
8
+ ## Why keke?
9
+
10
+ - **Protocol: ACP for every client**
11
+ Speaks the open Agent Client Protocol for both external client integrations and its internal TUI/agent seam.
12
+ - **Script & CI First (`keke exec`)**
13
+ Supports one-shot execution out of the box for non-interactive scripting and automated CI pipelines.
14
+ - **Vendor-Isolated Engine**
15
+ No vendor-specific logic inside `keke-core`. Adding standard model endpoints requires zero engine code changes — just a quick entry in `config.toml`.
16
+
17
+ ## Install
18
+
19
+ ```sh
20
+ curl -fsSL https://raw.githubusercontent.com/milisp/keke-agent/main/scripts/install.sh | sh
21
+ ```
22
+
23
+ This downloads the latest prebuilt binary for your platform into
24
+ `~/.local/bin` (override with `KEKE_INSTALL_DIR`).
25
+
26
+ You can also grab a binary directly from the
27
+ [latest release](https://github.com/milisp/keke-agent/releases/latest), or build
28
+ from source with `cargo build --release`.
29
+
30
+ ## Try it
31
+
32
+ ```sh
33
+ # Sign in with a subscription you already pay for
34
+ keke login codex
35
+ keke login grok
36
+
37
+ # ...or bring a key
38
+ export OPENAI_API_KEY=sk-...
39
+
40
+ keke exec "what does this project do?" # one-shot, for scripts and CI
41
+ keke # interactive TUI
42
+ keke resume # pick the last conversation back up
43
+ keke doctor # which providers and logins resolve
44
+ ```
45
+
46
+ ## What you can point it at
47
+
48
+ | Provider | How you authenticate | Notes |
49
+ | --- | --- | --- |
50
+ | OpenAI / ChatGPT | `keke login codex`, or `OPENAI_API_KEY` | OAuth flow ported from codex |
51
+ | Anthropic Claude | `ANTHROPIC_API_KEY` | Built in; the default provider. API key only — no subscription login |
52
+ | xAI Grok | `keke login grok`, or `XAI_API_KEY` | Built in |
53
+ | Local (Ollama, vLLM, …) | none | Your code never leaves the machine |
54
+ | Any OpenAI-compatible gateway | `env-key` in `config.toml` | Company proxies, NVIDIA NIM, routers |
55
+
56
+ Anything not built in is a few lines of `$KEKE_HOME/config.toml`, not a code
57
+ change:
58
+
59
+ ```toml
60
+ [providers.ollama]
61
+ base-url = "http://localhost:11434/v1"
62
+ default-model = "gpt-oss:20b"
63
+
64
+ [providers.anthropic]
65
+ base-url = "https://api.anthropic.com"
66
+ env-key = "ANTHROPIC_API_KEY"
67
+ wire = "messages"
68
+ ```
69
+
70
+ `wire` picks the request format — `chat-completions` (the default),
71
+ `responses`, or `messages` — so a new endpoint is a config entry rather than a release.
72
+
73
+ ## Status
74
+
75
+ Usable day to day. `keke exec`, the TUI, and the ACP server all run real
76
+ sessions end to end; runtime plugins (skills, commands, hooks, MCP servers)
77
+ install in the Claude Code format, and repository-provided ones stay inert
78
+ until you approve them. Switching models inside a running session is not
79
+ implemented yet — see [`docs/ROADMAP.md`](docs/ROADMAP.md).
80
+
81
+ ## Where it comes from
82
+
83
+ keke is a fresh implementation built by studying three open agent repos:
84
+ OpenAI's **codex**, xAI's **grok-build**, and **deepseek-harness** — whose
85
+ seam-first architecture (a hard boundary between engine and vendor, not a
86
+ convention) is the idea keke leans on hardest. Some pieces are ported
87
+ outright and attributed in the crate that carries them (codex's OAuth login
88
+ flow, for instance); most of it is keke's own code, shaped by what worked and
89
+ what didn't in those three. What keke does differently — and why that
90
+ matters enough to enforce in CI — is in
91
+ [`docs/architecture.md`](docs/architecture.md); the invariants themselves are
92
+ in [`AGENTS.md`](AGENTS.md).
93
+
94
+ ## License
95
+
96
+ Apache-2.0. See [`LICENSE`](LICENSE) and [`NOTICE`](NOTICE); code ported from
97
+ other projects is attributed in the `THIRD_PARTY_NOTICES.md` of the crate that
98
+ contains it.
@@ -0,0 +1,91 @@
1
+ # keke
2
+
3
+ [![CI](https://github.com/milisp/keke-agent/actions/workflows/ci.yml/badge.svg)](https://github.com/milisp/keke-agent/actions)
4
+
5
+ [English](README.md)
6
+
7
+ keke 是一个运行在本地终端的编码 agent,可以搭配任意模型使用——你已经订阅的
8
+ 服务、一个 API key,或者你自己机器上跑的模型。
9
+
10
+ keke 通过 stdio 提供开放的 Agent Client Protocol,所以任何支持 ACP 的
11
+ GUI(编辑器、Zed 之类)都能像终端一样驱动它。如果想在脚本或 CI 里用,用
12
+ `keke exec`。如果想用一个它还不认识的模型,在 `config.toml` 里声明即
13
+ 可——引擎里不需要改任何厂商相关的代码。
14
+
15
+ ## 安装
16
+
17
+ ```sh
18
+ curl -fsSL https://raw.githubusercontent.com/milisp/keke-agent/main/scripts/install.sh | sh
19
+ ```
20
+
21
+ 该脚本会为你的平台下载最新的预编译二进制文件到 `~/.local/bin`
22
+ (可通过 `KEKE_INSTALL_DIR` 覆盖)。
23
+
24
+ 你也可以直接从 [latest release](https://github.com/milisp/keke-agent/releases/latest)
25
+ 下载预编译二进制文件,或者用 `cargo build --release` 从源码构建。
26
+
27
+ ## 试一试
28
+
29
+ ```sh
30
+ # 用你已经付费的订阅登录
31
+ keke login codex
32
+ keke login grok
33
+
34
+ # ……或者直接用 key
35
+ export XAI_API_KEY=xai-...
36
+
37
+ keke exec "what does this project do?" # 一次性运行,适合脚本和 CI
38
+ keke # 交互式 TUI
39
+ keke resume # 接着上一次的对话继续
40
+ keke doctor # 查看哪些 provider 和登录能解析成功
41
+ ```
42
+
43
+ ## 你能接入什么
44
+
45
+ | Provider | 如何认证 | 说明 |
46
+ | --- | --- | --- |
47
+ | OpenAI / ChatGPT | `keke login codex`,或 `OPENAI_API_KEY` | OAuth 流程从 codex 移植而来 |
48
+ | xAI Grok | `keke login grok`,或 `XAI_API_KEY` | 内置,默认 provider |
49
+ | Anthropic | `config.toml` 中的 `env-key` | 声明时用 `wire = "messages"` |
50
+ | 本地模型(Ollama、vLLM 等) | 无需认证 | 代码不会离开这台机器 |
51
+ | 任意 OpenAI 兼容网关 | `config.toml` 中的 `env-key` | 公司代理、NVIDIA NIM、路由器等 |
52
+
53
+ 内置支持之外的服务,只需要在 `$KEKE_HOME/config.toml` 里加几行,不需要改代码:
54
+
55
+ ```toml
56
+ [providers.ollama]
57
+ base-url = "http://localhost:11434/v1"
58
+ default-model = "gpt-oss:20b"
59
+
60
+ [providers.anthropic]
61
+ base-url = "https://api.anthropic.com"
62
+ env-key = "ANTHROPIC_API_KEY"
63
+ wire = "messages"
64
+ ```
65
+
66
+ `wire` 决定请求格式——`chat-completions`(默认)、`responses`,或
67
+ `messages`——所以接入新接口只是一条配置,而不是一次发版。
68
+
69
+ ## 现状
70
+
71
+ 日常使用已经可用。`keke exec`、TUI 和 ACP server 都能完整跑通一次会话;
72
+ 运行时插件(skills、commands、hooks、MCP servers)按 Claude Code 的格式
73
+ 安装,仓库自带的插件在你批准之前始终处于未激活状态。在运行中的会话里切换
74
+ 模型这个功能还没实现——详见 [`docs/ROADMAP.md`](docs/ROADMAP.md)。
75
+
76
+ ## 灵感来源
77
+
78
+ keke 是通过研究三个开源 agent 项目——OpenAI 的 **codex**、xAI 的
79
+ **grok-build**,以及 **deepseek-harness**——写出来的全新实现,其中
80
+ deepseek-harness 提倡的 seam-first 架构(引擎和厂商之间是硬边界,而不是
81
+ 约定)是 keke 最依赖的一个想法。少数部分是直接移植过来的,并在承载它的
82
+ crate 中注明来源(比如 codex 的 OAuth 登录流程);其余大部分都是 keke
83
+ 自己的代码,只是被这三者的经验(包括踩过的坑)塑造出来的。keke 的不同
84
+ 之处、以及为什么值得在 CI 里强制执行,详见
85
+ [`docs/architecture.md`](docs/architecture.md);不变量本身在
86
+ [`AGENTS.md`](AGENTS.md)。
87
+
88
+ ## 许可证
89
+
90
+ Apache-2.0。详见 [`LICENSE`](LICENSE) 与 [`NOTICE`](NOTICE);从其他项目移植
91
+ 的代码会在承载它的 crate 的 `THIRD_PARTY_NOTICES.md` 中注明来源。
package/bin/keke.js ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { spawnSync } = require("child_process");
5
+
6
+ const PLATFORM_PACKAGE_BY_KEY = {
7
+ "darwin-x64": "@milisp/keke-darwin-x64",
8
+ "darwin-arm64": "@milisp/keke-darwin-arm64",
9
+ "linux-x64": "@milisp/keke-linux-x64",
10
+ "linux-arm64": "@milisp/keke-linux-arm64",
11
+ "win32-x64": "@milisp/keke-win32-x64",
12
+ };
13
+
14
+ const { platform, arch } = process;
15
+ const pkgName = PLATFORM_PACKAGE_BY_KEY[`${platform}-${arch}`];
16
+
17
+ if (!pkgName) {
18
+ console.error(`[keke] unsupported platform: ${platform}-${arch}`);
19
+ process.exit(1);
20
+ }
21
+
22
+ const binName = platform === "win32" ? "keke.exe" : "keke";
23
+
24
+ let bin;
25
+ try {
26
+ const pkgJsonPath = require.resolve(`${pkgName}/package.json`);
27
+ bin = pkgJsonPath.replace(/package\.json$/, binName);
28
+ } catch {
29
+ console.error(
30
+ `[keke] optional dependency ${pkgName} is missing. This usually ` +
31
+ "means npm skipped it (e.g. --no-optional, or an outdated lockfile). " +
32
+ "Try:\n" +
33
+ " npm install @milisp/keke@latest --force"
34
+ );
35
+ process.exit(1);
36
+ }
37
+
38
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
39
+ if (result.error) {
40
+ console.error(`[keke] failed to run binary: ${result.error.message}`);
41
+ process.exit(1);
42
+ }
43
+ process.exit(result.status === null ? 1 : result.status);
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@milisp/keke",
3
+ "version": "0.1.2",
4
+ "description": "keke is a multi-vendor terminal coding agent.",
5
+ "license": "Apache-2.0",
6
+ "bin": {
7
+ "keke": "bin/keke.js"
8
+ },
9
+ "files": [
10
+ "bin"
11
+ ],
12
+ "engines": {
13
+ "node": ">=16"
14
+ },
15
+ "os": [
16
+ "darwin",
17
+ "linux",
18
+ "win32"
19
+ ],
20
+ "optionalDependencies": {
21
+ "@milisp/keke-darwin-x64": "0.1.2",
22
+ "@milisp/keke-darwin-arm64": "0.1.2",
23
+ "@milisp/keke-linux-x64": "0.1.2",
24
+ "@milisp/keke-linux-arm64": "0.1.2",
25
+ "@milisp/keke-win32-x64": "0.1.2"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/milisp/keke-agent.git"
30
+ }
31
+ }