Sharma, 20, was the mastermind behind the violent robbery of the 19-year-old dealer in Brisbane's southeast, in April 2021, the District Court heard.
Two days after buying cannabis off the teenager Sharma organised to purchase some more via social media, luring him to a Capalaba home.
When the teenage dealer arrived in his car with his girlfriend, two of Sharma's co-offenders jumped in the back seat and produced knives.
They held them to the necks of the dealer and his partner, and "threatened to slice them" if they didn't hand over their drugs.
Sharma then came out of the bushes with another co-offender, threatening the teen dealer with the baseball bat and demanding he hand over his money.
Sharma pulled out the car keys from the ignition before taking the dealer's bag which had about $700 cash while the back seat co-offenders grabbed the drugs.
At one stage one of them punched the 19-year-old in the face.
Sharma then ran back into the bushes.
Police were called and Sharma was found nearby.
He was unco-operative with police but CCTV footage captured him carrying the baseball bat at the time of the incident and partial footage of the robbery.
Sharma on Tuesday pleaded guilty to one count each of armed robbery in company and possession of a dangerous drug.
"You are liable for the planning and facilitating of the robbery. You were a principal offender," Judge Catherine McGuinness said.
"You were armed as were others in your group. The offending was premeditated and there was actual violence used - this is serious offending."
Sharma spent 22 days in pre-sentence custody which was recognised as time served.
He was sentenced to three years in jail but was released on immediate parole.