← All posts
·5 min read

Control Your Tesla with AI: The tesla-connect Skill for OpenClaw

The teslacli tutorial covers the raw CLI path: install the binary, run the setup wizard, memorize the subcommands. That works great in scripts. But if you already use Claude Code as your day-to-day terminal agent, there's a faster way — install the tesla-connect skill from ClawHub and just ask your agent in plain English.

The skill handles the full setup flow and every vehicle command through a conversational interface. This post walks you through installing it and what you can do once it's running.

What ClawHub skills are

ClawHub is the registry for OpenClaw skills — small, self-describing instruction packs that extend what your Claude Code agent knows how to do. Once a skill is installed, Claude reads its documentation automatically and can execute the associated tools in any conversation without extra prompting from you.

The tesla-connect skill (v0.2.0, by lyair1) teaches Claude how to connect to and control Tesla vehicles via teslacli. It covers the entire flow: key generation, AgentGen origin hosting, Tesla Developer app registration, OAuth, and every vehicle command.

Prerequisites

Step 1: Install the skill

Open the tesla-connect skill page on ClawHub and follow the install instructions there. Once installed, Claude Code will automatically have access to all Tesla control capabilities in every session.

Step 2: Run setup

Start a new Claude Code session and ask it to set up your Tesla connection:

Set up my Tesla connection using AgentGen for key hosting.

The skill guides Claude through the same steps as the manual wizard:

  1. Key generation — Claude generates a P-256 key pair and saves it to ~/.config/teslacli/keys/
  2. AgentGen origin — provisions a free subdomain like abc123.agent-gen.com to serve your public key at the Tesla-expected path
  3. Tesla Developer app — Claude tells you the exact values to enter at developer.tesla.com (your AgentGen subdomain as the allowed origin, http://localhost:13227/callback as the redirect URI)
  4. Partner registration & OAuth — handled automatically; a browser opens for your Tesla login

At the key enrollment step, Claude prints a URL like https://tesla.com/_ak/abc123.agent-gen.com. Open it on your phone and tap Add key in the Tesla app. You only do this once.

Step 3: Control your Tesla

After setup you don't need to remember any subcommands. Just describe what you want:

Lock my Tesla.
Preheat the car to 22 degrees for my commute.
What's my current charge level?
Set the charge limit to 80% and stop charging once it reaches it.
Which vehicles are on my account?

Claude translates each request into the right teslacli command, runs it, and reports the result. If the car is asleep, it wakes it first automatically.

How the AgentGen piece fits in

Tesla requires your OAuth app's public key to be served at a specific HTTPS path on your registered domain. During setup, the skill calls two free AgentGen endpoints:

  1. POST /v1/origin — provisions your permanent subdomain
  2. POST /v1/origin/{id}/public-key — uploads your PEM key so it's accessible at https://abc123.agent-gen.com/.well-known/appspecific/com.tesla.3p.public-key.pem

No GitHub Pages. No VPS. No domain to configure. The subdomain is permanent and the key is served indefinitely at no cost.

When to use the skill vs. the raw CLI

Both approaches use the same teslacli binary under the hood. The difference is the interface:

  • Use the skill when you're already in a Claude Code session and want to control your car conversationally, or when you can't remember the exact subcommand flags
  • Use teslacli directly for scripts, cron jobs, and automation pipelines where deterministic command syntax matters

You can mix both freely — the skill and the CLI share the same credentials at ~/.config/teslacli/.

Get started

Install the skill at clawhub.ai/lyair1/tesla-connect, create your free AgentGen account, and you'll be talking to your car in under 10 minutes.

Ready to start generating?

Create a free account and generate your first PDF or image in minutes.

Get started free