feat: support named Slug API sites #209

Merged
erik merged 1 commit from feat/task-2f3031fb-multiple-slug-sites into main 2026-06-26 20:33:55 -05:00
Owner

Task: #task-2f3031fb

Summary

  • replace single-site CLI config with explicit named Slug API sites
  • require --site for API-backed commands; no default/current site
  • add config site add/list/show/update/remove commands
  • update login and doctor to use named sites
  • update tests, docs, and dev Makefile config

Verification

  • ./scripts/pre-pr.sh
  • tested branch CLI against https://slugkit.com/api/v1 with named site config: doctor passed and site config show worked
Task: #task-2f3031fb ## Summary - replace single-site CLI config with explicit named Slug API sites - require --site <name> for API-backed commands; no default/current site - add config site add/list/show/update/remove commands - update login and doctor to use named sites - update tests, docs, and dev Makefile config ## Verification - ./scripts/pre-pr.sh - tested branch CLI against https://slugkit.com/api/v1 with named site config: doctor passed and site config show worked
feat: support named Slug API sites
All checks were successful
CI / build-lint-test (pull_request) Successful in 49s
1d90d7f69b
Task: #task-2f3031fb
Author
Owner

PR review: approved

Summary

This PR implements explicit named-site support for the Slug CLI. The config now stores sites.<name> entries, API-backed commands require --site <name>, doctor and login resolve the selected named site, and config commands support adding/listing/showing/updating/removing sites. Documentation, Makefile dev config, and tests were updated.

Acceptance criteria

  • Multiple websites can be configured for the Slug CLI — met: config now stores a sites map and includes slug config site add/list/show/set-api-base-url/set-api-key/remove.
  • A configured website can be selected or targeted by CLI commands — met: global --site <name> is parsed and API-backed commands fail clearly when it is missing or unknown.
  • Existing baseApi usage is migrated, replaced, or made compatible with the new design — met as an intentional replacement: the approved design explicitly removed legacy top-level single-site behavior and replaces it with named sites only.
  • slug doctor can validate the selected configured website — met: doctor resolves the selected site and tests cover selected-site targeting; branch CLI was also tested against https://slugkit.com/api/v1 successfully.

Blocking issues

None.

Warnings

None.

Final verdict

Approved. CI is green, ./scripts/pre-pr.sh passed locally, and manual named-site testing against slugkit.com passed.

## PR review: approved ### Summary This PR implements explicit named-site support for the Slug CLI. The config now stores `sites.<name>` entries, API-backed commands require `--site <name>`, `doctor` and `login` resolve the selected named site, and config commands support adding/listing/showing/updating/removing sites. Documentation, Makefile dev config, and tests were updated. ### Acceptance criteria - [x] Multiple websites can be configured for the Slug CLI — met: config now stores a `sites` map and includes `slug config site add/list/show/set-api-base-url/set-api-key/remove`. - [x] A configured website can be selected or targeted by CLI commands — met: global `--site <name>` is parsed and API-backed commands fail clearly when it is missing or unknown. - [x] Existing `baseApi` usage is migrated, replaced, or made compatible with the new design — met as an intentional replacement: the approved design explicitly removed legacy top-level single-site behavior and replaces it with named sites only. - [x] `slug doctor` can validate the selected configured website — met: `doctor` resolves the selected site and tests cover selected-site targeting; branch CLI was also tested against `https://slugkit.com/api/v1` successfully. ### Blocking issues None. ### Warnings None. ### Final verdict Approved. CI is green, `./scripts/pre-pr.sh` passed locally, and manual named-site testing against `slugkit.com` passed.
erik merged commit c531f5e7ca into main 2026-06-26 20:33:55 -05:00
erik deleted branch feat/task-2f3031fb-multiple-slug-sites 2026-06-26 20:33:55 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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
erik/slugkit!209
No description provided.