Previous answers give some great advice, which is somewhat one-sided. These answers are based on the presumption of having a "fair advisor". If you were confident in that, you would have talked to them directly. But since you posted your question here, the validity of such a strong assumption is questionable.
[Speaking of one-sidedness, some participants even advocate + letting unethical behaviour stand, claiming it is for the victim's own good, which makes me suspect the class solidarity motive. It is difficult to give impartial answer to student-vs-faculty questions, because most respondents belong to one of the two groups (guess which one), but we all must at least try!]
Here are reasons why you might want to hold your idea from your PI/supervisor and some problems you may face if you don't.
Your PI may or should have plans for your PhD. Maybe they already have a great project reserved for you, and are just waiting for you to get ready for it? Sharing your idea may disincentivise your advisor from thinking hard. Pushing your idea may discourage them from caring about you. They may decide that you will be fine and it is better to "feed" other students, who are more receptive or have less on their plate. In other words, you will simply learn more by listening more and letting others speak.
Your PI's ego and favouritism. They may think it is their role to generate ideas. Or that their most senior or favourite student should do it, not you. If, in your PI's worldview, a first-year PhD student cannot propose a good idea, then it won't be a good idea or it won't be yours. No matter the reality. A spherical PI in a vacuum does not behave irrationally or immorally, but humans do.
Your PI may have plans on you and envisages you doing specific work for them. This is more relevant to postdocs, because postdocs are paid from PI's grants, which is not always the case with PhD students. Nevertheless, your PI may expect you to do the work they allocate based on seniority. Changing this expectation and proving that your time can be spent with greater use maybe worth it and is easier than fighting someone's worldview, but still a potential challenge.
PI might claim authorship even if the work is yours from cover to cover. You won't be able to protest, because you have to finish your PhD with them, then get recommendation letters etc. You may hope that they mention your leading role in the recommendation letters, but you will never know. Your claims that the idea and all the work is yours will be taken with a grain of salt: read other answers again and infer the consensus about the probability of a PhD student of 6 months coming up with a good idea. It could be the case that you generate and implement many good ideas by the time you finish (which will make your claims plausible), but it could be just one, this one.
Why would a PI do that? Don't they have myriads of their own better ideas? Well... Some don't. There are few practical upsides to being generous (and letting students take full credit for their work), as there is little danger in cutting little corners here and there. The first instinct of some high-score participants here is not to condemn PIs' unethical actions, but to highlight the importance of "having good relations with" a PI for one's own career (see the links in the 2nd paragraph).
Working on your own idea all by yourself can be a great motivating factor. You can be simply more efficient when you don't have to deal with the resistance or reluctance of others. Depending on your personality, it can be much easier to recover from wasting several weekends on a crappy idea ("embracing failure") than from the feeling of being dismissed, taken advantage of, or not given a proper credit. The latter can be more discouraging and destructive.
Previous answers pointed out that ideas expire, get published by others, are superseded by better ideas, and tend to get less exciting for you personally. Also, you will have less time and freedom as a postdoc. I agree that the optimal time for your best idea is now, the question is how. In addition to working on your idea with your PI and working on it alone, consider a third option: use your idea to establish a collaboration outside your PI's lab or your university:
- Outside connections are good for your career: postdoc opportunities with that person, cross-fertilisation of research topics, independent feedback on your knowledge and skills, and a solid recommendation letter.
- You PI might welcome this collaboration, provided there is no direct competition.
- Even if your PI is included as a middle author, you'll find it easier to assert your primary role in the project, while others will find it easier to believe.