Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

The OBOT_BASE_URL environment variable was not discoverable in CLI help output, making it difficult for non-interactive workflows to determine how to configure the base URL.

Changes

  • Added BaseURL field to Obot struct with usage tag and default value
  • Updated PersistentPre to apply the BaseURL value to the API client
  • Initialized BaseURL from OBOT_BASE_URL environment variable in New()

The flag now appears in all command help outputs:

Global Flags:
      --base-url string   Base URL for the OBOT API ($OBOT_BASE_URL) (default "http://localhost:8080/api")
      --debug             Enable debug logging ($OBOT_DEBUG)

The environment variable continues to work as before, with the flag providing an additional explicit configuration method.

Original prompt

This section details on the original issue you should resolve

<issue_title>Expose OBOT_BASE_URL in cli help</issue_title>
<issue_description>We've have some light interest in hitting obot from non-human workflows. Generally people need a token for this and obot token should be sufficient, but the OBOT_BASE_URL env var is not discoveable in the cli help:

obot token --help
Usage:
  obot token [flags]

Flags:
      --force-refresh   Force refresh the token ($OBOT_TOKEN_FORCE_REFRESH)
  -h, --help            help for token
      --no-expiration   Set the token to never expire ($OBOT_TOKEN_NO_EXPIRATION)

Global Flags:
      --debug   Enable debug logging ($OBOT_DEBUG)

id for it to be a global flag that gets exposed in the help </issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: cjellick <2473240+cjellick@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 10, 2025

Deploying obot with  Cloudflare Pages  Cloudflare Pages

Latest commit: c59583e
Status: ✅  Deploy successful!
Preview URL: https://06989efe.obot-dvt.pages.dev
Branch Preview URL: https://copilot-expose-obot-base-url.obot-dvt.pages.dev

View logs

Copilot AI and others added 3 commits December 10, 2025 21:04
Co-authored-by: cjellick <2473240+cjellick@users.noreply.github.com>
Co-authored-by: cjellick <2473240+cjellick@users.noreply.github.com>
Co-authored-by: cjellick <2473240+cjellick@users.noreply.github.com>
Copilot AI changed the title [WIP] Expose OBOT_BASE_URL as a global flag in CLI help Expose OBOT_BASE_URL as global flag in CLI help Dec 10, 2025
Copilot AI requested a review from cjellick December 10, 2025 21:12
Debug bool `usage:"Enable debug logging"`
Client *apiclient.Client
Debug bool `usage:"Enable debug logging"`
BaseURL string `usage:"Base URL for the OBOT API" default:"http://localhost:8080/api"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you have to move BaseURL onto this struct rather than just leveraging the one thats already on Client?

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.

Expose OBOT_BASE_URL in cli help

2 participants