Skip to content

Commit df41674

Browse files
committed
feat: add connect diagnose/autofix for Homebrew and npx (#110)
Ship autodevelop connect [--fix] in the Go CLI so customer docs match brew/npx. Prefer /ping, set a CLI User-Agent on probes, and soft-fail npm publish after GoReleaser succeeds.
1 parent 4b96180 commit df41674

9 files changed

Lines changed: 888 additions & 26 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,8 @@ jobs:
8282
fi
8383
node -e "const fs=require('fs'); const p=JSON.parse(fs.readFileSync('package.json','utf8')); p.version=process.env.VER; fs.writeFileSync('package.json', JSON.stringify(p,null,2)+'\n')"
8484
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc
85-
npm publish --access public
85+
if ! npm publish --access public; then
86+
echo "npm publish failed (org scope / token). GoReleaser + Homebrew already published the binary." >&2
87+
exit 0
88+
fi
8689
npm view "@devrecated/autodevelop@${VER}" version

‎CHANGELOG.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
3+
Copyright (c) 2026 Devrecated.
4+
5+
## Unreleased
6+
7+
## v1.0.1
8+
9+
### Added
10+
- `autodevelop connect [--fix]` — chat-friendly diagnose and safe autofix (switch hosted profile, clear repo Autodevelop MCP, rewrite `~/.cursor/mcp.json`).
11+
- Host probe prefers `GET /ping`, falls back to `/health`.
12+
13+
### Fixed
14+
- Host probe sets `User-Agent: autodevelop-cli/<version>` so edge filters do not stall the default Go client UA.
15+
- Release workflow: npm publish failure no longer fails the job after GoReleaser / Homebrew already succeeded (npm org scope still needs a working token separately).
16+
17+
## v1.0.0
18+
19+
- First 1.x binary release (login, status, install, github, knowledge, mcp, kit-mcp, hooks).

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ More channels (Scoop, winget, signing notes): [packaging/README.md](packaging/RE
5353
autodevelop login # prompts for repo dir (default: git root / cwd)
5454
autodevelop login --dir /path/to/repo --profile acme --no-open
5555
autodevelop status # Profile / Host / Current Project (github.com/owner/repo)
56+
autodevelop connect # diagnose MCP / host reachability (chat-friendly)
57+
autodevelop connect --fix # safe autofix (profile switch, clear repo MCP, rewrite user MCP)
5658
autodevelop profiles
5759
autodevelop install --slug <instance>
5860
autodevelop mcp # host stdio shim (loopback)

‎internal/cli/root.go‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"strings"
1010
"time"
1111

12+
"github.com/devrecated/autodevelop-cli/internal/connect"
1213
"github.com/devrecated/autodevelop-cli/internal/credentials"
1314
"github.com/devrecated/autodevelop-cli/internal/github"
1415
"github.com/devrecated/autodevelop-cli/internal/hooks"
@@ -30,6 +31,7 @@ Autodevelop CLI
3031
autodevelop login [--dir <path>] [--slug <instance>] [--profile <name>] [--no-install] [--no-open]
3132
autodevelop logout [--profile <name>]
3233
autodevelop status [--dir <path>]
34+
autodevelop connect [--fix] [--dir <path>] [--profile <name>]
3335
autodevelop profiles
3436
autodevelop install [--dir <path>] [--slug <instance>]
3537
autodevelop github init|status|token [--account <login>]
@@ -258,6 +260,55 @@ func Run(argv []string) int {
258260
fmt.Println("Current Project:", root)
259261
}
260262
return 0
263+
case "connect":
264+
root, _ := repo.Resolve(dirFlag, "", false, nil, nil)
265+
if root == "" {
266+
root, _ = os.Getwd()
267+
}
268+
opts := connect.Options{
269+
Env: env,
270+
Cwd: root,
271+
CredentialsPath: creds,
272+
Profile: profile,
273+
Host: hostFlag,
274+
}
275+
if hasFlag(args, "fix") {
276+
result := connect.Apply(opts)
277+
fmt.Println(connect.FormatChat(result.Diagnose))
278+
if len(result.Applied) > 0 {
279+
fmt.Println()
280+
fmt.Println("Applied:")
281+
for _, a := range result.Applied {
282+
fmt.Println(" -", a)
283+
}
284+
}
285+
if result.Error != "" {
286+
fmt.Fprintln(os.Stderr, result.Error)
287+
return 1
288+
}
289+
if result.NeedsReload {
290+
fmt.Println()
291+
fmt.Println("Reload Cursor so Autodevelop tools reattach.")
292+
}
293+
if result.NeedsBrowser {
294+
fmt.Println("Authenticate the host tool in Cursor if asked.")
295+
}
296+
if !result.OK {
297+
return 1
298+
}
299+
return 0
300+
}
301+
diag := connect.Build(opts)
302+
if hasFlag(args, "json") {
303+
enc, _ := json.MarshalIndent(diag, "", " ")
304+
fmt.Println(string(enc))
305+
} else {
306+
fmt.Println(connect.FormatChat(diag))
307+
}
308+
if !diag.OK {
309+
return 1
310+
}
311+
return 0
261312
case "profiles", "profile":
262313
if profile != "" {
263314
name, err := credentials.SetActive(creds, profile)

0 commit comments

Comments
 (0)