Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

VerityZooms

Member
Apr 19, 2016
131
108
Chicago, IL
Hey, thought I'd throw this out there real quick: if you're using something like TeslaLog or the My Tesla Alexa-skill, and need an authentication token, I've thrown together a little self-installing tool to generate them quickly. (It doesn't store them anywhere, or contact any servers other than Tesla's — so no giving out your Tesla password to random websites, which is A Good Thing™.)

If you're a developer like myself, and already have recent npm, you can just use the new npx tool to run this without any installation:
Code:
npx generate-tesla-token

If you have no idea what any of that means, you can open the Terminal application on your Mac, and type these two lines:
Code:
npm install -g generate-tesla-token
generate-tesla-token

28244480-e69b65e6-69b1-11e7-9cc8-be027d87f84c.png


(And no, that isn't a working login token in the screenshot. ;))
 

VerityZooms

Member
Apr 19, 2016
131
108
Chicago, IL
Thanks, I had updated to npm v5.0.3 and node v8.1.4 Now it works great.

Yeah, I'm a lazy buttface, and just knocked this together on a whim — didn't bother testing in older versions. I'm sure I used some ES2016-ism or something by accident.

I'm happy to accept any pull-request — don't even have to make it pretty; just click the link and fix whichever line's erroring:

Build software better, together
 

VerityZooms

Member
Apr 19, 2016
131
108
Chicago, IL
Nice job.

Since a lot of people are installing VisibleTesla just to get their list of option codes (and new drive unit code), maybe when you get the token, also grab their options list and optionally display it?

Sounds out-of-scope, tbh. That said, a generalized npm install -g tesla tool, based on TeslaJS but with a consistent CLI and configstore token-caching, would probably be a well-received project … and given that TeslaJS has done all the hard work, wouldn't be at all difficult to throw together, if you wanted to! <3
 

Products we're discussing on TMC...

About Us

Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.

Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


SUPPORT TMC
Top