Skip to content

Remove askpraxis default from CLI - #74

Merged
anujhydrabadi merged 1 commit into
mainfrom
remove-askpraxis-cli-default
Aug 7, 2026
Merged

Remove askpraxis default from CLI#74
anujhydrabadi merged 1 commit into
mainfrom
remove-askpraxis-cli-default

Conversation

@anujhydrabadi

@anujhydrabadi anujhydrabadi commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove the built-in public SaaS URL and require --url for new profiles
  • preserve URL reuse for existing profiles without rewriting credentials
  • remove retired-domain references from docs, release metadata, comments, fixtures, and the compiled binary
  • point Homebrew metadata at https://facets.cloud

Validation

  • go test -race ./...
  • go vet ./...
  • GoReleaser YAML parses successfully
  • git diff --check
  • tracked-source and compiled-binary searches contain no retired-domain references

Summary by CodeRabbit

  • New Features

    • Login now supports deployment-specific URLs, helping connect to the correct Facets environment.
    • New profiles require a deployment URL before authentication begins; existing profiles continue using their saved URL.
  • Documentation

    • Updated setup, installation, and login guidance with current Facets Console URL examples.
    • Revised redirect and control-plane guidance to be deployment-neutral.
  • Bug Fixes

    • Improved validation to prevent login attempts from proceeding without a required deployment URL.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The CLI now requires an account-specific deployment URL for new profiles without a saved URL. The default URL fallback and obsolete askpraxis.ai references were removed from credentials, documentation, release metadata, tests, and raptor guidance.

Changes

Deployment URL transition

Layer / File(s) Summary
Require deployment URLs for new profiles
internal/credentials/credentials.go, cmd/login.go, README.md
New profiles require --url when no saved URL exists. Existing profiles reuse their saved URL. The built-in default URL fallback was removed.
Validate URL resolution and side-effect ordering
cmd/login_reuse_test.go
Tests cover required URLs, explicit targets, flag cleanup, and validation before browser or credential-store side effects.
Generalize deployment references
.goreleaser.yml, CLAUDE.md, cmd/login_canonical_test.go, cmd/logout_test.go, cmd/mcp.go, cmd/mcp_test.go, internal/credentials/credentials_test.go, internal/raptorstate/raptorstate_test.go, internal/render/preamble.go, internal/skillinstall/dummy.go
Release metadata, documentation, fixtures, redirect examples, and raptor guidance use generic or Facets deployment references instead of askpraxis.ai-specific references.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant LoginCommand
  participant CredentialStore
  participant Browser
  User->>LoginCommand: Start login
  LoginCommand->>CredentialStore: Resolve saved URL
  CredentialStore-->>LoginCommand: Return saved URL or no URL
  alt No saved URL and no --url
    LoginCommand-->>User: Show required deployment URL guidance
  else Deployment URL available
    LoginCommand->>Browser: Start authentication
    LoginCommand->>CredentialStore: Save canonical URL and credentials
  end
Loading

Possibly related PRs

Suggested reviewers: anshulsao

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: removing the built-in askpraxis default URL from the CLI.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-askpraxis-cli-default

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/credentials/credentials_test.go`:
- Around line 195-198: Update the fixture setup in the credentials serialization
test around Put, os.UserHomeDir, and os.ReadFile to check each returned error,
reporting the operation and error value through the test failure mechanism.
Assert the expected error type or contents where applicable rather than only
checking err != nil, and only continue to inspect the credentials file after
setup succeeds.

In `@internal/skillinstall/dummy.go`:
- Around line 233-234: Update the guidance in internal/skillinstall/dummy.go
lines 233-234 and internal/render/preamble.go line 46 to align with
matches_praxis_url: every false result must require confirmation before any
write, while naming both hosts and reporting a different control plane only when
both parsed hosts are present and differ; otherwise describe the hosts as
missing or unverifiable. Apply the same wording and distinction in both
generated guidance paths.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 62e334a0-a3dc-4de7-8599-4e73526115c5

📥 Commits

Reviewing files that changed from the base of the PR and between bd215e9 and c40c17c.

📒 Files selected for processing (14)
  • .goreleaser.yml
  • CLAUDE.md
  • README.md
  • cmd/login.go
  • cmd/login_canonical_test.go
  • cmd/login_reuse_test.go
  • cmd/logout_test.go
  • cmd/mcp.go
  • cmd/mcp_test.go
  • internal/credentials/credentials.go
  • internal/credentials/credentials_test.go
  • internal/raptorstate/raptorstate_test.go
  • internal/render/preamble.go
  • internal/skillinstall/dummy.go

Comment on lines +195 to +198
_ = Put("default", Profile{URL: "https://default.test", Username: "a@x", Token: "t"})
home, _ := os.UserHomeDir()
body, _ := os.ReadFile(filepath.Join(home, ".praxis", "credentials"))
for _, want := range []string{"[default]", "url = https://askpraxis.ai", "username = a@x", "token = t"} {
for _, want := range []string{"[default]", "url = https://default.test", "username = a@x", "token = t"} {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Handle fixture setup errors instead of discarding them.

Put, os.UserHomeDir, and os.ReadFile errors are ignored in this modified test block. A setup failure can produce a misleading assertion or read the wrong file. Check each error and include the operation and error value in the failure.

As per coding guidelines, tests must assert error types or contents rather than only err != nil.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/credentials/credentials_test.go` around lines 195 - 198, Update the
fixture setup in the credentials serialization test around Put, os.UserHomeDir,
and os.ReadFile to check each returned error, reporting the operation and error
value through the test failure mechanism. Assert the expected error type or
contents where applicable rather than only checking err != nil, and only
continue to inspect the credentials file after setup succeeds.

Source: Coding guidelines

Comment on lines +233 to +234
plane than this praxis profile. Say which two hosts you see and ask the
user which is intended BEFORE any raptor write;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Align both generated guidance paths with the matches_praxis_url contract.

matches_praxis_url == false means that the hosts do not match or cannot be verified. It does not prove that raptor targets a different control plane. Keep confirmation before writes for every false result. Name two hosts and report a different control plane only when both parsed hosts differ.

  • internal/skillinstall/dummy.go#L233-L234: distinguish missing or invalid hosts from a confirmed mismatch.
  • internal/render/preamble.go#L46-L46: use the same wording in the execution preamble.
📍 Affects 2 files
  • internal/skillinstall/dummy.go#L233-L234 (this comment)
  • internal/render/preamble.go#L46-L46
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/skillinstall/dummy.go` around lines 233 - 234, Update the guidance
in internal/skillinstall/dummy.go lines 233-234 and internal/render/preamble.go
line 46 to align with matches_praxis_url: every false result must require
confirmation before any write, while naming both hosts and reporting a different
control plane only when both parsed hosts are present and differ; otherwise
describe the hosts as missing or unverifiable. Apply the same wording and
distinction in both generated guidance paths.

@anujhydrabadi
anujhydrabadi merged commit d1f6502 into main Aug 7, 2026
3 of 5 checks passed
@anujhydrabadi
anujhydrabadi deleted the remove-askpraxis-cli-default branch August 7, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant