feat(config): allow FORGEJO_URL and FORGEJO_TOKEN via environment #2

Merged
w33ble merged 1 commit from feature/env-token-url into main 2026-09-01 09:34:27 -06:00
Collaborator

Credentials can now come from the environment, not just ~/.config/forgejo-cli/config.

  • FORGEJO_URL / FORGEJO_TOKEN are no longer clobbered to empty at startup — exported values are inherited
  • Env overrides the config file per variable; with both set, no config file is needed at all
  • Error message corrected: "You must set FORGEJO_URL and FORGEJO_TOKEN (environment or $CONFIG_FILE)"
  • Missing-config guidance now mentions the env alternative
  • README documents env usage and precedence

Checks:

  • shellcheck clean
  • live: env-only path (no config file), env-wins-over-config, per-variable merge (config URL + env token), and the new error message all verified
Credentials can now come from the environment, not just `~/.config/forgejo-cli/config`. - `FORGEJO_URL` / `FORGEJO_TOKEN` are no longer clobbered to empty at startup — exported values are inherited - Env overrides the config file per variable; with both set, no config file is needed at all - Error message corrected: "You must set FORGEJO_URL and FORGEJO_TOKEN (environment or $CONFIG_FILE)" - Missing-config guidance now mentions the env alternative - README documents env usage and precedence Checks: - shellcheck clean - live: env-only path (no config file), env-wins-over-config, per-variable merge (config URL + env token), and the new error message all verified
w33ble approved these changes 2026-09-01 09:34:18 -06:00
w33ble merged commit b013c94811 into main 2026-09-01 09:34:27 -06:00
w33ble deleted branch feature/env-token-url 2026-09-01 09:34:27 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
w33ble/forgejo-cli!2
No description provided.