techunter 0.1.10 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +237 -209
  2. package/dist/index.js +1913 -1109
  3. package/dist/mcp.js +1228 -557
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -1,209 +1,237 @@
1
- # Techunter
2
-
3
- > An AI-powered task distribution CLI for development teams. Manage GitHub Issues through a conversational terminal interface.
4
-
5
- ```
6
- ╔═══════════════╗
7
- ◆═══╬ TECHUNTER ╬═══▶ Techunter v0.1.6
8
- ╚═══════════════╝ GLM-5 · z-ai · owner/repo
9
- ```
10
-
11
- ---
12
-
13
- ## Table of Contents
14
-
15
- - [Features](#features)
16
- - [Requirements](#requirements)
17
- - [Installation](#installation)
18
- - [Setup](#setup)
19
- - [Usage](#usage)
20
- - [Task Lifecycle](#task-lifecycle)
21
- - [Branch Naming](#branch-naming)
22
- - [AI Agent Tools](#ai-agent-tools)
23
- - [Development](#development)
24
- - [Architecture](#architecture)
25
- - [License](#license)
26
-
27
- ---
28
-
29
- ## Features
30
-
31
- - **Conversational REPL** — Describe what you need in plain English; the Agent calls the right tools automatically
32
- - **GitHub Issues integration** — Create, claim, submit, review, and close tasks; labels and assignees stay in sync
33
- - **Automatic branch management** — Claiming a task creates and pushes the corresponding Git branch
34
- - **Smart task guides** — Before you start, the Agent scans your codebase and posts a detailed implementation guide as an Issue comment
35
- - **One-command delivery** — `/submit` lets the Agent review your changes against acceptance criteria, then commits and pushes
36
- - **Review & accept flow** — `/review` lists in-review PRs; `/accept` merges and closes
37
- - **Slash commands** — Common actions don't need a description: just `/pick`, `/new`, `/submit`
38
- - **Persistent conversation history** — Full context is retained across turns in the same REPL session
39
-
40
- ---
41
-
42
- ## Requirements
43
-
44
- - Node.js ≥ 18
45
- - A GitHub repository with Issues enabled
46
- - GitHub Personal Access Token or OAuth Device Flow authorization
47
- - An OpenAI-compatible API key (OpenRouter by default, or any custom provider)
48
-
49
- ---
50
-
51
- ## Installation
52
-
53
- ```bash
54
- npm install -g techunter
55
- ```
56
-
57
- **Install from source (for development):**
58
-
59
- ```bash
60
- git clone https://github.com/Zhang-Dongfang/Techunter.git
61
- cd Techunter
62
- npm install
63
- npm run build
64
- npm link # registers the tch / techunter commands globally
65
- ```
66
-
67
- ---
68
-
69
- ## Setup
70
-
71
- Run the one-time setup wizard inside any directory that has a GitHub remote:
72
-
73
- ```bash
74
- tch init
75
- ```
76
-
77
- The wizard will ask for:
78
-
79
- 1. **GitHub authentication** Browser OAuth (recommended) or a Personal Access Token
80
- - PAT: create one at https://github.com/settings/tokens/new with `repo` and `read:user` scopes
81
- 2. **AI provider** OpenRouter (default) or a custom OpenAI-compatible endpoint
82
- - OpenRouter key: https://openrouter.ai/settings/keys
83
- 3. **GitHub repository** — Auto-detected from your git remote, or enter manually
84
-
85
- Config is stored at `~/.config/techunter/`.
86
-
87
- ---
88
-
89
- ## Usage
90
-
91
- ```bash
92
- tch
93
- ```
94
-
95
- Starts the conversational REPL. Type natural language or slash commands:
96
-
97
- | Command | Alias | Description |
98
- |---|---|---|
99
- | `/help` | `/h` | Show all commands |
100
- | `/refresh` | `/r` | Refresh the task list |
101
- | `/pick` | `/p` | Browse and act on tasks interactively |
102
- | `/new` | `/n` | Create a new task |
103
- | `/close` | `/d` | Close (delete) a task |
104
- | `/edit` | `/e` | Edit the title or description of a task |
105
- | `/submit` | `/s` | Review changes, commit, and push |
106
- | `/review` | `/rv` | List tasks waiting for your approval |
107
- | `/accept` | `/ac` | Accept a reviewed task: merge PR and close issue |
108
- | `/status` | `/me` | Show tasks assigned to you |
109
- | `/code` | `/c` | Launch Claude Code for the current task branch |
110
- | `/config` | `/cfg` | Change settings (repo, API keys, etc.) |
111
- | `/init` | | Re-run the setup wizard for this repo |
112
-
113
- Any other input is sent to the AI Agent, for example:
114
-
115
- ```
116
- > claim task #12
117
- > create a task to add pagination to the user list
118
- > what tasks are available right now?
119
- > deliver the current task
120
- ```
121
-
122
- ---
123
-
124
- ## Task Lifecycle
125
-
126
- Each GitHub Issue carries exactly one `techunter:*` label at a time:
127
-
128
- ```
129
- techunter:available → techunter:claimed → techunter:in-review
130
- (green) (yellow) (blue)
131
- rejected
132
- techunter:changes-needed
133
- (red)
134
- ```
135
-
136
- Labels are created automatically in your repository during `tch init` and when tasks are created.
137
-
138
- ---
139
-
140
- ## Branch Naming
141
-
142
- A branch is created automatically when you claim a task:
143
-
144
- ```
145
- task-{issue_number}-{your-github-username}
146
- ```
147
-
148
- Example: Issue #7 claimed by `johndoe` `task-7-johndoe`
149
-
150
- Worker branches (for persistent personal workspaces) follow:
151
-
152
- ```
153
- worker-{your-github-username}
154
- ```
155
-
156
- ---
157
-
158
- ## AI Agent Tools
159
-
160
- The Agent can call the following tools:
161
-
162
- | Tool | Description |
163
- |---|---|
164
- | `list_tasks` | List all open tasks |
165
- | `get_task` | Get full details of a specific Issue |
166
- | `create_task` | Create a new GitHub Issue |
167
- | `claim_task` | Assign an Issue and create a local branch |
168
- | `deliver_task` | Push the branch, open a PR, mark as in-review |
169
- | `close_task` | Close a GitHub Issue |
170
- | `post_comment` | Post a Markdown comment on an Issue |
171
- | `scan_project` | Scan the project file tree and read key files |
172
- | `read_file` | Read the contents of a specific file |
173
- | `run_command` | Execute a shell command in the project root |
174
- | `get_diff` | Get the current Git diff |
175
- | `stage_and_commit` | Stage all changes, commit, and push |
176
- | `ask_user` | Ask the user a question (max 3 times per task) |
177
- | `get_my_status` | Show tasks assigned to the current user |
178
- | `get_comments` | Read the latest comments on an Issue (e.g. rejection feedback) |
179
- | `reject_task` | Reject an in-review task: post feedback and mark as changes-needed |
180
-
181
- ---
182
-
183
- ## Development
184
-
185
- ```bash
186
- npm run dev # Run directly with tsx (no build step)
187
- npm run build # Compile to dist/index.js
188
- npm run typecheck # Type-check without emitting files
189
- ```
190
-
191
- ---
192
-
193
- ## Architecture
194
-
195
- ```
196
- tch
197
- └─ src/index.ts Entry point, REPL, slash command dispatch
198
- └─ src/lib/agent.ts AI tool-call loop
199
- ├─ src/lib/github.ts Octokit — Issues, PRs, label management
200
- ├─ src/lib/git.ts simple-git — branches, push, diff
201
- ├─ src/lib/project.ts File tree + key file scanning (80 KB cap)
202
- └─ src/lib/config.ts conf-based config store (~/.config/techunter/)
203
- ```
204
-
205
- ---
206
-
207
- ## License
208
-
209
- [MIT](LICENSE)
1
+ # Techunter
2
+
3
+ > AI-powered task distribution CLI for development teams manage GitHub Issues through a conversational terminal interface.
4
+
5
+ ```
6
+ ╔═══════════════╗
7
+ ◆═══╬ TECHUNTER ╬═══▶
8
+ ╚═══════════════╝
9
+ ```
10
+
11
+ <!-- demo GIF goes here -->
12
+
13
+ ---
14
+
15
+ ## Why Techunter?
16
+
17
+ Most teams manage tasks in GitHub Issues but switch between multiple tools to actually act on them. Techunter closes that gap:
18
+
19
+ | Without Techunter | With Techunter |
20
+ |---|---|
21
+ | Manually write Issue descriptions | `/new` → AI scans your codebase and generates a full implementation guide |
22
+ | Browse Issues in the browser, create branches by hand | `/pick` → select a task, branch is created and pushed automatically |
23
+ | Write PR descriptions, update labels manually | `/submit` → AI reviews your changes against acceptance criteria, then commits and opens the PR |
24
+ | Back-and-forth review comments | `/accept` or `/reject` with AI-generated feedback |
25
+
26
+ ---
27
+
28
+ ## Installation
29
+
30
+ ```bash
31
+ npm install -g techunter
32
+ ```
33
+
34
+ **Install from source:**
35
+
36
+ ```bash
37
+ git clone https://github.com/Zhang-Dongfang/Techunter.git
38
+ cd Techunter
39
+ npm install && npm run build && npm link
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Quick Start
45
+
46
+ Run the one-time setup wizard inside any directory with a GitHub remote:
47
+
48
+ ```bash
49
+ tch init
50
+ ```
51
+
52
+ The wizard will prompt for:
53
+ 1. **GitHub auth** — Browser OAuth (recommended) or a Personal Access Token (`repo` + `read:user` scopes)
54
+ 2. **AI provider** — OpenRouter (default) or any OpenAI-compatible endpoint + API key
55
+ 3. **Repository** — auto-detected from your git remote
56
+
57
+ Then start the REPL:
58
+
59
+ ```bash
60
+ tch
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Workflow
66
+
67
+ ### 1. Create a task
68
+
69
+ ```
70
+ You › /new
71
+ ? Task title: Add email verification on signup
72
+
73
+ ⠋ Scanning project and generating guide…
74
+
75
+ ## Goal
76
+ Send a verification email after user registration.
77
+
78
+ ## Acceptance Criteria
79
+ - [ ] POST /auth/register sends a verification email
80
+ - [ ] Email contains a signed token with 24h expiry
81
+ - [ ] GET /auth/verify/:token activates the account
82
+ - [ ] Unverified users cannot access protected routes
83
+
84
+ ## Implementation Notes
85
+ - Use nodemailer (already in package.json)
86
+ - See existing token pattern in src/lib/auth.ts
87
+ - Add `verified` boolean column to users table
88
+
89
+ ? Create this task? ❯ Yes, create task
90
+ ```
91
+
92
+ ### 2. Claim a task
93
+
94
+ ```
95
+ You /pick
96
+
97
+ ? Select a task:
98
+ #14 available Add email verification on signup
99
+ #11 available Fix login redirect bug
100
+
101
+ #11 Fix login redirect bug available
102
+ After OAuth login, users are redirected to /home
103
+ instead of their original destination URL.
104
+
105
+ ? Action: ❯ Claim this task
106
+
107
+ Claimed! Branch: worker-johndoe (base: a3f92c1)
108
+
109
+ ? Open Claude Code for this task? ❯ Yes, start coding now
110
+ ```
111
+
112
+ ### 3. Submit when done
113
+
114
+ ```
115
+ You › /submit
116
+
117
+ Reviewing changes against acceptance criteria…
118
+
119
+ Return URL stored in session before redirect
120
+ ✅ Redirects to return URL after successful login
121
+ ✅ Falls back to /dashboard when no return URL
122
+ ⚠️ Consider validating return URL to prevent open redirect
123
+
124
+ ? Submit task #11? ❯ Yes, submit
125
+
126
+ Committed and pushed
127
+ ✔ PR created: https://github.com/myorg/my-project/pull/8
128
+ ✔ Marked as in-review
129
+ ```
130
+
131
+ ### 4. Review and accept
132
+
133
+ ```
134
+ You › /review # see all in-review PRs
135
+ You › /accept # merge PR, close issue, release branch
136
+ ```
137
+
138
+ ---
139
+
140
+ ## Commands
141
+
142
+ | Command | Alias | Description |
143
+ |---|---|---|
144
+ | `/help` | `/h` | Show all commands |
145
+ | `/new` | `/n` | Create a task — AI generates an implementation guide |
146
+ | `/pick` | `/p` | Browse tasks and claim one |
147
+ | `/submit` | `/s` | AI-review changes, commit, push, open PR |
148
+ | `/review` | `/rv` | List tasks waiting for your approval |
149
+ | `/accept` | `/ac` | Merge PR and close issue |
150
+ | `/status` | `/me` | Show tasks assigned to you |
151
+ | `/edit` | `/e` | Edit a task title or description |
152
+ | `/close` | `/d` | Close (delete) a task |
153
+ | `/refresh` | `/r` | Reload the task list |
154
+ | `/code` | `/c` | Open Claude Code for the current task branch |
155
+ | `/wiki` | `/w` | Generate or refresh `TECHUNTER.md` project overview |
156
+ | `/config` | `/cfg` | Change settings (repo, API keys, model) |
157
+ | `/init` | | Re-run the setup wizard |
158
+
159
+ Any other input is sent to the AI agent:
160
+
161
+ ```
162
+ You what tasks are available?
163
+ You › claim the task about login redirect
164
+ You create a task to add pagination to the user list
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Task Lifecycle
170
+
171
+ Issues carry exactly one `techunter:*` label at a time:
172
+
173
+ ```
174
+ techunter:available → techunter:claimed → techunter:in-review
175
+ ↓ (if rejected)
176
+ techunter:changes-needed
177
+ ```
178
+
179
+ Labels are created automatically in your repository during `tch init`.
180
+
181
+ ---
182
+
183
+ ## Branch Naming
184
+
185
+ Each user has a persistent **worker branch** created when they first claim a task:
186
+
187
+ ```
188
+ worker-{github-username}
189
+ ```
190
+
191
+ Task branches submitted as PRs follow:
192
+
193
+ ```
194
+ task-{issue_number}-{first-five-words-of-title}
195
+ ```
196
+
197
+ ---
198
+
199
+ ## MCP Server
200
+
201
+ Techunter ships a Model Context Protocol server that exposes all tools to any MCP-compatible client (e.g. Claude Desktop):
202
+
203
+ ```bash
204
+ tch-mcp
205
+ ```
206
+
207
+ ---
208
+
209
+ ## Development
210
+
211
+ ```bash
212
+ npm run dev # Run with tsx (no build step)
213
+ npm run build # Compile to dist/
214
+ npm run typecheck # Type-check without emitting
215
+ ```
216
+
217
+ To verify end-to-end: build and run `tch init` in a directory with a GitHub remote.
218
+
219
+ ---
220
+
221
+ ## Architecture
222
+
223
+ ```
224
+ tch
225
+ └─ src/index.ts readline REPL + slash command dispatch
226
+ ├─ /pick, /new … → tool run() functions directly
227
+ └─ natural language → runAgentLoop()
228
+ └─ LLM (tool_use) → toolModules[name].execute(input, config)
229
+ ```
230
+
231
+ All tools live in `src/tools/{name}/index.ts`. See [CLAUDE.md](CLAUDE.md) for full architecture notes.
232
+
233
+ ---
234
+
235
+ ## License
236
+
237
+ [MIT](LICENSE)