npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tesla-remote

v1.3.0

Published

> WARNING: EXPERIMENTAL - This is all unofficial. Use at your own risk. Remember, you are remote controlling a large, expensive object. Remember there are objects nearby. Make sure you think carefully before taking any "write" actions. <br><br>That said,

Downloads

7

Readme

tesla-remote (CLI)

WARNING: EXPERIMENTAL - This is all unofficial. Use at your own risk. Remember, you are remote controlling a large, expensive object. Remember there are objects nearby. Make sure you think carefully before taking any "write" actions. That said, currently there are no commands to move the car. The biggest risk is opening or closing the trunk when there is something to bump into, or... accidentally leaving your windows open or car unlocked.

Use tesla-remote to get info and remote control your Tesla. It is written in CaffeineScript (JavaScript in 1/3 the code) and runs on NodeJS.

  • Based on this NPM package: https://www.npmjs.com/package/teslajs
  • Based on the unofficial Tesla API documentation: https://tesla-api.timdorr.com

Quikc Start

Be sure to install NodeJS if you haven't already, then run the following for the latest CLI help:

# Get a list of your vehicles.
# NOTE: Your username and password are not stored anywhere.
# NOTE: The space before ' npx ...' ensures the command isn't stored
#       in your command-history.
 npx tesla-remote vehicles --username [email protected] --password abc123

Run Multiple Commands

Above is the simplest way to run one command. Typically you'll want to run multiple commands, and you won't want to pass your username and password every time.

# Authenticate and store the auth-token in the shell's environment:
# NOTE: Your username and password are not stored.
# NOTE: An auth_token is stored in your shell's environment.
# NOTE: Your tesla_auth_token will be discard when you close your shell.
 export tesla_auth_token=`npx tesla-remote auth --username [email protected] --password abc123`

# Now run as many commands as you want.
# Bonus: It's safe to use your shell's command history.
npx tesla-remote vehicles
npx tesla-remote vehicle-data

# IMPORTANT: Don't forget to close your shell when you are done!

Environment Variables

If you are issuing multiple commands, the best solution is to set your credentials and product-id as environment variables.

# NOTE:
#   Start any command that has your password or token with a "space" so
#   it doesn't get saved in your command history.

# the username/email you use to log in with
export [email protected]

# the password for your account
 export tesla_password=abc123

# alternatively, you can fetch the token once with the "auth" command:
# Get your authToken:
# >  tesla-remote auth --username [email protected] --password abc123
# qts-abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123
 export tesla_auth_token=qts-abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123

# select your vehicle
# Get your product id:
# >  tesla-remote vehicles
# []
#   id:           123456789012 <-- copy the 'id' field, not the 'vehicle_id' field
#   vehicle_id:   999999999999
export tesla_product_id=123456789012

About Your Tesla Credentials

Your username and password are not stored. They can be passed on the command-line for each command, or they can be set in environment variables. The latter is the most secure since they will "go away" when you close your terminal.

How to use with environment vars:

# (add space before commands with sensitive information to signal
# to your shell not to save them to your command history)
export [email protected]
 export tesla_password=abc123
npx tesla-remote vehicles

# or
 export tesla_auth_token=qts-abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123
npx tesla-remote vehicles

How to use with command-line arguments:

# (add space before commands with sensitive information to signal
# to your shell not to save them to your command history)
 npx tesla-remote vehicles --username [email protected] --password abc123

Clone and Play!

This tool is mostly a tech demo, and the most fun is opening up the code and customizing it:

git clone [email protected]:shanebdavis/tesla-remote.git
cd tesla-remote
npm install