发布

  • [OPIK-6049] [SDK][FE] feat: add --workspace and --api-key to opik connect/endpoint CLI (#6364)

    frostbyte_neo 发布于 2026-04-20 13:43:08 +00:00

    • [OPIK-6049] [SDK][FE] feat: add --workspace and --api-key to opik connect/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

    • fix(sdk): pass project_name to Opik constructor and save config after 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

    • fix(sdk): raise config save failure log level to WARNING

    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

    • refactor(sdk): use ctx.obj for api_key resolution in CLI commands

    Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


    Co-authored-by: Claude Opus 4.6 noreply@anthropic.com

    下载附件