feat(cli): Add --prefix flag to create command#56
Merged
hmans merged 1 commit intohmans:mainfrom Jan 15, 2026
Merged
Conversation
…───────────
│ STDIN
─────┼──────────────────────────────────────────────────────────────────────────
1 │ feat(cli): Add --prefix flag to create command
2 │
3 │ Allow users to override the config prefix at bean creation time.
4 │ This enables patterns like:
5 │
6 │ beans create "My task" -t task --prefix "SYNC-TASK-"
7 │
8 │ Which generates IDs like `SYNC-TASK-rbgr` instead of using the
9 │ default config prefix.
10 │
11 │ Changes:
12 │ - Add `prefix` field to CreateBeanInput in GraphQL schema
13 │ - Add `--prefix` flag to CLI create command
14 │ - Pre-generate ID with custom prefix in resolver if provided
15 │ - Add tests for custom prefix functionality
─────┴──────────────────────────────────────────────────────────────────────────
Owner
|
Very nice change, thanks for the PR! |
hmans
added a commit
to divaltor/beans
that referenced
this pull request
Jan 17, 2026
* origin/main: feat(tui): Two-column layout with detail preview (hmans#42) feat: add ETag support for optimistic concurrency control (hmans#59) feat(plugin): improve OpenCode plugin robustness with availability checks (hmans#58) feat(cli): Add --prefix flag to create command (hmans#56) chore: clean up README.md docs: only push prime if it exists (hmans#52) fix: normalise short IDs when storing relationship links (hmans#50)
|
@hmans Can we consider adding the same flag to the init command as well? Currently I have to run init and then update the config file to update the default prefix. Will share a PR if this is accepted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Allow users to override the config prefix at bean creation time. This enables patterns like:
Which generates IDs like
SYNC-TASK-rbgrinstead of using the default config prefix.Motivation
The current static prefix (configured in
.beans.yml) applies to all beans. This PR allows per-bean prefix customization, enabling use cases like:SYNC-TASK-xxxx,CLASS-EPIC-xxxxBUG-xxxx,FEAT-xxxxChanges
prefixfield toCreateBeanInputin GraphQL schema--prefixflag to CLI create commandTesting
./beans-dev create "Test" -t task --prefix "TEST-"→TEST-xxxx