Skip to content

feat: add prismic env commands and active environment state#218

Draft
angeloashmore wants to merge 1 commit into
mainfrom
aa/env-commands
Draft

feat: add prismic env commands and active environment state#218
angeloashmore wants to merge 1 commit into
mainfrom
aa/env-commands

Conversation

@angeloashmore

@angeloashmore angeloashmore commented Jul 8, 2026

Copy link
Copy Markdown
Member

Resolves:

Note

Base of a 3-PR stack that splits the environments work for reviewability:

Description

Adds a prismic env command group to choose which Prismic environment a project targets, and the state model behind it.

A Prismic environment is a separate repository domain, so the active environment is just the repo domain the CLI targets by default. The CLI stores it in its config dir, keyed by project path. It does not touch .env files.

Commands

prismic env list          # environments you can access, active one marked
prismic env set <domain>  # target an environment
prismic env unset         # reset to production
prismic env active        # print the active environment

State

A flat project path → environment domain map:

// ~/.config/prismic/environments.json
{
  "file:///path/to/project/": "my-repo-staging"
}

This PR only introduces the state and the management commands. Wiring the active environment into push/pull/status/etc. is #219, and the app-side preload is #220. resolveEnvironment is kept here and removed in #219.

Checklist

  • A comprehensive Linear ticket, providing sufficient context and details to facilitate the review of the PR, is linked to the PR.
  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1

prismic env list          # available environments
prismic env set my-repo-staging
prismic env active        # my-repo-staging
prismic env unset
prismic env active        # prints the production domain

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

Introduce CLI-owned active-environment state keyed by project path,
stored in environments.json, plus the `prismic env set/unset/active/list`
commands to manage it. `resolveEnvironment` is kept for now; existing
commands are migrated to the new state in a follow-up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@angeloashmore angeloashmore changed the title feat: add prismic env commands and active environment resolution feat: add prismic env commands and active environment state Jul 8, 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.

1 participant