Skip to content

feat: print suggested next steps after mutating commands#157

Merged
angeloashmore merged 6 commits intomainfrom
feat/next-steps
Apr 18, 2026
Merged

feat: print suggested next steps after mutating commands#157
angeloashmore merged 6 commits intomainfrom
feat/next-steps

Conversation

@angeloashmore
Copy link
Copy Markdown
Member

@angeloashmore angeloashmore commented Apr 18, 2026

Resolves: #149

Description

After mutating commands (create/add) complete, prints a hint about the next logical action. This helps discoverability so users don't need to know the full command tree.

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

Run any mutating command and verify the next-step hint appears after the success message. For example:

  • prismic type create "Test" should suggest prismic field add and prismic type view
  • prismic field add text title --to-type test should suggest prismic type view test

Note

Low Risk
Low risk: changes are limited to additional CLI output strings and minor plumbing to determine whether the target is a slice vs custom type; no API behavior or data mutation logic changes.

Overview
After successful mutating CLI commands, the CLI now prints suggested next actions to improve discoverability (e.g. init, repo create, type create, slice create, preview add, webhook create).

All field add ... commands now print a follow-up message pointing to prismic slice view vs prismic type view depending on the target; this is centralized via new getPostFieldAddMessage() in models.ts and requires resolveModel() callers to consume the returned modelKind.

token create now prints the created token once plus a .env snippet (PRISMIC_ACCESS_TOKEN/PRISMIC_WRITE_TOKEN), and the token-create tests were updated to parse the token from the new multi-line output.

Reviewed by Cursor Bugbot for commit 73976d5. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

After create/add commands complete, print a hint about the next logical
action to help users discover related commands.

Resolves #149

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread src/commands/preview-add.ts Outdated
Comment thread src/commands/field-add-boolean.ts Outdated
Copy link
Copy Markdown
Member Author

@angeloashmore angeloashmore left a comment

Choose a reason for hiding this comment

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

Use natural language in the suggested next steps. Something like:

Run `prismic slice view call_to_action` to view the updated slice

angeloashmore and others added 3 commits April 18, 2026 01:37
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f99df37. Configure here.

Comment thread src/commands/field-add.ts Outdated
angeloashmore and others added 2 commits April 18, 2026 02:57
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use PRISMIC_ACCESS_TOKEN for read tokens and PRISMIC_WRITE_TOKEN for
write tokens. Fix token-create tests to extract the token from only the
first output line.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@angeloashmore angeloashmore merged commit 3f53653 into main Apr 18, 2026
22 of 23 checks passed
@angeloashmore angeloashmore deleted the feat/next-steps branch April 18, 2026 03:15
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.

feat: print suggested next steps after mutating commands

1 participant