[OPIK-6049] [SDK][FE] feat: add --workspace and --api-key to opik connect/endpoint CLI#6364
Merged
itamargolan merged 4 commits intomainfrom Apr 20, 2026
Merged
Conversation
…nect/endpoint CLI Add --workspace and --api-key as inline options on both connect and endpoint subcommands so users can run a single command instead of exporting environment variables first. Precedence: local --api-key > global --api-key > OPIK_API_KEY env > config. Workspace: local --workspace > OPIK_WORKSPACE env > config > "default". Also auto-creates ~/.opik.config on first use if it doesn't exist, and updates the frontend Get Started page to show the new single-command format with the full API key visible. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
📋 PR Linter Failed❌ Missing Section. The description is missing the ❌ Missing Section. The description is missing the |
… pairing The CLI's run_cli_session was not forwarding the --project flag to the Opik() constructor, causing ~/.opik.config to save "Default Project" instead of the user-specified project name. Also moves config file persistence to after successful pairing so a failed connection doesn't write a config file. Removes redundant copyText prop from CodeSnippet. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Users should be aware when their config file fails to persist after a successful pairing, otherwise they silently lose their settings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines
+33
to
+34
| if api_key: | ||
| ctx.obj["api_key"] = api_key |
Contributor
There was a problem hiding this comment.
The connect and endpoint guards that set ctx.obj['api_key'] from --api-key duplicate the same plumbing, should we extract it into a shared helper like store_api_key(ctx, api_key) or centralize before run_cli_session?
Finding type: Code Dedup and Conventions | Severity: 🟢 Low
Want Baz to fix this for you? Activate Fixer
alexkuzmik
approved these changes
Apr 20, 2026
Collaborator
alexkuzmik
left a comment
There was a problem hiding this comment.
SDK part looks good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
Add
--workspaceand--api-keyas inline options on bothconnectandendpointCLI subcommands, so users can run a single command instead of exporting environment variables:Precedence:
--api-key: local subcommand option > globalopik --api-key>OPIK_API_KEYenv > config file--workspace: local subcommand option >OPIK_WORKSPACEenv > config file >"default"Config persistence: If
~/.opik.configdoesn't exist after successful pairing, it is auto-saved so first-time users get a config file automatically. Also fixes a bug whereproject_namewas not forwarded to theOpik()constructor, causing the config to save "Default Project" instead of the user-specified project.Frontend: Updated the Get Started page to show the new single-command format with the full API key visible (no masking). Removed redundant
copyTextprop.All new options default to
None, so existing invocations are fully backward-compatible.Change checklist
Issues
Resolves OPIK-6049
Testing
Documentation
No documentation changes required. The CLI
--helpoutput automatically reflects the new flags.