Skip to content

feat(cli): add build-web command and official wire file support#1454

Open
Nietzsche-Ubermensch wants to merge 1 commit intoMoonshotAI:mainfrom
Nietzsche-Ubermensch:agent/from-pathlib-import-path-import-re-p-pathmntdataki-75-l3-qwen-code
Open

feat(cli): add build-web command and official wire file support#1454
Nietzsche-Ubermensch wants to merge 1 commit intoMoonshotAI:mainfrom
Nietzsche-Ubermensch:agent/from-pathlib-import-path-import-re-p-pathmntdataki-75-l3-qwen-code

Conversation

@Nietzsche-Ubermensch
Copy link

@Nietzsche-Ubermensch Nietzsche-Ubermensch commented Mar 17, 2026

Related Issue

Resolve #(issue_number)

Description

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open with Devin

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment on lines +92 to +95
@cli.command()
def print_sdk_setup():
"""Print Kimi Agent SDK / Wire setup instructions"""
typer.echo(sdk_setup_text())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 @cli.command() decorator references cli before it is defined, causing NameError on import

The @cli.command() decorator on print_sdk_setup at line 92 references the name cli, but cli = typer.Typer(...) is not defined until line 98. When this module is imported (which happens at src/kimi_cli/cli/__init__.py:14 via from .info import cli as info_cli), Python will raise a NameError: name 'cli' is not defined. This breaks the entire CLI application at startup since the top-level __init__.py cannot complete its imports.

Prompt for agents
In src/kimi_cli/cli/info.py, the @cli.command() decorator on the print_sdk_setup function (line 92) references the variable cli before it is defined on line 98. Move the cli = typer.Typer(...) definition (currently at line 98) to before the @cli.command() decorator on line 92. Specifically, the block starting with 'cli = typer.Typer(help="Show version and protocol information.")' should appear before the '@cli.command()' decorator for print_sdk_setup. The @cli.callback(invoke_without_command=True) for the info function should also remain after the cli definition.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce6e40aa56

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

return text


@cli.command()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge Define Typer app before registering info subcommand

This decorator is evaluated before cli = typer.Typer(...) is assigned, so importing kimi_cli.cli.info raises NameError at module import time (cli is undefined when evaluating @cli.command()). Since src/kimi_cli/cli/__init__.py imports from .info import cli as info_cli during CLI startup, this breaks startup for the entire kimi command, not only kimi info.

Useful? React with 👍 / 👎.

)


@cli.command()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Prevent web callback from running before build subcommand

Adding build as a subcommand under this Typer group makes the new command effectively unusable because the group callback unconditionally starts run_web_server(...) first. In Click/Typer group semantics, the group callback runs before subcommand execution (click.core.Group.invoke calls super().invoke(ctx) before sub_ctx.command.invoke(sub_ctx)), so kimi web build will launch the server and never reach build unless the callback exits early when ctx.invoked_subcommand is set.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant