Skip to content

Installer: install into the project when run inside one; stop before login - #965

Merged
htahir1 merged 10 commits into
developfrom
fix/installer-login-conflict
Sep 3, 2026
Merged

htahir1 merged 10 commits into
developfrom
fix/installer-login-conflict

Conversation

@htahir1

@htahir1 htahir1 commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two changes to the installer from its first real runs, both about it assuming too much.

1. Install into the project when run inside one. The worker is the kitaru package itself, and replays run your agent in the worker's own environment. So a kitaru in an isolated uv tool environment can log in, import, and run evaluators, but never replay your agent. The one-liner installed exactly that and didn't say so. Now:

  • Run inside a Python project (pyproject.toml or uv.lock in the current directory): uv add "kitaru[cli,mcp,worker]" into that project's environment; MCP registered as uv run --directory <repo> kitaru-mcp at Claude Code project scope (./.mcp.json); success line names the environment; closing message says uv run kitaru ....
  • Run anywhere else: the isolated tool install as before, success line names the environment and the commands, and the closing message says replays need Kitaru inside the agent's project.
  • --project / --global (or KITARU_SCOPE) force either. --project without a pyproject.toml fails with "run uv init first, or use --global".

2. Stop before login. Login is the one real decision in the flow (local Docker or the managed cloud), and every edge case the script had accumulated (Docker down, port taken, older server, no terminal) came from guessing it. The script now ends after wiring the coding agent and prints:

  Next, pick where your Kitaru server lives:

    kitaru login --local    local, in Docker. Free, open source.
    kitaru login            managed cloud. 14-day trial, no credit card required.

(In project mode every command is prefixed with uv run, since Kitaru is not on PATH there.)

Merge order: this message assumes bare kitaru login targets the managed cloud, which is #967. Merge #967 first, or the second line points at a command that errors until it lands.

--server URL still points the MCP server at a team server. --no-login is gone.

Docs and README now say to run the installer inside your agent's repository, and describe both modes. The smoke workflow gains a step that runs it inside a uv init project and checks pyproject.toml and uv run kitaru.

Reviewer Notes

  • The mode split lives in section 2 of install.sh; everything after it uses KITARU_BIN, MCP_CMD, and CLAUDE_SCOPE and does not care which mode ran. The Claude config snapshot/restore now targets ./.mcp.json in project mode.
  • Project mode skips PATH edits entirely (nothing to put on PATH) and relies on uv run.
  • Follow-up for repo-scoped setup on an existing install remains Add a kitaru setup command that wires skills and the MCP server into detected coding agents #953 (kitaru setup).

Reproduction

Inside a fresh uv init project: cat install.sh | bash -s adds kitaru[cli,mcp,worker]>=0.24.0 to pyproject.toml, .venv/bin/kitaru --version is 0.24.0, no ~/.local/bin/kitaru is created, and with a claude CLI present .mcp.json contains uv run --directory <repo> kitaru-mcp --server ... --mode standard. In an empty directory the global path runs as before. --version=99.99.99 still exits nonzero. Verified in Docker on ubuntu:24.04 (project) and alpine:3.21 (global).

🤖 Generated with Claude Code

https://claude.ai/code/session_01UrD7eCgTu11F6qsYMS5JMP

`kitaru login --local` reports several failures with error kind
"conflict", including "port 8000 is already in use by a deployment
Kitaru does not own". The installer matched on the word and retried
with --upgrade, which then failed with "there is no local deployment to
upgrade", burying the real reason. Seen on a machine running the dev
server on 8000.

Match only the CLI's own --upgrade hint, and for any other failure show
the CLI's message and hint, plus the --port alternative.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrD7eCgTu11F6qsYMS5JMP

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

htahir1 and others added 2 commits September 3, 2026 11:03
The CLI is the probe: it reports "port N is already in use", so step
through the next few ports until one works. It remembers the chosen
port for later logins and logout, so nothing else needs to know.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrD7eCgTu11F6qsYMS5JMP
Login is the one real decision in the flow (local Docker or the managed
cloud), and every edge case the installer accumulated (Docker down,
port taken, older server, no terminal) came from guessing it. The
script now ends after wiring the coding agent and prints:

    kitaru login --local       local, in Docker. Free, open source.
    https://cloud.kitaru.ai    managed cloud. 14-day trial, no credit card required.
                               then: kitaru login <your workspace URL>

--server still points the MCP server at a team server and the closing
message then shows `kitaru login <that URL>`. --no-login is gone.

Docs and README updated; the smoke workflow no longer passes --no-login.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrD7eCgTu11F6qsYMS5JMP
@htahir1 htahir1 changed the title Installer: only the --upgrade hint means an older local server Installer: stop before login and print the two server options Sep 3, 2026
The worker is the `kitaru` package itself (`kitaru worker start`), and
agent replays run the agent in the worker's own environment. A `kitaru`
in an isolated uv tool environment can therefore log in, import, and
run evaluators, but never replay the user's agent. The one-liner was
installing exactly that and not saying so.

Now, run inside a Python project (pyproject.toml or uv.lock in the
current directory), the installer does `uv add "kitaru[cli,mcp,worker]"`
into that project's environment and registers the MCP server as
`uv run --directory <repo> kitaru-mcp` at Claude Code project scope
(./.mcp.json). Run anywhere else, it keeps the isolated tool install
and the closing message says replays need Kitaru inside the agent's
project. --project / --global force either. The success line reports
where it installed in both modes, which was the question that
prompted this.

Docs and README say to run it inside the agent's repository. The smoke
workflow gains a step that runs it inside a `uv init` project and checks
pyproject.toml and `uv run kitaru`.

Verified in Docker: project mode on ubuntu:24.04 (added to
pyproject.toml, .venv/bin/kitaru, no global binary), global mode on
alpine:3.21, and --project without a pyproject.toml fails with a clear
message.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrD7eCgTu11F6qsYMS5JMP
@htahir1 htahir1 changed the title Installer: stop before login and print the two server options Installer: install into the project when run inside one; stop before login Sep 3, 2026
htahir1 and others added 2 commits September 3, 2026 11:37
The checkout root is itself a Python project named kitaru, so the
project-aware installer tried to uv add kitaru into the Kitaru repo.
Every step now runs from a temp dir and reads the script by absolute
path. The uv add failure message no longer blames requires-python for
an error uv already printed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrD7eCgTu11F6qsYMS5JMP
…ory"

The first line now says where to run the one-liner and why (the
worker lives with the agent's dependencies). Options move to a table,
the by-hand equivalent is the in-project form, the not-in-a-repo case
is a callout, and the paste-into-your-agent prompt says to open the
repository first. README step 1 and the setup-page hint match.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrD7eCgTu11F6qsYMS5JMP
@htahir1
htahir1 requested a review from strickvl September 3, 2026 09:57
… project mode

Bare `kitaru login` connects to the managed cloud once #967 lands, so
the closing message names it instead of the signup URL. In project
mode kitaru is not on PATH, so every command in the message is
prefixed with `uv run`. Docs and README match.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrD7eCgTu11F6qsYMS5JMP

@strickvl strickvl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

#967 is merged in now, so whatever updates need to go into this can be made, and also CI is failing, but otherwise this seems like both fair updates.

@AlexejPenner AlexejPenner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🦭

@htahir1
htahir1 merged commit 27dfa95 into develop Sep 3, 2026
43 of 44 checks passed
@htahir1
htahir1 deleted the fix/installer-login-conflict branch September 3, 2026 13:34
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.

3 participants