zames_pro 2.67.0 → 2.67.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/CHANGELOG.md CHANGED
@@ -7,16 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [2.67.0] - 2026-10-08
11
-
12
- ### Added
10
+ ## [2.67.1] - 2026-10-08
13
11
 
14
- - **agent:** one-shot exit code, recursive self-review, MCP dedupe/truncate/plan-filter, transcript flush (N3/N4/N5/N9/N20/N21)
12
+ ### Changed
15
13
 
16
- ### Fixed
14
+ - **web:** the headless renderer reuses ONE BrowserContext for every
15
+ `WebFetch` with `render=true` (it used to build a fresh context per call);
16
+ the page is closed after each fetch and the context in `closeWeb()`.
17
+ - **docs:** `npm run self-smoke` is now documented as a REQUIRED manual
18
+ pre-release step in DEVELOPING.md — it is the only gate that catches an
19
+ integration regression (login, send, attachments) and needs live creds,
20
+ so it stays out of CI.
21
+ - **packaging:** `README.ru.md` is no longer generated or published. The
22
+ Russian translation already lives inside README.md as a `<details>` block
23
+ (visible on npm), and the language switcher is now an in-page `#readme-ru`
24
+ anchor — the second ~15 KB file only duplicated it and could drift.
17
25
 
18
- - **input:** CSI-u Delete, visual-row Up/Down, ESC disambiguation, Ctrl+L/PageUp (N27/N28/N29/N30)
19
- - **security:** close shell-injection, symlink-escape and SSRF-redirect holes (N1/N2/N6/N7/N17/N18/N19/N22/N23)
26
+ ## [2.67.0] - 2026-10-08
20
27
 
21
28
  ### Fixed
22
29
 
@@ -99,8 +106,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
106
 
100
107
  - **release:** add scripts/release.mts for one-command release prep (G4)
101
108
 
102
- ### Fixed
103
-
104
109
  - **reload:** include commands, run-task and attach-refs in hot-reload (G2)
105
110
 
106
111
  ### Changed
@@ -109,8 +114,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
109
114
 
110
115
  ## [2.65.1] - 2026-10-07
111
116
 
112
- ### Fixed
113
-
114
117
  - Long preview lines no longer create a horizontal scrollbar in the terminal:
115
118
  `toolCall`/`toolResult` (LineEditor and spinner) now clip the preview by the
116
119
  VISIBLE terminal width (`truncateToWidth`) instead of by character count. A
@@ -143,8 +146,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
143
146
  README) and the `docs/demo.tape` draft (the VHS render was never generated).
144
147
  `logo.jpg` was also removed from the `files` list in package.json.
145
148
 
146
- ### Fixed
147
-
148
149
  - Terminal repaint after a window resize: the relative erase `ESC[n A` after a
149
150
  size change landed on a stale row (the terminal re-flowed the wraps), so the
150
151
  status/input were drawn in the wrong place. After a resize the block is
@@ -191,8 +192,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
191
192
 
192
193
  ## [2.63.1] - 2026-10-06
193
194
 
194
- ### Fixed
195
-
196
195
  - Timer flicker in the pre-send pause status: `sendPause()` (both `LineEditor`
197
196
  and the non-TTY `SpinnerUI`) repainted the status WITHOUT the
198
197
  "elapsed"/task-badge tail, while the animation tick drew it WITH it — once a
@@ -377,8 +376,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
377
376
  - config, sessions and undo now share the single atomic writer (the
378
377
  temp-file+rename logic used to be copy-pasted in three places).
379
378
 
380
- ### Fixed
381
-
382
379
  - BACKLOG.md is now git-ignored and untracked: it is the agent's own
383
380
  improvement-notes file, rewritten constantly, and used to be published with
384
381
  the package.
@@ -415,8 +412,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
415
412
  - `npm run build` now wipes `dist/` first (`scripts/clean-dist.mjs`), so a
416
413
  removed source file no longer leaves an orphan `.js` in the package.
417
414
 
418
- ### Fixed
419
-
420
415
  - `/undo` failure reasons are localized: `src/undo.ts` returned hardcoded
421
416
  Russian strings that showed up in an English UI. It now returns machine codes
422
417
  ('empty' / 'disabled') localized by the caller.
@@ -451,8 +446,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
451
446
  (diff/apply) stays `.ts`-only.
452
447
  - `package.json` gained `packageManager: npm@11.19.0`.
453
448
 
454
- ### Fixed
455
-
456
449
  - The status line no longer prefixes a running-tool indicator with the
457
450
  previous answer's "done" phase (e.g. `✓ done: running Bash`): `toolCall()`
458
451
  clears the send-phase state before starting the tool animation.
@@ -488,8 +481,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
488
481
 
489
482
  ## [2.53.1]
490
483
 
491
- ### Fixed
492
-
493
484
  - `require('fs')` in ESM modules (`src/attachments.ts`, `src/self-review.ts`)
494
485
  threw `ReferenceError` at runtime: WSL clipboard detection always returned
495
486
  `false` and `/self-review` found no sources when run from the built `dist/`.
package/README.md CHANGED
@@ -19,7 +19,7 @@
19
19
  </p>
20
20
 
21
21
  <p align="center">
22
- <strong>English</strong> | <a href="https://github.com/Viqto0r/zames_pro/blob/master/README.ru.md">Русский</a>
22
+ <strong>English</strong> | <a href="#readme-ru">Русский</a>
23
23
  </p>
24
24
 
25
25
  A terminal coding agent that works on top of [chat.deepseek.com](https://chat.deepseek.com/) through Playwright.
@@ -486,6 +486,7 @@ first-party API client.
486
486
 
487
487
  MIT
488
488
 
489
+ <a id="readme-ru" name="readme-ru"></a>
489
490
  <details>
490
491
  <summary>🇷🇺 Читать по-русски (Russian)</summary>
491
492
 
package/dist/web.js CHANGED
@@ -222,7 +222,38 @@ async function getHeadless() {
222
222
  });
223
223
  return _headless;
224
224
  }
225
+ // ONE reused context for every render-fetch. Creating a fresh context per call
226
+ // (as before) re-allocated the user-agent/network stack each time, which is
227
+ // heavy for a series of render=true fetches. Pages are closed after each fetch,
228
+ // the context itself is reused and closed in closeWeb().
229
+ //
230
+ // The cache is a tiny pure factory so the reuse/reset behaviour can be unit-
231
+ // tested without launching a real browser.
232
+ export function createReusable(factory, dispose) {
233
+ let cached = null;
234
+ return {
235
+ async get() {
236
+ if (cached === null)
237
+ cached = await factory();
238
+ return cached;
239
+ },
240
+ async reset() {
241
+ if (cached === null)
242
+ return;
243
+ const v = cached;
244
+ cached = null;
245
+ await dispose(v).catch(() => { });
246
+ },
247
+ };
248
+ }
249
+ const _headlessCtxCache = createReusable(async () => {
250
+ const browser = await getHeadless();
251
+ return browser.newContext({
252
+ userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
253
+ });
254
+ }, (ctx) => ctx.close());
225
255
  export async function closeWeb() {
256
+ await _headlessCtxCache.reset();
226
257
  if (_headless) {
227
258
  try {
228
259
  await _headless.close();
@@ -232,10 +263,7 @@ export async function closeWeb() {
232
263
  }
233
264
  }
234
265
  async function renderWithHeadless(url, { timeout = DEFAULT_TIMEOUT } = {}) {
235
- const browser = await getHeadless();
236
- const ctx = await browser.newContext({
237
- userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
238
- });
266
+ const ctx = await _headlessCtxCache.get();
239
267
  const page = await ctx.newPage();
240
268
  try {
241
269
  // Validate the pre-redirect URL (page.goto follows redirects internally,
@@ -261,7 +289,8 @@ async function renderWithHeadless(url, { timeout = DEFAULT_TIMEOUT } = {}) {
261
289
  return { status, url: finalUrl, html };
262
290
  }
263
291
  finally {
264
- await ctx.close();
292
+ // Close the PAGE, not the shared context.
293
+ await page.close().catch(() => { });
265
294
  }
266
295
  }
267
296
  // ---------- tools ----------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.67.0",
3
+ "version": "2.67.1",
4
4
  "description": "Terminal coding agent that drives chat.deepseek.com through Playwright — no API key required. Reads and edits files, runs commands, commits to git, like Claude Code / Codex CLI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,7 +10,6 @@
10
10
  "dist",
11
11
  "scripts",
12
12
  "README.md",
13
- "README.ru.md",
14
13
  "CHANGELOG.md",
15
14
  "LICENSE",
16
15
  "logo-small.jpg"
@@ -2,10 +2,13 @@
2
2
  //
3
3
  // Why: npm renders exactly ONE readme per package (README.md in the root) and
4
4
  // has no language tabs, so a separate README.ru.md is invisible on the npm
5
- // page. But npm renders the readme with GitHub Flavored Markdown (via GitHub's
6
- // API), so a <details> block DOES work there -- and on GitHub too. We therefore
7
- // keep the English text on top and fold the other language into a collapsible
8
- // block at the bottom.
5
+ // page. But npm renders the readme with GitHub Flavored Markdown (via
6
+ // GitHub's API), so a <details> block DOES work there -- and on GitHub too.
7
+ // We therefore keep the English text on top and fold the other language into
8
+ // a collapsible block at the bottom. README.ru.md is generated too so the
9
+ // GitHub switcher can point at it directly, but it is NOT published to npm
10
+ // (see "files" in package.json):
11
+ // it would just duplicate the folded block.
9
12
  //
10
13
  // The two sources (docs/readme.en.md, docs/readme.ru.md) are the single point
11
14
  // of edit for each language; this script wires the switcher and the collapsible
@@ -13,7 +16,7 @@
13
16
  // generated files are committed; test/readme-built.test.ts re-runs buildReadmes()
14
17
  // and fails if they drift from the sources.
15
18
  //
16
- // Usage: node scripts/build-readme.mjs (or: npm run build:readme)
19
+ // Usage: npm run build:readme
17
20
 
18
21
  import fs from 'node:fs'
19
22
  import path from 'node:path'
@@ -23,17 +26,13 @@ const NL = String.fromCharCode(10)
23
26
  const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
24
27
  export const SWITCHER = '<!-- SWITCHER -->'
25
28
 
26
- const REPO = 'https://github.com/Viqto0r/zames_pro/blob/master'
29
+ // In-page anchor the switcher links to. GitHub strips `id` on some elements but
30
+ // keeps `name` on an <a>, so both are set.
31
+ export const RU_ANCHOR = '<a id="readme-ru" name="readme-ru"></a>'
32
+
27
33
  const EN_SWITCH = [
28
34
  '<p align="center">',
29
- ' <strong>English</strong> | <a href="' +
30
- REPO +
31
- '/README.ru.md">Русский</a>',
32
- '</p>',
33
- ].join(NL)
34
- const RU_SWITCH = [
35
- '<p align="center">',
36
- ' <a href="' + REPO + '/README.md">English</a> | <strong>Русский</strong>',
35
+ ' <strong>English</strong> | <a href="#readme-ru">Русский</a>',
37
36
  '</p>',
38
37
  ].join(NL)
39
38
 
@@ -71,50 +70,30 @@ function details(summary: string, body: string): string {
71
70
  ].join(NL)
72
71
  }
73
72
 
74
- function assemble(opts: {
75
- head: string
76
- switchLine: string
77
- body: string
78
- foldSummary: string
79
- foldBody: string
80
- }): string {
81
- const { head, switchLine, body, foldSummary, foldBody } = opts
82
- return [
83
- head,
84
- '',
85
- switchLine,
86
- '',
87
- body,
88
- '',
89
- details(foldSummary, foldBody),
90
- '',
91
- ].join(NL)
92
- }
93
-
94
73
  // Returns the two generated readmes WITHOUT touching the disk, so a test can
95
- // compare them against the committed files.
74
+ // compare them against the committed files. Both files carry the SAME content
75
+ // (English on top, Russian folded): README.md is what npm publishes, and
76
+ // README.ru.md exists only so the GitHub language switcher has a target. The
77
+ // switcher is an IN-PAGE `#readme-ru` anchor, so it works from either file
78
+ // without fetching the other one.
96
79
  export function buildReadmes(rootDir: string): {
97
80
  readmeEn: string
98
81
  readmeRu: string
99
82
  } {
100
83
  const en = readSource(rootDir, 'readme.en.md')
101
84
  const ru = readSource(rootDir, 'readme.ru.md')
102
- return {
103
- readmeEn: assemble({
104
- head: en.head,
105
- switchLine: EN_SWITCH,
106
- body: en.body,
107
- foldSummary: '🇷🇺 Читать по-русски (Russian)',
108
- foldBody: ru.body,
109
- }),
110
- readmeRu: assemble({
111
- head: ru.head,
112
- switchLine: RU_SWITCH,
113
- body: ru.body,
114
- foldSummary: '🇬🇧 Read in English',
115
- foldBody: en.body,
116
- }),
117
- }
85
+ const doc = [
86
+ en.head,
87
+ '',
88
+ EN_SWITCH,
89
+ '',
90
+ en.body,
91
+ '',
92
+ RU_ANCHOR,
93
+ details('🇷🇺 Читать по-русски (Russian)', ru.body),
94
+ '',
95
+ ].join(NL)
96
+ return { readmeEn: doc, readmeRu: doc }
118
97
  }
119
98
 
120
99
  // Run only when invoked directly (not when imported by a test).
package/README.ru.md DELETED
@@ -1,971 +0,0 @@
1
- <p align="center">
2
- <img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/logo-small.jpg" alt="zames logo" width="430">
3
- </p>
4
-
5
- <h1 align="center">zames_pro</h1>
6
-
7
- <p align="center">
8
- <strong>Терминальный coding-агент, который управляет chat.deepseek.com через Playwright — API-ключ не нужен.</strong>
9
- </p>
10
-
11
- <p align="center">
12
- <a href="https://www.npmjs.com/package/zames_pro"><img src="https://img.shields.io/npm/v/zames_pro.svg" alt="npm version"></a>
13
- <a href="https://www.npmjs.com/package/zames_pro"><img src="https://img.shields.io/npm/dm/zames_pro.svg" alt="npm downloads"></a>
14
- <a href="https://github.com/Viqto0r/zames_pro/actions/workflows/test.yml"><img src="https://github.com/Viqto0r/zames_pro/actions/workflows/test.yml/badge.svg" alt="tests"></a>
15
- <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
16
- <a href="package.json"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg" alt="Node.js"></a>
17
- <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-strict-3178c6.svg" alt="TypeScript"></a>
18
- <a href="CONTRIBUTING.md"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome"></a>
19
- </p>
20
-
21
- <p align="center">
22
- <a href="https://github.com/Viqto0r/zames_pro/blob/master/README.md">English</a> | <strong>Русский</strong>
23
- </p>
24
-
25
- Терминальный coding-агент, работающий поверх [chat.deepseek.com](https://chat.deepseek.com/) через Playwright.
26
- По духу он похож на Claude Code / Codex CLI: запускается в текущей
27
- директории, читает и правит файлы, выполняет команды и коммитит в git.
28
-
29
- > API-ключ не нужен — агент управляет веб-чатом DeepSeek как обычный
30
- > пользователь через настоящий (headless) браузер.
31
-
32
- <p align="center">
33
- <img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/demo.png" alt="сессия zames в терминале" width="860">
34
- </p>
35
-
36
- ## Быстрый старт
37
-
38
- ```bash
39
- npm install -g zames_pro # Chromium для Playwright скачается автоматически
40
- cd your-project # любая папка, в которой должен работать агент
41
- zames # один раз войти, дальше просто описывайте задачу
42
- ```
43
-
44
- Здесь **нет API-ключа и нет оплаты за токены**: zames входит в **ваш
45
- собственный аккаунт [chat.deepseek.com](https://chat.deepseek.com/)** в
46
- настоящем (headless) Chromium и управляет веб-чатом как обычный пользователь.
47
- При первом запуске он один раз спросит логин DeepSeek (сессия сохраняется в
48
- `~/.zames/profile`); после этого достаточно запустить `zames` и написать
49
- задачу обычным языком:
50
-
51
- ```text
52
- ❯ отрефактори загрузчик конфига и добавь тест на новый дефолт
53
- ```
54
-
55
- Пока агент работает, можно продолжать печатать — сообщение, отправленное
56
- посреди задачи, встанет в очередь и уйдёт сразу после неё, в тот же чат.
57
- `Esc` прерывает текущую генерацию, `/help` показывает команды, `/exit` — выход.
58
-
59
- ## Как это работает
60
-
61
- zames не вызывает API модели. Он запускает headless Chromium с постоянным
62
- профилем, входит в `chat.deepseek.com` как человек, печатает задачу в поле
63
- чата и читает ответ обратно.
64
-
65
- <p align="center">
66
- <img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/how-it-works.png" alt="как работает zames" width="860">
67
- </p>
68
-
69
- Словами: вы вводите задачу → zames отправляет системный промпт и задачу в
70
- веб-чат DeepSeek → модель отвечает → zames разбирает вызов инструмента,
71
- выполняет его локально, возвращает результат обратно и печатает финальный
72
- ответ.
73
-
74
- Ключевые детали:
75
-
76
- - **Ответ читается из сырого сетевого потока** (SSE), а не из отрендеренного
77
- DOM, поэтому JSON вызова инструмента с шаблонными строками и экранированием
78
- остаётся целым.
79
- - **Постоянный профиль** (`~/.zames/profile`) держит вас залогиненным;
80
- User-Agent headless-браузера подменяется, чтобы CDN DeepSeek не отдавал 403
81
- на вход.
82
- - **Троттлинг отправки** (15 с по умолчанию) щадит рейт-лимит веб-чата во
83
- время долгих прогонов с инструментами.
84
- - **Агент запесочен** в директорию запуска — ни один инструмент не может
85
- читать или писать выше неё.
86
-
87
- ## Содержание
88
-
89
- - [Быстрый старт](#быстрый-старт) · [Возможности](#возможности) · [Почему zames?](#почему-zames) · [Требования](#требования)
90
- - [Как это работает](#как-это-работает) · [Установка](#установка) · [Вход в аккаунт](#вход-в-аккаунт) · [Использование](#использование)
91
- - [Инструменты](#инструменты) · [Слэш-команды](#слэш-команды)
92
- - [Контекст проекта, навыки и память](#контекст-проекта-навыки-и-память) · [MCP (внешние инструменты)](#mcp-внешние-инструменты) · [Конфигурация](#конфигурация)
93
- - [FAQ](#faq) · [Ссылки](#ссылки) · [Лицензия](#лицензия)
94
-
95
- ## Возможности
96
-
97
- - **Инструменты как в Claude Code / Codex** — `Read`, `Write`, `Edit`, `Bash`,
98
- `Glob`, `Grep`, плюс `MultiEdit`, `ApplyPatch`, `LS`, `TodoWrite`, git- и
99
- веб-инструменты. Каждая правка подкреплена `/undo`.
100
- - **Работает, пока вы печатаете** — сообщения, набранные во время задачи,
101
- встают в очередь и уходят сразу после неё, в тот же чат (как набор текста
102
- во время генерации на сайте).
103
- - **Режим плана** — `/plan` (или `--plan`) убирает все мутирующие инструменты,
104
- чтобы агент изучал код, не трогая дерево.
105
- - **Контекст проекта** — читает `AGENTS.md`, `MEMORY.md`, навыки (`SKILL.md`) и
106
- пользовательские команды из репозитория и `~/.zames`, как в Codex / Claude
107
- Code.
108
- - **Поддержка MCP** — подключение внешних серверов инструментов (например,
109
- `@playwright/mcp`).
110
- - **Планировщик** — `/loop`, `/cron` и `/jobs` повторяют задачи по таймеру.
111
- - **Двуязычный интерфейс** — русский / английский (`/config lang`).
112
-
113
- ## Почему zames?
114
-
115
- - **Нет API-ключа и счёта за токены** — используется ваш собственный аккаунт
116
- чата DeepSeek, а не платный API. Удобно для долгих задач с инструментами.
117
- - **Тот же рабочий процесс, что в Claude Code / Codex** — инструменты,
118
- `AGENTS.md`, навыки, MCP и слэш-команды, так что всё знакомо с первого дня.
119
- - **Работает без присмотра** — headless по умолчанию, возобновляемые сессии,
120
- `/loop` и `/cron` для задач по расписанию.
121
- - **Local-first** — профиль браузера, учётные данные и логи не покидают вашу
122
- машину, а агент запесочен в директорию проекта.
123
-
124
- ## Требования
125
-
126
- - Node.js >= 20
127
- - Аккаунт DeepSeek. При первом запуске zames спросит логин/пароль DeepSeek в
128
- терминале (и сохранит их в `~/.zames/config.json` после успешного входа,
129
- поэтому более поздний разлогин обрабатывается автоматически, без повторных
130
- вопросов). Можно также войти вручную в окне браузера, когда он headed.
131
-
132
- ## Вход в аккаунт
133
-
134
- Браузер по умолчанию работает **headless**. Когда DeepSeek требует входа,
135
- zames:
136
-
137
- 1. переиспользует сессию из постоянного профиля (`~/.zames/profile`), если она
138
- ещё валидна;
139
- 2. иначе входит автоматически по сохранённым учётным данным
140
- (`browser.auth.username` / `browser.auth.password`);
141
- 3. иначе спрашивает логин/пароль в терминале (в TTY) и после успешного входа
142
- запоминает их для следующего раза;
143
- 4. иначе показывает подсказку про ручной вход.
144
-
145
- Чтобы войти руками (например, если DeepSeek показывает капчу), запустите с
146
- видимым окном:
147
-
148
- ```bash
149
- zames --headed
150
- ```
151
-
152
- Флаг `--headless` (значение по умолчанию) и `headless: true` в конфиге держат
153
- браузер без окна; `--headed` / `headless: false` показывают его.
154
-
155
- Headless работает из коробки: headless Chrome обычно представляется как
156
- `HeadlessChrome/...`, и CDN DeepSeek блокирует такой User-Agent ответом 403,
157
- поэтому zames срезает этот маркер перед загрузкой страницы (сохраняя реальную
158
- версию движка). `--headed` нужен не только ради входа.
159
-
160
- Учётные данные и переключатели можно также править из `/config`
161
- (`browser.auth.username`, `browser.auth.password`, `browser.auth.saveSession`).
162
-
163
- ## Установка
164
-
165
- ```bash
166
- npm install -g zames_pro
167
- ```
168
-
169
- Chromium для Playwright скачивается автоматически при установке. На Linux/WSL
170
- необходимые системные библиотеки тоже ставятся, если доступен `sudo` без
171
- пароля; иначе выполните один раз вручную:
172
-
173
- ```bash
174
- npx playwright install chromium
175
- sudo npx playwright install-deps chromium
176
- ```
177
-
178
- ## Использование
179
-
180
- Перейдите в папку проекта и запустите:
181
-
182
- ```bash
183
- zames
184
- ```
185
-
186
- Агент работает внутри директории, из которой он запущен, и не может её покинуть (песочница).
187
-
188
- Пока агент работает, можно продолжать печатать: Enter ставит сообщение в
189
- очередь (оно уйдёт сразу после текущей задачи, в тот же чат), а Esc / Ctrl+C
190
- прерывают текущую генерацию. Это повторяет набор текста во время генерации на
191
- сайте DeepSeek.
192
-
193
- ### Строка ввода
194
-
195
- Промпт — это небольшой редактор строки с постоянной историей:
196
-
197
- - `↑` / `↓` — переход по истории сообщений (сохраняется в
198
- `~/.zames/history.json`, поэтому переживает перезапуск); внутри
199
- многострочного сообщения стрелки двигают по строкам.
200
- - `Ctrl+R` — инкрементальный поиск по истории в обратном порядке (как в bash):
201
- печатайте для фильтра, `Ctrl+R` — за более старыми совпадениями, `Enter` —
202
- принять, `Esc` — отменить.
203
- - `Ctrl+_` — отменить последнюю правку строки ввода (случайно нажатые
204
- `Ctrl+U` / `Ctrl+K` можно вернуть).
205
- - `Ctrl+U` — очистить строку, `Ctrl+K` — удалить до конца строки, `Ctrl+W` —
206
- удалить слово перед курсором, `Ctrl+←`/`Ctrl+→` — переход по словам.
207
- - `\` + `Enter`, `Ctrl+J`, `Ctrl+Enter` или `Shift+Enter` — вставить новую
208
- строку.
209
- - `/` + `Tab` — подсказки и автодополнение слэш-команд.
210
- - `!команда` — выполнить shell-команду напрямую, минуя модель (как bash-режим
211
- Claude Code). Действует та же песочница, что и для инструмента `Bash`, так
212
- что прямая команда тоже не может выйти за пределы проекта.
213
-
214
- Установите `NO_COLOR=1`, чтобы отключить цвета (иначе используется спокойная
215
- палитра по умолчанию).
216
-
217
- ### Картинки и файлы
218
-
219
- В строку ввода можно вставить картинку или файл (Ctrl+Shift+V / Shift+Insert
220
- или собственной вставкой терминала). zames сохраняет его в `<project>/tmp` и
221
- показывает маркер в строке — `[image#1]` для картинок, `[file#1]` для прочих
222
- файлов — затем загружает реальный файл в чат вместе с вашим сообщением. Это те
223
- же форматы, что принимает веб-чат DeepSeek (PNG, JPEG, GIF, WEBP, BMP, SVG и
224
- обычные типы документов).
225
-
226
- Вставка картинки работает, когда терминал передаёт её как `data:` URL или как
227
- base64-блок с узнаваемой сигнатурой изображения. Можно также вставить путь к
228
- локальному файлу (перетащите файл в терминал или скопируйте его путь); если
229
- файл существует — он прикрепляется, иначе текст вставляется как обычно.
230
-
231
- Нажмите Ctrl+V (или сделайте пустую вставку), и zames прочитает картинку прямо
232
- из буфера обмена: Linux через wl-paste (Wayland) или xclip/xsel (X11), macOS
233
- через pngpaste, Windows через PowerShell. Нужные Linux-утилиты ставятся
234
- автоматически при `npm install` (best-effort, через определённый пакетный
235
- менеджер). Если картинка не найдена, zames сообщит об этом и напишет, какой
236
- инструмент пробовал, вместо молчания.
237
-
238
- ### Опции
239
-
240
- ```
241
- zames --task <текст задачи>
242
- zames --chat <id>
243
- zames --new-chat
244
- zames --resend-prompt
245
- zames --dir <path>
246
- zames --headless
247
- zames --headed
248
- zames --plan
249
- zames --output-format jsonl
250
- zames --debug
251
- zames --version
252
- zames --help
253
- ```
254
-
255
- ### Машиночитаемый вывод (скрипты / CI)
256
-
257
- Для одноразовых запусков (`--task`) агент может выдавать поток событий как JSON
258
- lines в stdout, оставляя весь человеческий текст в stderr:
259
-
260
- ```bash
261
- zames --task "summarize the diff" --output-format jsonl
262
- ```
263
-
264
- Каждая строка — одно событие (`tool_call`, `tool_result`, `assistant_final`, …),
265
- так что это сразу пайпится в `jq`:
266
-
267
- ```bash
268
- zames --task "..." --output-format jsonl \
269
- | jq -r 'select(.type=="assistant_final") | .message'
270
- ```
271
-
272
- ## Инструменты
273
-
274
- У агента тот же стиль инструментов, что в Claude Code / Codex CLI:
275
-
276
- - **Файловые** — `Read`, `Write`, `Edit`, `Bash`, `Glob`, `Grep`. `Read` по
277
- умолчанию отдаёт сырое содержимое; передайте `numbered=true`, чтобы получить
278
- нумерацию строк в стиле `cat -n` (только для справки — не вставляйте её в
279
- `Edit`).
280
- - **Дополнительные** — `LS` (список директории), `MultiEdit` (несколько правок
281
- одного файла атомарно), `TodoWrite` (чек-лист задач сессии), `ApplyPatch`
282
- (мультифайловый патч в формате V4A от Codex: `*** Begin Patch` … `*** End Patch`).
283
- - **Git** — `GitStatus`, `GitDiff`, `GitLog`, `GitShow`, `GitBranchList`,
284
- `GitAdd`, `GitCommit`, `GitPush`.
285
- - **Web** — `WebFetch`, `WebSearch`.
286
- - **Служебный** — `respond` (финальный ответ оператору, завершает задачу).
287
-
288
- Все файловые инструменты остаются внутри рабочей директории (песочница).
289
- `Write`/`Edit` и `MultiEdit`/`ApplyPatch` делают резервную копию (undo) перед
290
- изменением файла.
291
-
292
- ## Слэш-команды
293
-
294
- Введите / в промпте для подсказок (Tab дополняет). Кроме команд сессии и
295
- конфига (/new, /chats, /resume, /cd, /status, /config, /undo, /transcript,
296
- /mcp, /skills, /memory, /init, /reload, /debug-dom, /help, /exit) есть
297
- несколько в духе Claude Code / Codex CLI:
298
-
299
- - /diff [--staged] — показать git-диф рабочего дерева (--staged для индекса).
300
- - /diffstat — сводка изменений одной строкой (`git diff --stat`).
301
- - /context — показать, что загружено в промпт (AGENTS.md, MEMORY.md, навыки,
302
- пользовательские команды) и размер системного промпта.
303
- - /retry — отправить последнюю задачу в тот же чат заново (удобно после
304
- обрезанного или пустого ответа).
305
- - /rename <title> — задать заголовок текущей сессии (виден в /sessions).
306
- - /copy — скопировать последний ответ ассистента в буфер обмена ОС.
307
- - /cost (алиас /usage) — статистика сессии: задачи, вызовы инструментов,
308
- длительность и размер контекста в токенах (DeepSeek
309
- `accumulated_token_usage`).
310
- - /export [file] — записать транскрипт сессии в Markdown-файл
311
- (по умолчанию zames-export-<stamp>.md).
312
- - /doctor — диагностика node, git, конфига, браузера, буфера обмена и MCP.
313
- - /add-dir <path> — проверить дополнительную директорию (песочница
314
- фиксируется при старте; для записи туда перезапустите с --dir).
315
- - /resume <n> (после /chats) и /resume-id <id> — открыть чат и НАПЕЧАТАТЬ его
316
- диалог в терминал, чтобы восстановленный контекст был виден. Показываются
317
- только последние 20 сообщений (`RESTORED_HISTORY_LIMIT`). /last открывает
318
- последний чат текущей директории без поиска; /sessions показывает сохранённые
319
- сессии с их относительным возрастом.
320
- - /help <command> — полное описание одной команды (например, `/help diff`)
321
- вместо всего списка.
322
- - /review [focus] [--staged] — попросить агента проверить незакоммиченные
323
- изменения и сообщить находки (без правок кода).
324
- - /plan [on|off] — режим плана (только чтение). Пока он включён, мутирующие
325
- инструменты (Write/Edit/MultiEdit/ApplyPatch/Bash, GitAdd/GitCommit/GitPush)
326
- убраны из набора, чтобы агент изучал код, не трогая дерево. Стартовать в нём
327
- можно с `--plan`.
328
- - /compact — попросить DeepSeek сжать текущий чат в передаточное резюме, затем
329
- открыть НОВЫЙ чат, заново отправить системный промпт и положить резюме как
330
- перенесённый контекст. Используйте, когда контекст разрастается.
331
- - /goal [text|clear] — задать долгоживущую цель сессии. Она добавляется в
332
- начало каждого сообщения задачи, поэтому модель держит общую картину через
333
- много ходов. Хранится в `<project>/.zames-goal` (git-ignored) и
334
- восстанавливается при следующем запуске.
335
- - /loop <interval> <task> — повторять задачу периодически (например,
336
- `/loop 10m run the tests`). /cron "<min> <hour> <dom> <month> <dow>" <task> —
337
- запуск по расписанию. /jobs [rm <id>|clear] перечисляет и останавливает их.
338
- Сработавшая задача попадает в ту же очередь сообщений, что и ваш ввод, так
339
- что выполняется, когда агент свободен (никогда посреди генерации), и всё
340
- равно соблюдает троттлинг отправки.
341
- - /thinking [on|off] и /web [on|off] — переключить Deep thinking / Smart search.
342
- Их (а также /queue, /jobs, /goal, `/config <sub>`) можно использовать, ПОКА
343
- агент работает — они не трогают текущую генерацию.
344
- - /queue [clear] — показать или очистить сообщения, ждущие отправки после
345
- текущей задачи.
346
-
347
- Контекст в токенах показывается и вживую: в строке статуса над вводом слева
348
- спиннер/текст, справа — контекст (например, `125k · 13%`, процент от 1M
349
- контекста). Он ОКРАШЕН по уровню заполнения: зелёный ниже 50%, жёлтый 50-80%,
350
- красный выше 80%. Значение приходит из DeepSeek `accumulated_token_usage` и
351
- скрыто до первого ответа.
352
-
353
- ## Контекст проекта, навыки и память
354
-
355
- Как в Codex / Claude Code, zames читает инструкции проекта и переиспользуемые
356
- процессы из вашего репозитория и из `~/.zames`.
357
-
358
- - **AGENTS.md** — инструкции проекта. Положите его в корень репозитория (или в
359
- любую родительскую папку рабочей директории). Глобальные инструкции живут в
360
- `~/.zames/AGENTS.md` (и `~/.claude/CLAUDE.md`). Запустите `/init`, и агент
361
- изучит проект и напишет AGENTS.md на основе реальных команд сборки/тестов и
362
- соглашений (`/init --force` перезапишет существующий файл).
363
- - **MEMORY.md** — долговечные заметки, переживающие сессии. Агент дописывает
364
- сюда полезные факты; можно править вручную или добавить из промпта через
365
- `/remember <text>`.
366
- - **Навыки** — папка с файлом `SKILL.md` (YAML-фронтматтер: `name`,
367
- `description`, опционально `allowed-tools`, `user-invokable`) плюс любые
368
- вспомогательные файлы. Ищутся в `.zames/skills/`, `.claude/skills/`,
369
- `.agents/skills/`, `skills/` и `~/.zames/skills/`. Агент читает тело только
370
- когда задача совпадает с описанием. Список — `/skills`; вызов —
371
- `/<skill-name>`.
372
- - **Пользовательские команды** — `.md`-файлы в `.zames/commands/` (или
373
- `.claude/commands/`). Поддерживают подстановки `$ARGUMENTS` / `{{args}}` и
374
- вызываются как `/<command-name>`.
375
-
376
- Навыки и пользовательские команды видны в списке автодополнения «/» и в
377
- `/help`.
378
-
379
- ```
380
- /skills список найденных навыков
381
- /memory показать действующие AGENTS.md / MEMORY.md
382
- /remember <text> дописать долговечную заметку в MEMORY.md
383
- /init [--force] проанализировать проект и создать AGENTS.md
384
- ```
385
-
386
- ## MCP (внешние инструменты)
387
-
388
- zames может использовать инструменты с серверов [MCP](https://modelcontextprotocol.io).
389
- Главный пример — @playwright/mcp: он даёт агенту настоящий браузер
390
- (navigate, click, snapshot, type, ...) поверх того, который zames уже
391
- использует для чата DeepSeek.
392
-
393
- Положите файл конфига (той же формы, что в Claude Code / Cursor):
394
-
395
- - `~/.zames/mcp.json` — глобальный
396
- - `<project>/.zames/mcp.json` — на уровне проекта (поздние файлы побеждают)
397
- - `<project>/.mcp.json` — привычное имя MCP
398
-
399
- ```json
400
- {
401
- "mcpServers": {
402
- "playwright": {
403
- "command": "npx",
404
- "args": ["-y", "@playwright/mcp@latest", "--headless", "--isolated"]
405
- }
406
- }
407
- }
408
- ```
409
-
410
- ВАЖНО: держите MCP-браузер изолированным. @playwright/mcp по умолчанию
411
- использует ТУ ЖЕ директорию профиля, что и zames (~/.zames/profile). Если
412
- запустить его без --isolated (или без собственного --user-data-dir),
413
- MCP-браузер и браузер агента подерутся за один профиль, и чат DeepSeek
414
- покажет «Something went wrong when opening your profile». Всегда передавайте
415
- --isolated, как в примере выше.
416
- Серверы бывают и удалёнными ("url": "https://...", "transport": "sse").
417
- Их инструменты видны агенту как `server__tool` (например,
418
- `playwright__browser_navigate`) и перечисляются в `/mcp` и `/status`.
419
- Сервер, который не смог подключиться, пропускается с предупреждением и
420
- никогда не роняет агента.
421
-
422
- ## Конфигурация
423
-
424
- Глобальный конфиг: `~/.zames/config.json`
425
- Локальный (на проект): `.zamesrc.json`
426
-
427
- Просматривать и менять настройки можно не выходя из агента — командой
428
- `/config`. Запустите её без аргументов, чтобы открыть интерактивное меню
429
- (↑/↓ — навигация, Enter — изменение, `d` — сброс, `q` — выход). Булевы и
430
- enum переключаются на месте; числа и строки открывают ввод.
431
-
432
- ```
433
- /config интерактивное меню настроек
434
- /config list показать все изменяемые настройки
435
- /config get <path> показать настройку
436
- /config set <path> <value> изменить настройку
437
- /config reset <path> сбросить настройку к дефолту
438
- /config path показать пути файлов конфига
439
- /config lang <ru|en> переключить язык интерфейса и агента
440
- ```
441
-
442
- Примеры:
443
-
444
- ```
445
- /config set maxIterations 20
446
- /config set browser.deepThinking true # DeepSeek Deep thinking (медленно; рассуждения скрыты)
447
- /config set browser.webSearch false # DeepSeek Smart web search
448
- /config lang en
449
- ```
450
-
451
- Изменения пишутся в проектный `.zamesrc.json` и применяются сразу (где это
452
- возможно без перезапуска).
453
-
454
- ### Язык
455
-
456
- `/config lang ru` или `/config lang en` переключает и язык интерфейса
457
- (справка, сообщения, спиннер), и язык, на котором агент вам отвечает. Локаль
458
- хранится в `ui.locale` в файле конфига.
459
-
460
- Данные агента хранятся в `~/.zames`: профиль браузера, логи, история undo,
461
- сессии.
462
-
463
- ## FAQ
464
-
465
- **Это официальный продукт DeepSeek?**
466
- Нет. zames управляет публичным веб-интерфейсом chat.deepseek.com через
467
- настоящий браузер, как обычный пользователь. Он не связан с DeepSeek.
468
-
469
- **Нужен ли API-ключ?**
470
- Нет. Вы один раз входите в свой аккаунт DeepSeek; сессия хранится в
471
- `~/.zames/profile` и переиспользуется.
472
-
473
- **Какую модель он использует?**
474
- Ту, которую использует веб-чат DeepSeek (DeepSeek-V3 или reasoning-модель при
475
- включённом «Deep thinking»). zames никогда не вызывает API напрямую.
476
-
477
- **Работает ли headless / на сервере?**
478
- Да — headless по умолчанию, а `--output-format jsonl` делает его скриптуемым.
479
- `--headed` нужен только для ручного входа или отладки селекторов.
480
-
481
- **Разрешена ли автоматизация веб-интерфейса?**
482
- Это зависит от условий DeepSeek; автоматизация сайта может их нарушать.
483
- Используйте на свой риск и держите троттлинг отправки (15 с по умолчанию),
484
- чтобы не бить по рейт-лимиту.
485
-
486
- **Чем отличается от Claude Code / Codex?**
487
- Та же форма (инструменты, `AGENTS.md`, навыки, MCP, слэш-команды), но работает
488
- на вашем аккаунте DeepSeek вместо API, как автоматизация браузера, а не
489
- first-party API-клиент.
490
-
491
- ## Ссылки
492
-
493
- - **npm:** <https://www.npmjs.com/package/zames_pro>
494
- - **GitHub:** <https://github.com/Viqto0r/zames_pro>
495
- - **Changelog:** [`CHANGELOG.md`](CHANGELOG.md)
496
- - **Contributing:** [`CONTRIBUTING.md`](CONTRIBUTING.md)
497
- - **Security policy:** [`SECURITY.md`](SECURITY.md)
498
- - **Code of conduct:** [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md)
499
-
500
- ## Лицензия
501
-
502
- MIT
503
-
504
- <details>
505
- <summary>🇬🇧 Read in English</summary>
506
-
507
- A terminal coding agent that works on top of [chat.deepseek.com](https://chat.deepseek.com/) through Playwright.
508
- In spirit it is similar to Claude Code / Codex CLI: it starts in the current
509
- directory, reads and edits files, runs commands, and commits to git.
510
-
511
- > No API key required — it drives the DeepSeek web chat like a regular user
512
- > through a real (headless) browser.
513
-
514
- <p align="center">
515
- <img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/demo.png" alt="zames session in the terminal" width="860">
516
- </p>
517
-
518
- ## Quick start
519
-
520
- ```bash
521
- npm install -g zames_pro # Chromium for Playwright is downloaded automatically
522
- cd your-project # any folder the agent should work in
523
- zames # sign in once, then describe your task
524
- ```
525
-
526
- There is **no API key and no per-token bill**: zames signs in to **your own
527
- [chat.deepseek.com](https://chat.deepseek.com/) account** in a real (headless)
528
- Chromium and drives the web chat like a regular user. The first launch asks for
529
- your DeepSeek login once (the session is stored in `~/.zames/profile`); after
530
- that just run `zames` and type a task in plain language:
531
-
532
- ```text
533
- ❯ refactor the config loader and add a test for the new default
534
- ```
535
-
536
- While the agent works you can keep typing — a message sent mid-task is queued
537
- and runs right after it, in the same chat. `Esc` aborts the current generation,
538
- `/help` lists commands, `/exit` quits.
539
-
540
- ## How it works
541
-
542
- zames does not call the model API. It launches a headless Chromium with a
543
- persistent profile, signs in to `chat.deepseek.com` like a human, types the task
544
- into the chat box, and reads the answer back.
545
-
546
- <p align="center">
547
- <img src="https://raw.githubusercontent.com/Viqto0r/zames_pro/master/docs/how-it-works.png" alt="how zames works" width="860">
548
- </p>
549
-
550
- In text: you type a task → zames sends the system prompt plus the task into
551
- the DeepSeek web chat → the model answers → zames parses the tool call, runs
552
- the tool locally, feeds the result back, and prints the final answer for you.
553
-
554
- Key pieces:
555
-
556
- - **The answer is read from the raw network stream** (SSE), not the rendered
557
- DOM, so tool-call JSON with template strings and escapes survives intact.
558
- - **A persistent profile** (`~/.zames/profile`) keeps you signed in; the
559
- headless User-Agent is patched so DeepSeek's CDN does not 403 the login.
560
- - **A send throttle** (15 s by default) keeps the web chat's rate limit happy
561
- during long tool-heavy runs.
562
- - **The agent is sandboxed** to the directory it was started in — no tool can
563
- read or write above it.
564
-
565
- ## Table of contents
566
-
567
- - [Quick start](#quick-start) · [Features](#features) · [Why zames?](#why-zames) · [Requirements](#requirements)
568
- - [How it works](#how-it-works) · [Installation](#installation) · [Signing in](#signing-in) · [Usage](#usage)
569
- - [Tools](#tools) · [Slash commands](#slash-commands)
570
- - [Project context, skills and memory](#project-context-skills-and-memory) · [MCP (external tools)](#mcp-external-tools) · [Configuration](#configuration)
571
- - [FAQ](#faq) · [Links](#links) · [License](#license)
572
-
573
- ## Features
574
-
575
- - **Tools like Claude Code / Codex** — `Read`, `Write`, `Edit`, `Bash`,
576
- `Glob`, `Grep`, plus `MultiEdit`, `ApplyPatch`, `LS`, `TodoWrite`, git and web
577
- tools. Every edit is backed by `/undo`.
578
- - **Runs while you keep typing** — queue messages during a task; they run right
579
- after it, in the same chat (like typing during generation on the web).
580
- - **Plan mode** — `/plan` (or `--plan`) drops all mutating tools, so the agent
581
- can investigate the code without touching the tree.
582
- - **Project context** — reads `AGENTS.md`, `MEMORY.md`, skills (`SKILL.md`) and
583
- custom commands from the repo and `~/.zames`, the same idea as Codex / Claude
584
- Code.
585
- - **MCP support** — plug in external tool servers (e.g. `@playwright/mcp`).
586
- - **Scheduling** — `/loop`, `/cron` and `/jobs` repeat tasks on a timer.
587
- - **Bilingual UI** — Russian / English (`/config lang`).
588
-
589
- ## Why zames?
590
-
591
- - **No API key, no per-token bill** — it uses your own DeepSeek chat account,
592
- not the paid API. Good for long, tool-heavy tasks.
593
- - **Same workflow as Claude Code / Codex** — tools, `AGENTS.md`, skills, MCP
594
- and slash commands, so it feels familiar from day one.
595
- - **Runs unattended** — headless by default, resumable sessions, and `/loop`
596
- plus `/cron` for scheduled work.
597
- - **Local-first** — the browser profile, credentials and logs never leave your
598
- machine, and the agent is sandboxed to the project directory.
599
-
600
- ## Requirements
601
-
602
- - Node.js >= 20
603
- - A DeepSeek account. On first launch zames asks for your DeepSeek
604
- login/password in the terminal (and stores them in `~/.zames/config.json`
605
- after a successful sign-in, so a later logout is handled automatically
606
- without asking you again). You can also sign in manually in the browser
607
- window when the browser is headed.
608
-
609
- ## Signing in
610
-
611
- The browser runs **headless by default**. When DeepSeek requires a sign-in,
612
- zames:
613
-
614
- 1. reuses the session stored in the persistent profile (`~/.zames/profile`)
615
- if it is still valid;
616
- 2. otherwise signs in automatically with the saved credentials
617
- (`browser.auth.username` / `browser.auth.password`);
618
- 3. otherwise asks you for the login/password in the terminal (in a TTY) and,
619
- after a successful sign-in, remembers them for next time;
620
- 4. otherwise falls back to a manual sign-in hint.
621
-
622
- To sign in by hand (for example, if DeepSeek shows a captcha), run with a
623
- visible window:
624
-
625
- ```bash
626
- zames --headed
627
- ```
628
-
629
- The `--headless` flag (the default) and `headless: true` in the config keep
630
- the browser without a window; `--headed` / `headless: false` show it.
631
-
632
- Headless works out of the box: a headless Chrome normally advertises a
633
- `HeadlessChrome/...` User-Agent that DeepSeek's CDN blocks with a 403, so
634
- zames strips that marker before loading the page (keeping the real engine
635
- version). You do not need `--headed` just to log in.
636
-
637
- Credentials and toggles can also be edited from `/config`
638
- (`browser.auth.username`, `browser.auth.password`, `browser.auth.saveSession`).
639
-
640
- ## Installation
641
-
642
- ```bash
643
- npm install -g zames_pro
644
- ```
645
-
646
- Chromium for Playwright is downloaded automatically on install. On Linux/WSL
647
- the required system libraries are installed too when passwordless `sudo` is
648
- available; otherwise run once by hand:
649
-
650
- ```bash
651
- npx playwright install chromium
652
- sudo npx playwright install-deps chromium
653
- ```
654
-
655
- ## Usage
656
-
657
- Go to your project folder and run:
658
-
659
- ```bash
660
- zames
661
- ```
662
-
663
- The agent works inside the directory it was started in and cannot leave it (sandbox).
664
-
665
- While the agent is working you can keep typing: press Enter to queue a message
666
- (it is sent right after the current task, in the same chat), or Esc / Ctrl+C to
667
- abort the current generation. This mirrors typing during generation on the
668
- DeepSeek website.
669
-
670
- ### Input line
671
-
672
- The prompt is a small line editor with persistent history:
673
-
674
- - `↑` / `↓` — walk the message history (saved in `~/.zames/history.json`, so it
675
- survives a restart); inside a multiline message the arrows move between lines.
676
- - `Ctrl+R` — incremental reverse search over the history (bash-style): type to
677
- filter, `Ctrl+R` for older matches, `Enter` to accept, `Esc` to cancel.
678
- - `Ctrl+_` — undo the last edit in the input line (a fat-fingered `Ctrl+U` /
679
- `Ctrl+K` is recoverable).
680
- - `Ctrl+U` — clear the line, `Ctrl+K` — delete to end of line, `Ctrl+W` —
681
- delete the word before the cursor, `Ctrl+←`/`Ctrl+→` — move by words.
682
- - `\` + `Enter`, `Ctrl+J`, `Ctrl+Enter` or `Shift+Enter` — insert a newline.
683
- - `/` + `Tab` — slash-command hints and completion.
684
- - `!command` — run a shell command directly, bypassing the model (like
685
- Claude Code's bash mode). The same sandbox guard as the `Bash` tool applies,
686
- so a direct command cannot leave the project either.
687
-
688
- Set `NO_COLOR=1` to disable colors (a calm default palette is used otherwise).
689
-
690
- ### Images and files
691
-
692
- You can paste an image or a file into the input line (Ctrl+Shift+V / Shift+Insert
693
- or the terminal's own paste). zames saves it under `<project>/tmp` and shows a
694
- marker in the line - `[image#1]` for images, `[file#1]` for other files - then
695
- uploads the real file to the chat together with your message. These are the
696
- same formats the DeepSeek web chat accepts (PNG, JPEG, GIF, WEBP, BMP, SVG and
697
- the usual document types).
698
-
699
- Pasting an image works when the terminal sends it as a `data:` URL or as a
700
- base64 blob with a recognizable image signature. You can also paste a path to a
701
- local file (drag a file into the terminal or copy its path); if the file exists
702
- it is attached, otherwise the text is inserted as usual.
703
-
704
- Press Ctrl+V (or use an empty paste) and zames reads the image straight from
705
- the clipboard: Linux via wl-paste (Wayland) or xclip/xsel (X11), macOS
706
- via pngpaste, Windows via PowerShell. The needed Linux tools are installed
707
- automatically on npm install (best-effort, through the detected package
708
- manager). If no image is found, zames says so and reports which tool it tried,
709
- instead of staying silent.
710
-
711
- ### Options
712
-
713
- ```
714
- zames --task <task text>
715
- zames --chat <id>
716
- zames --new-chat
717
- zames --resend-prompt
718
- zames --dir <path>
719
- zames --headless
720
- zames --headed
721
- zames --plan
722
- zames --output-format jsonl
723
- zames --debug
724
- zames --version
725
- zames --help
726
- ```
727
-
728
- ### Machine-readable output (scripts / CI)
729
-
730
- For one-shot runs (`--task`) the agent can emit its event stream as JSON lines
731
- on stdout, keeping all human text on stderr:
732
-
733
- ```bash
734
- zames --task "summarize the diff" --output-format jsonl
735
- ```
736
-
737
- Each line is one event (`tool_call`, `tool_result`, `assistant_final`, ...), so
738
- it pipes straight into `jq`:
739
-
740
- ```bash
741
- zames --task "..." --output-format jsonl \
742
- | jq -r 'select(.type=="assistant_final") | .message'
743
- ```
744
-
745
- ## Tools
746
-
747
- The agent has the same style of tools as Claude Code / Codex CLI:
748
-
749
- - **File tools** — `Read`, `Write`, `Edit`, `Bash`, `Glob`, `Grep`. `Read`
750
- returns raw content by default; pass `numbered=true` to get `cat -n`-style
751
- line numbers (for reference only — do not paste them into `Edit`).
752
- - **Extra tools** — `LS` (list a directory), `MultiEdit` (several edits to one
753
- file applied atomically), `TodoWrite` (session task checklist), `ApplyPatch`
754
- (multi-file patch in Codex's V4A format: `*** Begin Patch` … `*** End Patch`).
755
- - **Git** — `GitStatus`, `GitDiff`, `GitLog`, `GitShow`, `GitBranchList`,
756
- `GitAdd`, `GitCommit`, `GitPush`.
757
- - **Web** — `WebFetch`, `WebSearch`.
758
- - **Service** — `respond` (final answer to the operator, ends the task).
759
-
760
- All file tools stay inside the working directory (sandbox). `Write`/`Edit` and
761
- `MultiEdit`/`ApplyPatch` make a backup (undo) before touching a file.
762
-
763
- ## Slash commands
764
-
765
- Type / in the prompt for hints (Tab completes). Besides the session and
766
- config commands (/new, /chats, /resume, /cd, /status, /config,
767
- /undo, /transcript, /mcp, /skills, /memory, /init, /reload,
768
- /debug-dom, /help, /exit) there are a few that mirror Claude Code /
769
- Codex CLI:
770
-
771
- - /diff [--staged] — show the working-tree git diff (--staged for the index).
772
- - /diffstat — a one-line change summary (`git diff --stat`).
773
- - /context — show what is loaded into the prompt (AGENTS.md, MEMORY.md,
774
- skills, custom commands) and the system-prompt size.
775
- - /retry — resend the last task into the same chat (handy after a truncated
776
- or empty answer).
777
- - /rename <title> — set the current session title (shown in /sessions).
778
- - /copy — copy the last assistant answer to the OS clipboard.
779
- - /cost (alias /usage) — session stats: tasks, tool calls, duration, and the
780
- context size in tokens (DeepSeek's `accumulated_token_usage`).
781
- - /export [file] — write the session transcript to a Markdown file
782
- (zames-export-<stamp>.md by default).
783
- - /doctor — diagnose node, git, config, browser, clipboard and MCP.
784
- - /add-dir <path> — validate an extra directory (the sandbox is fixed at
785
- startup; relaunch with --dir to write there).
786
- - /resume <n> (after /chats) and /resume-id <id> — open a chat and PRINT its
787
- dialogue into the terminal, so the restored context is visible. Only the
788
- last 20 messages are shown (`RESTORED_HISTORY_LIMIT`). /last reopens the last
789
- chat of the current directory with no lookup step; /sessions shows the saved
790
- sessions with their relative age.
791
- - /help <command> — the full description of a single command (e.g. `/help diff`)
792
- instead of the whole list.
793
- - /review [focus] [--staged] — ask the agent to review uncommitted changes
794
- and report findings (no code changes).
795
- - /plan [on|off] — plan (read-only) mode. While it is on, the mutating tools
796
- (Write/Edit/MultiEdit/ApplyPatch/Bash, GitAdd/GitCommit/GitPush) are removed
797
- from the tool set, so the agent can investigate without touching the tree.
798
- Start in it with `--plan`.
799
- - /compact — ask DeepSeek to compress the current chat into a handover
800
- summary, then open a NEW chat, resend the system prompt and post the summary
801
- as the carried-over context. Use it when the context gets long.
802
- - /goal [text|clear] — set a long-lived session goal. It is prepended to every
803
- task message, so the model keeps the big picture across many turns. Stored in
804
- `<project>/.zames-goal` (git-ignored) and restored on the next launch.
805
- - /loop <interval> <task> — repeat a task periodically (e.g. `/loop 10m run the
806
- tests`). /cron "<min> <hour> <dom> <month> <dow>" <task> — run on a schedule.
807
- /jobs [rm <id>|clear] lists and stops them. A fired job is put into the same
808
- message queue you type into, so it runs when the agent is free (never mid-
809
- generation) and still respects the send throttle.
810
- - /thinking [on|off] and /web [on|off] — toggle Deep thinking / Smart search.
811
- These (and /queue, /jobs, /goal, `/config <sub>`) can be used WHILE the agent
812
- is working — they do not touch the in-flight generation.
813
- - /queue [clear] — list or clear the messages waiting to be sent after the
814
- current task.
815
-
816
- The token context is also shown live: the status line above the input has the
817
- spinner/text on the left and the context on the right (e.g. `125k · 13%`,
818
- percent of a 1M context). It is COLORED by fill level: green below 50%,
819
- yellow 50-80%, red above 80%. It comes from DeepSeek's
820
- `accumulated_token_usage` and is hidden until the first answer delivers it.
821
-
822
- ## Project context, skills and memory
823
-
824
- Like Codex / Claude Code, zames reads project instructions and reusable
825
- workflows from your repository and from `~/.zames`.
826
-
827
- - **AGENTS.md** — project instructions. Put one in the repo root (or in any
828
- parent folder of the working directory). Global instructions live in
829
- `~/.zames/AGENTS.md` (and `~/.claude/CLAUDE.md`). Run `/init` and the agent
830
- will explore the project and write an AGENTS.md based on the real build/test
831
- commands and conventions (use `/init --force` to overwrite an existing file).
832
- - **MEMORY.md** — durable notes that persist between sessions. The agent
833
- appends useful facts here; you can edit it by hand, or add one from the
834
- prompt with `/remember <text>`.
835
- - **Skills** — a folder with a `SKILL.md` file (YAML frontmatter: `name`,
836
- `description`, optional `allowed-tools`, `user-invokable`) plus any helper
837
- files. Discovered under `.zames/skills/`, `.claude/skills/`,
838
- `.agents/skills/`, `skills/`, and `~/.zames/skills/`. The agent reads the
839
- body only when a task matches the description. List them with `/skills`;
840
- invoke one with `/<skill-name>`.
841
- - **Custom commands** — `.md` files under `.zames/commands/` (or
842
- `.claude/commands/`). They support `$ARGUMENTS` / `{{args}}` placeholders and
843
- are invoked with `/<command-name>`.
844
-
845
- Skills and custom commands show up in the «/» completion list and in `/help`.
846
-
847
- ```
848
- /skills list discovered skills
849
- /memory show AGENTS.md / MEMORY.md in effect
850
- /remember <text> append a durable note to MEMORY.md
851
- /init [--force] analyze the project and create AGENTS.md
852
- ```
853
-
854
- ## MCP (external tools)
855
-
856
- zames can use tools from [MCP](https://modelcontextprotocol.io) servers.
857
- The flagship example is @playwright/mcp: it gives the agent a real browser
858
- (navigate, click, snapshot, type, ...) on top of the one zames already uses
859
- for the DeepSeek chat.
860
-
861
- Drop a config file (same shape as Claude Code / Cursor):
862
-
863
- - `~/.zames/mcp.json` - global
864
- - `<project>/.zames/mcp.json` - project-scoped (later files win)
865
- - `<project>/.mcp.json` - the common MCP name
866
-
867
- ```json
868
- {
869
- "mcpServers": {
870
- "playwright": {
871
- "command": "npx",
872
- "args": ["-y", "@playwright/mcp@latest", "--headless", "--isolated"]
873
- }
874
- }
875
- }
876
- ```
877
-
878
- IMPORTANT: keep the MCP browser isolated. @playwright/mcp defaults to the
879
- SAME profile directory as zames (~/.zames/profile). If it is launched
880
- without --isolated (or without its own --user-data-dir), the MCP browser
881
- and the agent browser fight over one profile and the DeepSeek chat shows
882
- "Something went wrong when opening your profile". Always pass --isolated
883
- as in the example above.
884
- Servers can also be remote ("url": "https://...", "transport": "sse").
885
- Their tools show up in the agent as `server__tool` (e.g.
886
- `playwright__browser_navigate`) and are listed with `/mcp` and in `/status`.
887
- A server that fails to connect is skipped with a warning and never breaks the
888
- agent.
889
-
890
- ## Configuration
891
-
892
- Global config: `~/.zames/config.json`
893
- Local (per project): `.zamesrc.json`
894
-
895
- You can view and change settings without leaving the agent — use the
896
- `/config` command. Run it without arguments to open an interactive menu
897
- (↑/↓ to move, Enter to change, `d` to reset, `q` to quit). Booleans and enums
898
- toggle in place; numbers and strings open an input prompt.
899
-
900
- ```
901
- /config interactive settings menu
902
- /config list print all editable settings
903
- /config get <path> show a setting
904
- /config set <path> <value> change a setting
905
- /config reset <path> reset a setting to its default
906
- /config path show config file paths
907
- /config lang <ru|en> switch interface and agent language
908
- ```
909
-
910
- Examples:
911
-
912
- ```
913
- /config set maxIterations 20
914
- /config set browser.deepThinking true # DeepSeek Deep thinking (slow; reasoning is hidden)
915
- /config set browser.webSearch false # DeepSeek Smart web search
916
- /config lang en
917
- ```
918
-
919
- Changes are written to the project `.zamesrc.json` and applied right away
920
- (where possible without a restart).
921
-
922
- ### Language
923
-
924
- `/config lang ru` or `/config lang en` switches both the interface language
925
- (help, messages, spinner) and the language the agent answers you in. The
926
- locale lives in `ui.locale` in the config file.
927
-
928
- Agent data is stored in `~/.zames`: browser profile, logs, undo history, sessions.
929
-
930
- ## FAQ
931
-
932
- **Is this an official DeepSeek product?**
933
- No. zames drives the public chat.deepseek.com web UI through a real browser,
934
- like a regular user. It is not affiliated with DeepSeek.
935
-
936
- **Do I need an API key?**
937
- No. You sign in with your own DeepSeek account once; the session is stored in
938
- `~/.zames/profile` and reused.
939
-
940
- **Which model does it use?**
941
- Whichever the DeepSeek web chat uses (DeepSeek-V3, or the reasoning model with
942
- "Deep thinking" on). zames never calls the API directly.
943
-
944
- **Does it work headless / on a server?**
945
- Yes — headless is the default, and `--output-format jsonl` makes it scriptable.
946
- `--headed` is only needed for a manual sign-in or selector debugging.
947
-
948
- **Is automating the web UI allowed?**
949
- That depends on DeepSeek's terms; automating a website may violate them. Use at
950
- your own risk and keep the send throttle (15s by default) so you do not hammer
951
- the rate limit.
952
-
953
- **How is it different from Claude Code / Codex?**
954
- Same shape (tools, `AGENTS.md`, skills, MCP, slash commands) but it runs on your
955
- DeepSeek account instead of an API, as a browser automation rather than a
956
- first-party API client.
957
-
958
- ## Links
959
-
960
- - **npm:** <https://www.npmjs.com/package/zames_pro>
961
- - **GitHub:** <https://github.com/Viqto0r/zames_pro>
962
- - **Changelog:** [`CHANGELOG.md`](CHANGELOG.md)
963
- - **Contributing:** [`CONTRIBUTING.md`](CONTRIBUTING.md)
964
- - **Security policy:** [`SECURITY.md`](SECURITY.md)
965
- - **Code of conduct:** [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md)
966
-
967
- ## License
968
-
969
- MIT
970
-
971
- </details>