Skip to content

Commit 2529dd0

Browse files
authored
Merge pull request #27 from lzwjava/rename-to-leanclaw
Rename project to leanclaw
2 parents 4c4ed6f + 942a89b commit 2529dd0

25 files changed

Lines changed: 69 additions & 69 deletions

CLAUDE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66

77
```bash
88
pip install -e . # Install package in editable mode (dev)
9-
mini-copilot-login # Authenticate with GitHub via device flow (saves token to ~/.config/mini-copilot/config.json)
10-
mini-copilot # Start the interactive CLI REPL
9+
leanclaw-login # Authenticate with GitHub via device flow (saves token to ~/.config/leanclaw/config.json)
10+
leanclaw # Start the interactive CLI REPL
1111
ruff check . # Lint code
1212
ruff format . # Format code
1313
```
@@ -16,11 +16,11 @@ Pre-commit hooks run automatically on commit: ruff format.
1616

1717
## Architecture
1818

19-
This is a Python CLI package (mini-copilot) that provides an interactive terminal REPL for chatting with GitHub Copilot.
19+
This is a Python CLI package (leanclaw) that provides an interactive terminal REPL for chatting with GitHub Copilot.
2020

2121
**Authentication flow:**
22-
1. `mini-copilot-login` runs GitHub OAuth Device Flow, saves the GitHub token to `~/.config/mini-copilot/config.json`
23-
2. On startup, `mini-copilot` reads the GitHub token from `~/.config/mini-copilot/config.json`, then exchanges it for a short-lived Copilot token via `https://api.github.com/copilot_internal/v2/token`
22+
1. `leanclaw-login` runs GitHub OAuth Device Flow, saves the GitHub token to `~/.config/leanclaw/config.json`
23+
2. On startup, `leanclaw` reads the GitHub token from `~/.config/leanclaw/config.json`, then exchanges it for a short-lived Copilot token via `https://api.github.com/copilot_internal/v2/token`
2424
3. The Copilot token is refreshed every ~24 minutes during the session
2525

2626
**API endpoints:**
@@ -30,7 +30,7 @@ This is a Python CLI package (mini-copilot) that provides an interactive termina
3030
- `https://api.githubcopilot.com/chat/completions` — Chat completions (GPT-4o model)
3131

3232
**Key files:**
33-
- `mini_copilot/main.py` — Interactive REPL: loads token, maintains conversation history, calls Copilot API
34-
- `mini_copilot/login.py` — CLI login utility
33+
- `leanclaw/main.py` — Interactive REPL: loads token, maintains conversation history, calls Copilot API
34+
- `leanclaw/login.py` — CLI login utility
3535
- `pyproject.toml` — Package metadata and entry points
36-
- `~/.config/mini-copilot/config.json` — Generated by login, not in repo; contains `{ github_token, created_at }`
36+
- `~/.config/leanclaw/config.json` — Generated by login, not in repo; contains `{ github_token, created_at }`

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# mini-copilot
1+
# leanclaw
22

33
An interactive terminal REPL for chatting with GitHub Copilot, built with Python.
44

@@ -14,22 +14,22 @@ An interactive terminal REPL for chatting with GitHub Copilot, built with Python
1414
## Installation
1515

1616
```bash
17-
git clone https://github.com/lzwjava/mini-copilot
18-
cd mini-copilot
17+
git clone https://github.com/lzwjava/leanclaw
18+
cd leanclaw
1919
pip install -e .
2020
```
2121

2222
## Usage
2323

2424
1. **Authenticate with GitHub** (once):
2525
```bash
26-
mini-copilot-login
26+
leanclaw-login
2727
```
28-
This runs the GitHub device authorization flow and saves your token to `~/.config/mini-copilot/config.json`.
28+
This runs the GitHub device authorization flow and saves your token to `~/.config/leanclaw/config.json`.
2929

3030
2. **Start the REPL**:
3131
```bash
32-
mini-copilot
32+
leanclaw
3333
```
3434

3535
### CLI Commands
@@ -58,7 +58,7 @@ python3 -m coverage report -m
5858

5959
### Project Structure
6060
```
61-
mini_copilot/
61+
leanclaw/
6262
├── commands/ # Modular CLI command handlers
6363
├── main.py # Core REPL loop and tool definitions
6464
├── github_api.py # GitHub/Copilot API communication

README_CN.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# mini-copilot (中文说明)
1+
# leanclaw (中文说明)
22

33
这是一个基于 Python 的交互式终端 REPL,用于在终端中与 GitHub Copilot 进行对话。
44

@@ -14,22 +14,22 @@
1414
## 安装步骤
1515

1616
```bash
17-
git clone https://github.com/lzwjava/mini-copilot
18-
cd mini-copilot
17+
git clone https://github.com/lzwjava/leanclaw
18+
cd leanclaw
1919
pip install -e .
2020
```
2121

2222
## 使用说明
2323

2424
1. **GitHub 认证(仅需一次)**
2525
```bash
26-
mini-copilot-login
26+
leanclaw-login
2727
```
28-
这将启动 GitHub 设备授权流程,并将您的令牌保存到 `~/.config/mini-copilot/config.json`
28+
这将启动 GitHub 设备授权流程,并将您的令牌保存到 `~/.config/leanclaw/config.json`
2929

3030
2. **启动 REPL**
3131
```bash
32-
mini-copilot
32+
leanclaw
3333
```
3434

3535
### 终端命令
@@ -56,7 +56,7 @@ python3 -m coverage report -m
5656

5757
### 项目结构
5858
```
59-
mini_copilot/
59+
leanclaw/
6060
├── commands/ # 模块化 CLI 命令处理器
6161
├── main.py # 核心 REPL 循环和工具定义
6262
├── github_api.py # GitHub/Copilot API 通信

integration_tests/test_copilot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22
import os
33
import requests
4-
from mini_copilot import github_api
4+
from leanclaw import github_api
55

66
class TestCopilotIntegration(unittest.TestCase):
77
def setUp(self):

integration_tests/test_edit_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ def run_integration_test():
1616
with open(test_filename, "w") as f:
1717
f.write("Line 1\nLine 2\nLine 3\n")
1818

19-
# Start the mini-copilot process
19+
# Start the leanclaw process
2020
process = subprocess.Popen(
21-
[sys.executable, "-m", "mini_copilot.main"],
21+
[sys.executable, "-m", "leanclaw.main"],
2222
stdin=subprocess.PIPE,
2323
stdout=subprocess.PIPE,
2424
stderr=subprocess.STDOUT,

integration_tests/test_exec_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ def run_integration_test():
1111
env = os.environ.copy()
1212
env["PYTHONPATH"] = os.getcwd() + ":" + env.get("PYTHONPATH", "")
1313

14-
# Start the mini-copilot process
14+
# Start the leanclaw process
1515
process = subprocess.Popen(
16-
[sys.executable, "-m", "mini_copilot.main"],
16+
[sys.executable, "-m", "leanclaw.main"],
1717
stdin=subprocess.PIPE,
1818
stdout=subprocess.PIPE,
1919
stderr=subprocess.STDOUT, # Combine stdout and stderr
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
import sys
33
from datetime import datetime, timezone
4-
from mini_copilot.login import get_device_code, poll_for_access_token
4+
from leanclaw.login import get_device_code, poll_for_access_token
55

66
def handle_login_command(config_path, token_refresh_interval):
77
try:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from mini_copilot.github_api import get_models
2+
from leanclaw.github_api import get_models
33

44
def handle_model_command(copilot_token, current_model):
55
try:

0 commit comments

Comments
 (0)