From 5ecf737de6726f743a3081c61d989d201bcb8f08 Mon Sep 17 00:00:00 2001 From: Zhengshou Lai Date: Mon, 6 Apr 2026 14:04:11 +0800 Subject: [PATCH] renaming from mybot to myclaude --- .claude/conversations/2026-04-06.md | 18 ++++++++++++++++++ Makefile | 2 +- mybot/__main__.py | 3 --- {mybot => myclaude}/__init__.py | 0 myclaude/__main__.py | 3 +++ {mybot => myclaude}/cli.py | 8 ++++---- {mybot => myclaude}/commands/__init__.py | 0 {mybot => myclaude}/commands/chat.py | 14 +++++++------- {mybot => myclaude}/commands/update.py | 16 ++++++++-------- {mybot => myclaude}/project_root.py | 20 ++++++++++---------- pyproject.toml | 8 ++++---- 11 files changed, 55 insertions(+), 37 deletions(-) delete mode 100644 mybot/__main__.py rename {mybot => myclaude}/__init__.py (100%) create mode 100644 myclaude/__main__.py rename {mybot => myclaude}/cli.py (66%) rename {mybot => myclaude}/commands/__init__.py (100%) rename {mybot => myclaude}/commands/chat.py (74%) rename {mybot => myclaude}/commands/update.py (69%) rename {mybot => myclaude}/project_root.py (59%) diff --git a/.claude/conversations/2026-04-06.md b/.claude/conversations/2026-04-06.md index a4da9f5..4305c0d 100644 --- a/.claude/conversations/2026-04-06.md +++ b/.claude/conversations/2026-04-06.md @@ -712,3 +712,21 @@ **Git 分支**: $(git branch --show-current 2>/dev/null || echo 'N/A') **最近提交**: $(git log -1 --oneline 2>/dev/null || echo 'N/A') +--- +**会话结束**: $(date '+%Y-%m-%d %H:%M:%S') +**工作目录**: $(pwd) +**Git 分支**: $(git branch --show-current 2>/dev/null || echo 'N/A') +**最近提交**: $(git log -1 --oneline 2>/dev/null || echo 'N/A') + +--- +**会话结束**: $(date '+%Y-%m-%d %H:%M:%S') +**工作目录**: $(pwd) +**Git 分支**: $(git branch --show-current 2>/dev/null || echo 'N/A') +**最近提交**: $(git log -1 --oneline 2>/dev/null || echo 'N/A') + +--- +**会话结束**: $(date '+%Y-%m-%d %H:%M:%S') +**工作目录**: $(pwd) +**Git 分支**: $(git branch --show-current 2>/dev/null || echo 'N/A') +**最近提交**: $(git log -1 --oneline 2>/dev/null || echo 'N/A') + diff --git a/Makefile b/Makefile index de06678..d09cea8 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ ROOT_DIR := $(shell pwd) help: @echo "Usage: make [target]" @echo "" - @echo " install Editable pip install of mybot (uses uv when available)" + @echo " install Editable pip install of myclaude (uses uv when available)" install: @if command -v uv >/dev/null 2>&1; then \ diff --git a/mybot/__main__.py b/mybot/__main__.py deleted file mode 100644 index 5e500e1..0000000 --- a/mybot/__main__.py +++ /dev/null @@ -1,3 +0,0 @@ -from mybot.cli import main - -main() diff --git a/mybot/__init__.py b/myclaude/__init__.py similarity index 100% rename from mybot/__init__.py rename to myclaude/__init__.py diff --git a/myclaude/__main__.py b/myclaude/__main__.py new file mode 100644 index 0000000..501c22d --- /dev/null +++ b/myclaude/__main__.py @@ -0,0 +1,3 @@ +from myclaude.cli import main + +main() diff --git a/mybot/cli.py b/myclaude/cli.py similarity index 66% rename from mybot/cli.py rename to myclaude/cli.py index eb821bb..5d2aaec 100644 --- a/mybot/cli.py +++ b/myclaude/cli.py @@ -1,15 +1,15 @@ -"""Mybot CLI entrypoint.""" +"""Myclaude CLI entrypoint.""" from importlib.metadata import PackageNotFoundError, version import click -from mybot.commands import chat_cmd, update_cmd +from myclaude.commands import chat_cmd, update_cmd def _package_version() -> str: try: - return version("mybot") + return version("myclaude") except PackageNotFoundError: return "0.0.0" @@ -17,7 +17,7 @@ def _package_version() -> str: @click.group() @click.version_option(version=_package_version()) def cli() -> None: - """Mybot: CLI (update package, chat = Claude Code in this repo).""" + """Myclaude: CLI (update package, chat = Claude Code in this repo).""" cli.add_command(update_cmd) diff --git a/mybot/commands/__init__.py b/myclaude/commands/__init__.py similarity index 100% rename from mybot/commands/__init__.py rename to myclaude/commands/__init__.py diff --git a/mybot/commands/chat.py b/myclaude/commands/chat.py similarity index 74% rename from mybot/commands/chat.py rename to myclaude/commands/chat.py index 621618f..10f4f2a 100644 --- a/mybot/commands/chat.py +++ b/myclaude/commands/chat.py @@ -1,4 +1,4 @@ -"""Start Claude Code in the mybot project directory.""" +"""Start Claude Code in the myclaude project directory.""" import os import shutil @@ -9,18 +9,18 @@ from pathlib import Path import click from rich.console import Console -from mybot.project_root import get_mybot_project_root +from myclaude.project_root import get_myclaude_project_root console = Console() def _resolve_chat_cwd() -> Path: - root = get_mybot_project_root() - fallback = Path.home() / ".mybot" + root = get_myclaude_project_root() + fallback = Path.home() / ".myclaude" if root == fallback: console.print( - "[red]Cannot resolve mybot project root.[/red] Run from the repo or set " - "[cyan]MYBOT_PROJECT_ROOT[/cyan].", + "[red]Cannot resolve myclaude project root.[/red] Run from the repo or set " + "[cyan]MYCLAUDE_PROJECT_ROOT[/cyan].", file=sys.stderr, ) raise SystemExit(1) @@ -42,7 +42,7 @@ def _resolve_chat_cwd() -> Path: ) @click.pass_context def chat_cmd(ctx: click.Context, dangerously_skip_permissions: bool) -> None: - """Run `claude` in the mybot repo so CLAUDE.md and .claude/ apply; extra args pass through.""" + """Run `claude` in the myclaude repo so CLAUDE.md and .claude/ apply; extra args pass through.""" binary = os.environ.get("CLAUDE_BIN") or shutil.which("claude") if not binary: console.print( diff --git a/mybot/commands/update.py b/myclaude/commands/update.py similarity index 69% rename from mybot/commands/update.py rename to myclaude/commands/update.py index 42d46a3..2fe0a74 100644 --- a/mybot/commands/update.py +++ b/myclaude/commands/update.py @@ -1,4 +1,4 @@ -"""Reinstall mybot from the local repo.""" +"""Reinstall myclaude from the local repo.""" import subprocess import sys @@ -7,7 +7,7 @@ from pathlib import Path import click from rich.console import Console -from mybot.project_root import get_mybot_project_root +from myclaude.project_root import get_myclaude_project_root console = Console() @@ -27,18 +27,18 @@ def _run_pip_editable(root: Path) -> int: @click.command("update") def update_cmd() -> None: - """Reinstall mybot from this repository (make install, or pip install -e).""" - root = get_mybot_project_root() - fallback = Path.home() / ".mybot" + """Reinstall myclaude from this repository (make install, or pip install -e).""" + root = get_myclaude_project_root() + fallback = Path.home() / ".myclaude" if root == fallback: console.print( - "[red]Not inside mybot repo.[/red] Set [cyan]MYBOT_PROJECT_ROOT[/cyan] " + "[red]Not inside myclaude repo.[/red] Set [cyan]MYCLAUDE_PROJECT_ROOT[/cyan] " "or run from the clone.", file=sys.stderr, ) raise SystemExit(1) - console.print("[bold cyan]Updating mybot…[/bold cyan]") + console.print("[bold cyan]Updating myclaude…[/bold cyan]") makefile = root / "Makefile" if makefile.is_file(): rc = _run_make_install(root) @@ -51,4 +51,4 @@ def update_cmd() -> None: if rc != 0: console.print("[red]Update failed.[/red]", file=sys.stderr) raise SystemExit(rc) - console.print("[green]mybot updated.[/green]") + console.print("[green]myclaude updated.[/green]") diff --git a/mybot/project_root.py b/myclaude/project_root.py similarity index 59% rename from mybot/project_root.py rename to myclaude/project_root.py index e5a07a5..3b65828 100644 --- a/mybot/project_root.py +++ b/myclaude/project_root.py @@ -1,22 +1,22 @@ -"""Resolve mybot repository root for make / editable install flows.""" +"""Resolve myclaude repository root for make / editable install flows.""" import os from pathlib import Path -def _pyproject_names_mybot(path: Path) -> bool: +def _pyproject_names_myclaude(path: Path) -> bool: try: text = path.read_text(encoding="utf-8", errors="ignore") except OSError: return False - return 'name = "mybot"' in text or "name = 'mybot'" in text + return 'name = "myclaude"' in text or "name = 'myclaude'" in text def _walk_up_for_pyproject(start: Path) -> Path | None: p = start.resolve() for _ in range(16): candidate = p / "pyproject.toml" - if candidate.is_file() and _pyproject_names_mybot(candidate): + if candidate.is_file() and _pyproject_names_myclaude(candidate): return p parent = p.parent if parent == p: @@ -25,13 +25,13 @@ def _walk_up_for_pyproject(start: Path) -> Path | None: return None -def get_mybot_project_root() -> Path: +def get_myclaude_project_root() -> Path: """ - Root of the mybot repo (contains Makefile + pyproject). + Root of the myclaude repo (contains Makefile + pyproject). - Order: MYBOT_PROJECT_ROOT > walk from cwd > package source tree > ~/.mybot + Order: MYCLAUDE_PROJECT_ROOT > walk from cwd > package source tree > ~/.myclaude """ - env_root = os.environ.get("MYBOT_PROJECT_ROOT") + env_root = os.environ.get("MYCLAUDE_PROJECT_ROOT") if env_root: return Path(env_root).resolve() @@ -47,10 +47,10 @@ def get_mybot_project_root() -> Path: here = Path(__file__).resolve().parent for _ in range(8): pyproject = here / "pyproject.toml" - if pyproject.is_file() and _pyproject_names_mybot(pyproject): + if pyproject.is_file() and _pyproject_names_myclaude(pyproject): return here if here.parent == here: break here = here.parent - return Path.home() / ".mybot" + return Path.home() / ".myclaude" diff --git a/pyproject.toml b/pyproject.toml index 37a1b9f..2990a9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] -name = "mybot" +name = "myclaude" version = "0.1.0" -description = "Mybot CLI: package update and Claude Code launcher for this repo" +description = "Myclaude CLI: package update and Claude Code launcher for this repo" requires-python = ">=3.10" dependencies = [ "click>=8.0.0", @@ -9,14 +9,14 @@ dependencies = [ ] [project.scripts] -mybot = "mybot.cli:cli" +myclaude = "myclaude.cli:cli" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] -packages = ["mybot"] +packages = ["myclaude"] [tool.black] line-length = 80