When running chunk sidecar setup on a project initialized with git init (no remote configured), the sync step fails with a generic error message that gives no actionable guidance.
Steps to reproduce
mkdir my-project && cd my-project
git init
chunk init
chunk sidecar setup
Expected behavior
The CLI detects that origin is not configured before attempting sync and exits with an actionable message, for example:
✗ Error: Git remote "origin" is required for sidecar sync.
Run: git remote add origin <url>
Actual behavior
✗ Error: An unknown error occurred.
sync: git remote get-url origin: exit status 2
The root cause is buried in the detail line. The top-level message provides no indication of what went wrong or how to fix it.
Root cause
DetectOrgAndRepo() fails when origin is absent. This error is wrapped as a plain sync: ... error and returned, but the userError conversion in sidecar setup only handles *sidecar.RemoteBaseError. All other errors fall through to the generic "An unknown error occurred." default in main.go.
Suggested fix
Wrap DetectOrgAndRepo failures as a userError with a specific message and suggestion, for example:
msg: "Git remote \"origin\" is required for sidecar sync."
suggestion: "Run: git remote add origin <url>"
A prerequisites check for git remote get-url origin before the sync step would also prevent the issue entirely.
Workaround
git remote add origin git@github.com:<org>/<repo>.git
git push origin main
# then re-run chunk sidecar setup
Environment
- chunk-cli version: 1.2.0 (also reproduced on 1.3.0)
- OS: macOS
- Project created via:
git init (not git clone)
When running
chunk sidecar setupon a project initialized withgit init(no remote configured), the sync step fails with a generic error message that gives no actionable guidance.Steps to reproduce
Expected behavior
The CLI detects that
originis not configured before attempting sync and exits with an actionable message, for example:Actual behavior
The root cause is buried in the detail line. The top-level message provides no indication of what went wrong or how to fix it.
Root cause
DetectOrgAndRepo()fails whenoriginis absent. This error is wrapped as a plainsync: ...error and returned, but theuserErrorconversion insidecar setuponly handles*sidecar.RemoteBaseError. All other errors fall through to the generic"An unknown error occurred."default inmain.go.Suggested fix
Wrap
DetectOrgAndRepofailures as auserErrorwith a specific message and suggestion, for example:A prerequisites check for
git remote get-url originbefore the sync step would also prevent the issue entirely.Workaround
Environment
git init(notgit clone)