Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@ The project publishes 0.x prerelease versions; a stable release line is not yet

## [Unreleased]

### Added

- `mem doctor` read-only diagnostic command that checks server reachability,
credential presence, workspace selection, and CLI/server version skew. Supports
`--format text|json` output with `mem.doctor/v1` schema. Performs no writes and
installs no dependencies (`#112`).

### Changed

- All CLI commands that require authentication now include the documented
`deploy/compose/` deployment path in their "not logged in" hint, directing
first-run users to the recommended container deployment (`#112` REQ-002).

- Migrate GitHub repository, Release, issue, badge, and raw-content coordinates
to the canonical `bytefolk` organization while retaining the published npm
scope, MCP identity, and existing cache paths.
Expand Down
8 changes: 8 additions & 0 deletions server/cmd/mem/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ func newCliError(code int, msg, hint string) *cliError {
return &cliError{code: code, msg: msg, hint: hint}
}

// errNotLoggedIn returns the standard auth error for unauthenticated CLI use.
// The hint names the documented deploy/compose path so first-run users are
// directed to the recommended container deployment (#112 REQ-002).
func errNotLoggedIn() *cliError {
return newCliError(3, "not logged in",
"run `mem auth login`; see deploy/compose/ for the recommended deployment path")
}

// fromAPIError maps an *apiclient.APIError to a *cliError with the SPEC §7.1
// exit code. Any other error is returned unchanged.
func fromAPIError(err error) error {
Expand Down
4 changes: 2 additions & 2 deletions server/cmd/mem/cmds_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func newAuthStatusCmd() *cobra.Command {
return err
}
if cfg.Token == "" {
return newCliError(3, "not logged in", "run `mem auth login` first")
return errNotLoggedIn()
}

var capabilities struct {
Expand Down Expand Up @@ -241,7 +241,7 @@ func newTokenCreateCmd() *cobra.Command {
return err
}
if cfg.Token == "" {
return newCliError(3, "not logged in", "run `mem auth login` first")
return errNotLoggedIn()
}
scopeList := splitCommas(scopes)
body := map[string]any{
Expand Down
2 changes: 1 addition & 1 deletion server/cmd/mem/cmds_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func TestAuthStatusWithoutTokenReturnsAuthExitCode(t *testing.T) {
if !errors.As(err, &cliErr) {
t.Fatalf("error type = %T, want *cliError", err)
}
if cliErr.code != 3 || cliErr.hint != "run `mem auth login` first" {
if cliErr.code != 3 || cliErr.hint != "run `mem auth login`; see deploy/compose/ for the recommended deployment path" {
t.Fatalf("cli error = %#v", cliErr)
}
}
Expand Down
2 changes: 1 addition & 1 deletion server/cmd/mem/cmds_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Examples:
return err
}
if cfg.Token == "" {
return newCliError(3, "not logged in", "run `mem auth login` first")
return errNotLoggedIn()
}
body := map[string]any{"query": strings.Join(args, " ")}
if scope != "" {
Expand Down
Loading