Skip to content

feat(agent-providers): non-interactive right agent providers add CLI#116

Merged
onsails merged 2 commits into
onsails:masterfrom
de4ps:feat/agent-providers-add-cli
Jun 12, 2026
Merged

feat(agent-providers): non-interactive right agent providers add CLI#116
onsails merged 2 commits into
onsails:masterfrom
de4ps:feat/agent-providers-add-cli

Conversation

@de4ps

@de4ps de4ps commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Provider management has been dashboard-only since v0.3.0 — agents, fleet operators, and automation tools that drive right programmatically have no way to attach a provider without going through the Telegram Mini App. The new subcommand fills that gap by exposing the same internal-socket REST API the dashboard uses, with the validation, locking, and gateway-side rollback that path already provides:

RIGHT_PROVIDER_CREDENTIAL=<token> \
  right agent providers add my-agent \
    --type generic \
    --label litellm \
    --upstream-host litellm.example.com \
    --header-name x-api-key \
    --env-var ANTHROPIC_API_KEY

Built-in profiles work the same way without the generic-only flags:

RIGHT_PROVIDER_CREDENTIAL=<token> \
  right agent providers add my-agent \
    --type github --label gh

The credential value is taken from the RIGHT_PROVIDER_CREDENTIAL environment variable rather than --credential value-flag when both are absent on argv — passing secrets via argv leaks them to ps, shell history, and journald, the same anti-pattern this codebase already avoids for telegram tokens (see right init --telegram-token, which also accepts RIGHT_TELEGRAM_TOKEN). hide_env_values = true keeps the env var out of --help output.

Requires right up to be running (the subcommand talks to ~/.right/run/internal.sock) and emits a clear error pointing at right up when the socket is absent. Output is the same ProviderView JSON the dashboard sees, so callers can pipe to jq.

This is intended for fleet automation where the dashboard is not the control plane (e.g. a multi-tenant registrar provisioning agents on a shared host). Dashboard-driven workflows are unchanged.

@de4ps de4ps force-pushed the feat/agent-providers-add-cli branch from 63b87dd to 930d340 Compare June 12, 2026 12:13
Provider management has been dashboard-only since v0.3.0 — agents,
fleet operators, and automation tools that drive `right` programmatically
have no way to attach a provider without going through the Telegram
Mini App. The new subcommand fills that gap by exposing the same
internal-socket REST API the dashboard uses, with the validation,
locking, and gateway-side rollback that path already provides:

    RIGHT_PROVIDER_CREDENTIAL=<token> \
      right agent providers add my-agent \
        --type generic \
        --label litellm \
        --upstream-host litellm.example.com \
        --header-name x-api-key \
        --env-var ANTHROPIC_API_KEY

Built-in profiles work the same way without the generic-only flags:

    RIGHT_PROVIDER_CREDENTIAL=<token> \
      right agent providers add my-agent \
        --type github --label gh

The credential value is taken from the `RIGHT_PROVIDER_CREDENTIAL`
environment variable rather than `--credential` value-flag when both
are absent on argv — passing secrets via argv leaks them to `ps`,
shell history, and journald, the same anti-pattern this codebase
already avoids for telegram tokens (see `right init --telegram-token`,
which also accepts `RIGHT_TELEGRAM_TOKEN`). `hide_env_values = true`
keeps the env var out of `--help` output.

Requires `right up` to be running (the subcommand talks to
`~/.right/run/internal.sock`) and emits a clear error pointing at
`right up` when the socket is absent. Output is the same
`ProviderView` JSON the dashboard sees, so callers can pipe to `jq`.

This is intended for fleet automation where the dashboard is not the
control plane (e.g. a multi-tenant registrar provisioning agents
on a shared host). Dashboard-driven workflows are unchanged.
@de4ps de4ps force-pushed the feat/agent-providers-add-cli branch from 930d340 to 41a689d Compare June 12, 2026 16:20
…s before socket probe

- Replace unwrap_or_default() on to_string_pretty with error propagation
  (FAIL FAST; matches the precedent in cmd handling JSON output) so an
  automation caller never receives silent empty output.
- Validate generic --upstream-host/--env-var before probing the internal
  socket, so a misconfigured command reports the actionable arg error
  even when 'right up' is not running.
@onsails onsails merged commit d8b9792 into onsails:master Jun 12, 2026
4 checks passed
@onsails onsails mentioned this pull request Jun 12, 2026
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