Skip to content

Conversation

@amikofalvy
Copy link
Collaborator

Summary

  • 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
  • Without the --local flag, cloud remains the default (unchanged behavior)

Changes

  • Add LOCAL_REMOTE and DEFAULT_LOCAL_PROFILE constants in agents-cli/src/utils/profiles/types.ts
  • Export new constants from agents-cli/src/utils/profiles/index.ts
  • Modify localInitCommand() in agents-cli/src/commands/init.ts to set up profiles after creating config
  • Add tests for local profile setup behavior in agents-cli/src/__tests__/commands/init.test.ts

Behavior

Command Profile Setup
inkeep init Uses cloud profile (unchanged)
inkeep init --local Creates/sets local profile as default

Test plan

  • Run pnpm test - all tests pass
  • Run pnpm typecheck - no type errors
  • Manual test: run inkeep init --local and verify local profile is created in ~/.inkeep/profiles.yaml

🤖 Generated with Claude Code

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-bot
Copy link

changeset-bot bot commented Jan 7, 2026

🦋 Changeset detected

Latest commit: cd0d3b0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@inkeep/agents-cli Patch
@inkeep/agents-core Patch
@inkeep/agents-manage-api Patch
@inkeep/agents-manage-ui Patch
@inkeep/agents-run-api Patch
@inkeep/agents-sdk Patch
@inkeep/create-agents Patch
@inkeep/ai-sdk-provider Patch
@inkeep/agents-manage-mcp Patch

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

@vercel
Copy link

vercel bot commented Jan 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
agents-docs Ready Ready Preview, Comment Jan 8, 2026 11:40pm
agents-manage-api Ready Ready Preview, Comment Jan 8, 2026 11:40pm
agents-manage-ui Ready Ready Preview, Comment Jan 8, 2026 11:40pm
agents-run-api Ready Ready Preview, Comment Jan 8, 2026 11:40pm

@claude
Copy link

claude bot commented Jan 7, 2026

Claude finished @amikofalvy's task —— View job


Code Review: feat(cli): add --local flag to set local profile as default on init

Summary

This PR successfully implements the --local flag for inkeep init, allowing self-hosted users to quickly set up a local profile as their default. The implementation is well-structured and follows existing patterns.

Strengths

Architecture & Design

  • Clean separation of concerns: Local and cloud init flows are properly separated in localInitCommand() and cloudInitCommand()
  • Consistent with existing patterns: Uses the same ProfileManager APIs and profile structure as other commands
  • Good defaults: Uses sensible localhost defaults for local development (ports 3001-3003)

Code Quality

  • Comprehensive test coverage: Tests cover all major scenarios including profile creation, updates, and error handling
  • Error handling: Proper try-catch blocks with informative user feedback
  • Type safety: Proper TypeScript usage with existing profile types

User Experience

  • Intuitive API: --local flag is discoverable and clearly named
  • Backward compatibility: Cloud init remains unchanged (default behavior)
  • Good feedback: Clear console messages about profile setup

Areas for Improvement

🔧 Minor: Missing changeset (automated comment already flagged this)

The PR needs a changeset for version management. Consider adding one for the @inkeep/agents-cli package with patch version bump.

🔧 Code Quality: Hard-coded URLs could be more maintainable

In init.ts:454, the manageUi URL is hard-coded:

manageUi: 'http://localhost:3001',

Recommendation: Consider extracting this to use LOCAL_REMOTE.manageUi for consistency:

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 collision

The 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)
Potential issue: User might expect their input URLs to override existing profile

Recommendation: Consider prompting user about this scenario or using a more descriptive name pattern.

🔧 Documentation: CLI reference needs updating

The PR doesn't include updates to documentation. The CLI reference in agents-docs/content/typescript-sdk/cli-reference.mdx should document the new --local flag.

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 scenario

While 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 validation

The validateUrl function allows empty strings to pass validation (line 397-401), but the profile schema expects valid URLs. Consider tightening validation or making URLs required when non-empty.

Future Considerations

Extensibility

  • Multiple local profiles: The pattern could extend to support multiple local environments (e.g., --local=dev, --local=staging)
  • Profile templates: The constants pattern in types.ts makes it easy to add more deployment presets

Security

  • Credential handling: The credential: 'none' approach is appropriate for local development, but consider future scenarios where local deployments might need auth

Technical Implementation Notes

Well-implemented patterns:

  1. Constants management: LOCAL_REMOTE and DEFAULT_LOCAL_PROFILE are properly defined in types.ts
  2. Export strategy: Clean exports from index.ts maintain API consistency
  3. Test mocking: ProfileManager mocking is comprehensive and realistic
  4. Error boundaries: Profile setup errors are caught and don't block config creation

Architecture alignment:

  • Follows existing ProfileManager patterns
  • Consistent with other CLI command structures
  • Maintains separation between config file creation and profile management

Recommendation

LGTM 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
Job Run

🤖 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>
@amikofalvy amikofalvy merged commit 112b5c7 into main Jan 9, 2026
7 of 8 checks passed
@amikofalvy amikofalvy deleted the init-local-profile-flag-1 branch January 9, 2026 00:51
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

🔎💬 Inkeep AI search and chat service is syncing content for source 'Inkeep Agent Framework Docs'

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.

2 participants