feat(cli): add --local flag to set local profile as default on init#1395
feat(cli): add --local flag to set local profile as default on init#1395amikofalvy merged 6 commits intomainfrom
Conversation
When running `inkeep init --local`, the CLI now creates a local profile in ~/.inkeep/profiles.yaml and sets it as the active profile. This makes it easier for self-hosted users to get started with the local profile as their default. Changes: - Add LOCAL_REMOTE and DEFAULT_LOCAL_PROFILE constants - Modify localInitCommand() to set up profiles after creating config - Add tests for local profile setup behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: cd0d3b0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @amikofalvy's task —— View job Code Review: feat(cli): add --local flag to set local profile as default on initSummaryThis PR successfully implements the StrengthsArchitecture & Design
Code Quality
User Experience
Areas for Improvement🔧 Minor: Missing changeset (automated comment already flagged this)The PR needs a changeset for version management. Consider adding one for the 🔧 Code Quality: Hard-coded URLs could be more maintainableIn manageUi: 'http://localhost:3001',Recommendation: Consider extracting this to use const localProfile: Profile = {
remote: {
manageApi: manageApiUrl as string,
manageUi: LOCAL_REMOTE.manageUi, // Use constant
runApi: runApiUrl as string,
},
credential: 'none',
environment: 'development',
};🔧 Edge Case: Profile name collisionThe implementation assumes the profile name "local" is available. Consider what happens if a user already has a "local" profile with different settings. Current behavior: Sets existing local profile as active (line 465-466) Recommendation: Consider prompting user about this scenario or using a more descriptive name pattern. 🔧 Documentation: CLI reference needs updatingThe PR doesn't include updates to documentation. The CLI reference in Recommendation: Add documentation for the new flag: **Options:**
- `--local` - Set up local profile for self-hosted deployments
- `--no-interactive` - Skip interactive path selection🔧 Testing: Missing integration test scenarioWhile unit tests are comprehensive, consider adding a test for the integration between config file creation and profile setup: it('should create both config file and profile in one operation', async () => {
// Test that both file creation and profile setup succeed together
});🔧 Type Safety: Runtime URL validationThe Future ConsiderationsExtensibility
Security
Technical Implementation NotesWell-implemented patterns:
Architecture alignment:
RecommendationLGTM with minor improvements. This is a solid implementation that correctly follows existing patterns and provides value to self-hosted users. The suggested improvements are minor and could be addressed in follow-up PRs if needed. The core functionality is sound, well-tested, and maintains backward compatibility while providing the requested feature. Review completed |
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add documentation for the new --local flag that allows users to initialize for local/self-hosted development with the local profile as default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add CLI Profile Setup section explaining the --local flag for local/self-hosted development vs cloud default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add prominent callout at top of quickstart explaining the --local flag for local/self-hosted development. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add step 5 to setup.js that runs `inkeep init --local --no-interactive` to automatically configure the local CLI profile during setup - Remove manual CLI profile setup docs from quickstart (now automatic) - Keep CLI reference docs for users who need to manually configure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
🔎💬 Inkeep AI search and chat service is syncing content for source 'Inkeep Agent Framework Docs' |
Remove the unused DEFAULT_LOCAL_PROFILE constant from types.ts and its re-export from index.ts. This constant was created in PR #1395 but never imported by any other file. Removing it avoids confusion about what to use. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bug: `inkeep init --local` hardcoded `manageUi: 'http://localhost:3001'` instead of importing the `LOCAL_REMOTE` constant (which was updated to port 3000 in PR #1752). The device-code auth flow sent users to the wrong port, causing ERR_CONNECTION_REFUSED for every new developer. Fix: - Import LOCAL_REMOTE in init.ts, replacing 4 hardcoded localhost URLs - Centralize fallback URLs in profile-config.ts and config.ts to use LOCAL_REMOTE instead of inline strings - Remove dead DEFAULT_LOCAL_PROFILE constant (never imported since creation in PR #1395) Additionally, split `profile add` into three remote type options: - Cloud: for Inkeep Cloud deployments (env defaults to 'production') - Local: for local dev (URLs from LOCAL_REMOTE, credential auto-set to 'none', no URL/credential prompts, env defaults to 'development') - Custom: for self-hosted/staging (placeholder hints, no pre-filled defaults, URL validation rejects empty input) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
inkeep init --local, the CLI now creates a local profile in~/.inkeep/profiles.yamland sets it as the active profile--localflag, cloud remains the default (unchanged behavior)Changes
LOCAL_REMOTEandDEFAULT_LOCAL_PROFILEconstants inagents-cli/src/utils/profiles/types.tsagents-cli/src/utils/profiles/index.tslocalInitCommand()inagents-cli/src/commands/init.tsto set up profiles after creating configagents-cli/src/__tests__/commands/init.test.tsBehavior
inkeep initinkeep init --localTest plan
pnpm test- all tests passpnpm typecheck- no type errorsinkeep init --localand verify local profile is created in~/.inkeep/profiles.yaml🤖 Generated with Claude Code