Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/foreground-only-web-servers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Run web servers foreground-only end to end: the /web slash command now always starts a new server, and the `kimi web kill` / `kimi web ps` subcommands are removed — foreground servers stop with Ctrl+C. `kimi server kill` remains as a deprecated fallback that only stops servers started by a version before 0.28.0.
20 changes: 14 additions & 6 deletions apps/kimi-code/src/cli/sub/web/deprecated-server.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
/**
* Deprecated `kimi server` shim.
*
* The `kimi server` command tree was replaced by `kimi web` (foreground
* server plus the kill/ps/rotate-token management subcommands). Any
* `kimi server …` invocation — bare or with any subcommand/flags — lands
* here, prints the deprecation notice, and exits 1. The shim itself is
* scheduled for removal in the next major version of Kimi Code.
* The `kimi server` command tree was replaced by `kimi web` (a foreground
* server opened in the browser). Any `kimi server …` invocation — bare or
* with any legacy subcommand/flags — lands here, prints the deprecation
* notice, and exits 1. The shim itself is scheduled for removal in the next
* major version of Kimi Code.
*
* One subcommand stays functional: `kimi server kill`, the cleanup path for
* background servers started by pre-0.28.0 builds (recorded in the legacy
* single-instance lock, which the instance registry never sees).
*/

import type { Command } from 'commander';

import { registerLegacyKillCommand } from './legacy-kill';

export const DEPRECATED_SERVER_NOTICE =
'`kimi server` has been deprecated and no longer works.\n' +
'Use `kimi web` instead — it runs the local server in the foreground and opens the web UI (`--no-open` to skip).\n' +
'To stop a server started by a version before 0.28.0, use `kimi server kill`.\n' +
'This notice will be removed in the next major version of Kimi Code.\n';

export function registerDeprecatedServerCommand(program: Command): void {
program
const server = program
.command('server')
.description('Deprecated — use `kimi web` instead.')
// Swallow every legacy subcommand/flag (`run`, `kill`, `--port`, …) so
Expand All @@ -27,4 +34,5 @@ export function registerDeprecatedServerCommand(program: Command): void {
process.stderr.write(DEPRECATED_SERVER_NOTICE);
process.exit(1);
});
registerLegacyKillCommand(server);
}
15 changes: 5 additions & 10 deletions apps/kimi-code/src/cli/sub/web/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
* foreground and open the web UI in the default browser.
*
* The command itself is the runner (`kimi web` = start the server + open the
* browser; `--no-open` to skip). Management subcommands work off the instance
* registry (`~/.kimi-code/server/instances/`), so they see every instance
* sharing this home directory:
* - `web kill [serverId]` — stop an instance (default: the longest-running)
* - `web ps` — list connected clients per instance
* - `web rotate-token` — rotate the home-wide bearer token
* browser; `--no-open` to skip). The server stays attached to the terminal
* and stops with Ctrl+C, so there is no kill/ps subcommand; the only
* management subcommand is `web rotate-token` (rotate the home-wide bearer
* token). Servers left behind by pre-0.28.0 builds are cleaned up with
* `kimi server kill`.
*/

import type { Command } from 'commander';

import { registerDeprecatedServerCommand } from './deprecated-server';
import { registerKillCommand } from './kill';
import { registerPsCommand } from './ps';
import { registerRotateTokenCommand } from './rotate-token';
import { buildWebCommand } from './run';

Expand All @@ -25,8 +22,6 @@ export function registerWebCommand(program: Command): void {
.command('web')
.description('Run the local Kimi server and open the web UI.'),
);
registerKillCommand(web);
registerPsCommand(web);
registerRotateTokenCommand(web);
registerDeprecatedServerCommand(program);
}
227 changes: 0 additions & 227 deletions apps/kimi-code/src/cli/sub/web/kill.ts

This file was deleted.

Loading
Loading