tescmd 0.2.0__py3-none-any.whl → 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. tescmd/__init__.py +1 -1
  2. tescmd/api/client.py +41 -4
  3. tescmd/api/command.py +1 -1
  4. tescmd/api/errors.py +5 -0
  5. tescmd/api/signed_command.py +19 -14
  6. tescmd/auth/oauth.py +15 -1
  7. tescmd/auth/server.py +6 -1
  8. tescmd/auth/token_store.py +8 -1
  9. tescmd/cache/response_cache.py +8 -1
  10. tescmd/cli/_client.py +142 -20
  11. tescmd/cli/_options.py +2 -4
  12. tescmd/cli/auth.py +255 -106
  13. tescmd/cli/energy.py +2 -0
  14. tescmd/cli/key.py +6 -7
  15. tescmd/cli/main.py +27 -8
  16. tescmd/cli/mcp_cmd.py +153 -0
  17. tescmd/cli/nav.py +3 -1
  18. tescmd/cli/openclaw.py +169 -0
  19. tescmd/cli/security.py +7 -1
  20. tescmd/cli/serve.py +923 -0
  21. tescmd/cli/setup.py +147 -58
  22. tescmd/cli/sharing.py +2 -0
  23. tescmd/cli/status.py +1 -1
  24. tescmd/cli/trunk.py +8 -17
  25. tescmd/cli/user.py +16 -1
  26. tescmd/cli/vehicle.py +135 -462
  27. tescmd/deploy/github_pages.py +21 -2
  28. tescmd/deploy/tailscale_serve.py +96 -8
  29. tescmd/mcp/__init__.py +7 -0
  30. tescmd/mcp/server.py +648 -0
  31. tescmd/models/auth.py +5 -2
  32. tescmd/openclaw/__init__.py +23 -0
  33. tescmd/openclaw/bridge.py +330 -0
  34. tescmd/openclaw/config.py +167 -0
  35. tescmd/openclaw/dispatcher.py +529 -0
  36. tescmd/openclaw/emitter.py +175 -0
  37. tescmd/openclaw/filters.py +123 -0
  38. tescmd/openclaw/gateway.py +700 -0
  39. tescmd/openclaw/telemetry_store.py +53 -0
  40. tescmd/output/rich_output.py +46 -14
  41. tescmd/protocol/commands.py +2 -2
  42. tescmd/protocol/encoder.py +16 -13
  43. tescmd/protocol/payloads.py +132 -11
  44. tescmd/protocol/session.py +8 -5
  45. tescmd/protocol/signer.py +3 -17
  46. tescmd/telemetry/__init__.py +9 -0
  47. tescmd/telemetry/cache_sink.py +154 -0
  48. tescmd/telemetry/csv_sink.py +180 -0
  49. tescmd/telemetry/dashboard.py +4 -4
  50. tescmd/telemetry/fanout.py +49 -0
  51. tescmd/telemetry/fields.py +308 -129
  52. tescmd/telemetry/mapper.py +239 -0
  53. tescmd/telemetry/server.py +26 -19
  54. tescmd/telemetry/setup.py +468 -0
  55. tescmd/telemetry/tailscale.py +78 -16
  56. tescmd/telemetry/tui.py +1716 -0
  57. tescmd/triggers/__init__.py +18 -0
  58. tescmd/triggers/manager.py +264 -0
  59. tescmd/triggers/models.py +93 -0
  60. tescmd-0.4.0.dist-info/METADATA +300 -0
  61. {tescmd-0.2.0.dist-info → tescmd-0.4.0.dist-info}/RECORD +64 -42
  62. tescmd-0.2.0.dist-info/METADATA +0 -495
  63. {tescmd-0.2.0.dist-info → tescmd-0.4.0.dist-info}/WHEEL +0 -0
  64. {tescmd-0.2.0.dist-info → tescmd-0.4.0.dist-info}/entry_points.txt +0 -0
  65. {tescmd-0.2.0.dist-info → tescmd-0.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,4 @@
1
- tescmd/__init__.py,sha256=o_SIbXUPkIxWQmUmtk7DOL4K90g-89A7oWcV4n0DO2Q,116
1
+ tescmd/__init__.py,sha256=5McRfiCZ4XFvlU9hlnml5SecuYhXarzh3HAVGhcE0ZQ,116
2
2
  tescmd/__main__.py,sha256=ecNCDo0sINhjJZiauhAcUMU67U6XUCU23ocf7vQG45E,83
3
3
  tescmd/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  tescmd/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -7,82 +7,101 @@ tescmd/_internal/permissions.py,sha256=cawM9XIHJKNqi5cGYssF5iPNi_F4gONLhyLOJCbzZ
7
7
  tescmd/_internal/vin.py,sha256=VlliRJzsq0in7Sny-i-ng6rMkNjCD-rJ6sIHiq3uxT8,1133
8
8
  tescmd/api/__init__.py,sha256=OPKuH6YMSJU5PO4_0cuTXx5KYTmc0aR3SU8z695AZ7U,36
9
9
  tescmd/api/charging.py,sha256=Se58NcLTSxCNZvpBCMJswMoI-bYhWV_MM4LHmry9_Tw,3464
10
- tescmd/api/client.py,sha256=fZbrGSwa8UqgPosFaZwRyCOxni7fCs7sGtEkZcIP6gg,7183
11
- tescmd/api/command.py,sha256=TpVb2raih3S_cYopJmmm4bV_O0WDB1NgQQkr_yuBRNA,22402
10
+ tescmd/api/client.py,sha256=8llA_Z1zw2b2l5jzBEAvCL-AIEhJfy26wRwqmesxCKU,8980
11
+ tescmd/api/command.py,sha256=s8HRqz-rLvfV42Ib-VHobRoOXHafb2HJsUlD9PyLpF0,22414
12
12
  tescmd/api/energy.py,sha256=_XOv-er9379Cza8IkE5Gjtc1FyzwsLfPdsPQR2rA1Us,5562
13
- tescmd/api/errors.py,sha256=B2Q9k5Z8caj7YzgkwN9nfeH0-inb-Tlngzg2fkpEJY4,2163
13
+ tescmd/api/errors.py,sha256=nSvkf-NKEWMDKx3wrmMJXh7qEAQhoUVzrKHLKpt129Y,2351
14
14
  tescmd/api/partner.py,sha256=f5VWMY8V5oeiDcYduq7zxihWacdzCd6wBtPIXXwwkzY,1405
15
15
  tescmd/api/sharing.py,sha256=qjlP3B8jo4hYqNOIiXiDYHxUwMHT3FAz87SLH8Y6fSM,2475
16
- tescmd/api/signed_command.py,sha256=hMegcCnoYub0eQ3rRq0_-990tgfaWeZSWTbnQDQ_wwY,10136
16
+ tescmd/api/signed_command.py,sha256=lgmy1LpkWzRT4ExYVnbuSVcHeI6uqBXkBjTC1lF6_8s,10444
17
17
  tescmd/api/user.py,sha256=pz4sB9i-9pHukdIBOwGrgfRpWf4zd5gnqAqm3zAJpcA,1411
18
18
  tescmd/api/vehicle.py,sha256=esCCnyWyUz7QNGfzmbrGx824YZkDmSI_LsemsA6faDU,7377
19
19
  tescmd/auth/__init__.py,sha256=PHsT1-mgm9b-4xft0-adq3i6fwyCSj2of4KTpMAYUhw,76
20
- tescmd/auth/oauth.py,sha256=kgp_-Zk7zJqLIpSB9yOZLIWjXdD7WnG7nvyfZC0lKFY,9820
21
- tescmd/auth/server.py,sha256=3h8NELWNMe9DfMu7NsfA00sc34D6mGoaFQTqPSOOdzE,3602
22
- tescmd/auth/token_store.py,sha256=v2rx3oj3dwaMn8-yz_ge8RD22joUmfP_ZJ4rhJaUw0g,8695
20
+ tescmd/auth/oauth.py,sha256=-jWFC0uYYswreiV2WjDBE_-sQlSggYC8ARbpDrfzTv0,10446
21
+ tescmd/auth/server.py,sha256=34j6cXGkp3K7It4m3uCjvMYv82tRXYS80Xd2GQ_DPAk,3751
22
+ tescmd/auth/token_store.py,sha256=jju5IzdeXQK1pFuxX-bMhBuMRAZKcP0m-hM8arARpUU,8906
23
23
  tescmd/ble/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  tescmd/cache/__init__.py,sha256=V-oZyDgU4Dr6cExNVdGcsEbF6hrnOYml7VV6ZoOiyJY,249
25
25
  tescmd/cache/keys.py,sha256=dcof4GM1gZEADNBx8xHtjCCIK_4ra3FxPeRVJYPoFow,1736
26
- tescmd/cache/response_cache.py,sha256=HYbAkT2uIUQf3rNUiEZdW6wW6iq45w8nPyo9oY9dlJM,7385
26
+ tescmd/cache/response_cache.py,sha256=5M5atqQxv1FQou7iP7eNyTgv54zBVStgO62veetSlhw,7636
27
27
  tescmd/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- tescmd/cli/_client.py,sha256=lr_ugunILZLLklPQ3syO3nGqzmyqxNh93eFQtxbVojs,21503
29
- tescmd/cli/_options.py,sha256=lM4-lvVDLv89PahshWIRRoNUXBki4DOabt_pYaPlK-U,4175
30
- tescmd/cli/auth.py,sha256=GK0_8n4fCQtFgOYoFN9YpHKlmbMCcHsNonlQcEAvqjk,23168
28
+ tescmd/cli/_client.py,sha256=r4jJ1mnRX96PcKrCH3o3EMxVofCxgMkfBSRe8TwgtTg,25761
29
+ tescmd/cli/_options.py,sha256=Ob-tdg2IftP6skZDGGeFwBXYIA6I_7bnUfag3xyT9VM,4166
30
+ tescmd/cli/auth.py,sha256=9bp0gRwn2Z4n2jRBzVMqx8ptDEQgLk2xO-plLWnMXfE,29713
31
31
  tescmd/cli/billing.py,sha256=BcuAI10Q2Tf6fobejoKsaO4qVN7TcOy95HSdylBn23M,7946
32
32
  tescmd/cli/cache.py,sha256=LaOOfHS1ycF8LoCFdcUQfw11PYor2S__-SdWtRpA_pA,2729
33
33
  tescmd/cli/charge.py,sha256=TOXRn7YGuFYj5GimBhh2bTOB_5vzU5sc86PODifHXGk,20088
34
34
  tescmd/cli/climate.py,sha256=npekNHOcJ63oG1-2o-fZiTRWFmemdZ1Tl_pASWwWBlI,16890
35
- tescmd/cli/energy.py,sha256=L7I1o3BucT71MGSsdYENN40iQKANXioNcUK19mj9wz8,11855
36
- tescmd/cli/key.py,sha256=ehxbxtTQ7pj6vAoqR3P8ak0FE0-nmQQm4TDAX878n1M,26356
37
- tescmd/cli/main.py,sha256=OmSso0JRCPFnt5bFYMbBlVcK1vbQxA3lETmC0OicTmk,21750
35
+ tescmd/cli/energy.py,sha256=YUv-_UnbUu7u5nko15MSrS5s9bU6Y58IszVfURXRr34,11931
36
+ tescmd/cli/key.py,sha256=bIiBJG3Xu0xhvvg33VpAjLUuQCORQg2u9ajzhApAoAo,26304
37
+ tescmd/cli/main.py,sha256=WmERuesvxcmpI8zlgOAeSYw3KgEApAZMbiCasxJa7z4,22502
38
+ tescmd/cli/mcp_cmd.py,sha256=K6siov7O-dzyZKuHFHFpYraRE9uMcG13obWmdyND6DQ,4644
38
39
  tescmd/cli/media.py,sha256=PQ-QJkjkIiM8IJ5CXtDOY0N1yC3DlaC5YLnebxT1nrI,4267
39
- tescmd/cli/nav.py,sha256=22UxJDltcE9S3SfrLwtBfh51HDEm8vxun0KrQzTvZz0,7519
40
+ tescmd/cli/nav.py,sha256=JJr4uynwrBHZn1p2zuWlPEeGJPtyHFy7nlAwyij_QbA,7551
41
+ tescmd/cli/openclaw.py,sha256=_xe8hZ_ToQ8WmohlrUVEXtq_RD_Q_6B3wXDjx_Xy2yg,5388
40
42
  tescmd/cli/partner.py,sha256=0GfDCwM_Kfy5g95JwUhrrsjDFn9lSbkuNgfquIQqcSo,3488
41
43
  tescmd/cli/raw.py,sha256=hj5hZs8tHHHAeXtpf7kHXewciXDvl0RlMJkPK7i3ouY,2238
42
- tescmd/cli/security.py,sha256=laoRaF2mBda5q_jWCXyBjNCU98hsQ2Pr1a_MNWdQF3E,15713
43
- tescmd/cli/setup.py,sha256=AVl3NLfM8yCHfqyfhu9d_Jyb3F53CkdP6e3VfnAOisU,32722
44
- tescmd/cli/sharing.py,sha256=IIhkPlLb8sKkPmgMKVDgWTndCd5ZRvgKnZbknxYCBFc,6211
44
+ tescmd/cli/security.py,sha256=uHowY0b7CH7Ff0LdzqBHL4rjyM6W9AYXC_N9EXvE7pA,15937
45
+ tescmd/cli/serve.py,sha256=dM61NpiON3ZcJ-HT1D_RNUN6d8fpr6OnvVJyvpTT9lU,33358
46
+ tescmd/cli/setup.py,sha256=Ep1iaUiF9NIUDXGsY6m3gxNFgEjiHsJeK60-tPWzpbA,35979
47
+ tescmd/cli/sharing.py,sha256=9H3MSM1ZvPq4sBPSyvgUXHTvwm1IUAh8PrIu71ZV1GY,6294
45
48
  tescmd/cli/software.py,sha256=f3Jl5GRruE_wNHl3jfLbVQHEXQvQxe4y-UaNIY1j76Y,2711
46
- tescmd/cli/status.py,sha256=T6YoG_BE24fJSmc24Uhw0IdH5mUUDySgGjn9s1LY8yc,4003
47
- tescmd/cli/trunk.py,sha256=8ktL7_TpTXphQdrjHMUeDAP149ULB3naZvUFOoBh880,7577
48
- tescmd/cli/user.py,sha256=eit0pQhku1l53x3Gl4um6l6c_wgFl9dU7OhyFd1g4gQ,4100
49
- tescmd/cli/vehicle.py,sha256=JUGY4Ey9qJ4AJ-6P-5UUG_RJoyfYyONciPq8l8hM41I,46083
49
+ tescmd/cli/status.py,sha256=_Ql5oMA6j03g16acjtWbFWk6v-pfMJhlTdCNmq7MPh4,3997
50
+ tescmd/cli/trunk.py,sha256=JOG9bllsFbZ0hu-hTnVQ9DCziHocISx4AfiWMHkwagU,7076
51
+ tescmd/cli/user.py,sha256=HVMO9Bfn3YSkBRnvzbUi_5Z3XuOcD30M22mwcVCV-e0,4736
52
+ tescmd/cli/vehicle.py,sha256=wxdSebvqauMhvrS8CLMF8q5Thwkean9PYrdPHlrUt0U,31767
50
53
  tescmd/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
54
  tescmd/crypto/__init__.py,sha256=ZcXLJ9OOATi7R8m9zD3K8R5Zj0QBPq6QUavpUPetn18,499
52
55
  tescmd/crypto/ecdh.py,sha256=xFe4BR1G5CznwLUJnWvOWr_ZHsWUpdu9IJlL3-LaAk4,1759
53
56
  tescmd/crypto/keys.py,sha256=jzFZwZKMYFlHGPeTSrw5pVLBwjxvLV57LzTK9d4-caM,4037
54
57
  tescmd/crypto/schnorr.py,sha256=qgISnRMDrH-LkinjLoapV8wsoVNdwBnCZvLPMgGIGyo,6626
55
58
  tescmd/deploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
- tescmd/deploy/github_pages.py,sha256=8W0Xjn8XIuLAHhiEDo-Zn6KrlbgdkVAe_2wWxdDS4_Y,8150
57
- tescmd/deploy/tailscale_serve.py,sha256=2wBHTmpF3pXtasKCI9uWCkGtHCUZL1e_keuy3H0E3Dg,4771
59
+ tescmd/deploy/github_pages.py,sha256=i5M6U0SxYyasPx-MqG8hW8cJqYqKTrXde-P1cSBI8SQ,8756
60
+ tescmd/deploy/tailscale_serve.py,sha256=IOWgmhRp7fF6oZA-sLihsen-o7aLxDxB5BOFfoDSsO0,7839
61
+ tescmd/mcp/__init__.py,sha256=zHLbMTNRql4hy1jNMc1zD6P0AzX8vFzgjm5QCAZSsQg,172
62
+ tescmd/mcp/server.py,sha256=o0cD1xMNyt8qmGZhN5O7cWTQTdBd9FTaOpQPzpVT3Xw,25414
58
63
  tescmd/models/__init__.py,sha256=mo6ngQp9m-244UGykbgY-DoqnunLD4DwEqHdJwP9GLc,1767
59
- tescmd/models/auth.py,sha256=lVfJa6BgxbSbo7rAziGbh8tGy598yfRqm8I7jXpb4_M,3456
64
+ tescmd/models/auth.py,sha256=k9co3JLbQU3vbwv7TixAZbnmURyskOP9gWJratE_678,3614
60
65
  tescmd/models/command.py,sha256=6gK9TjThXU5cKa_B3xOYpaLaGixxYp5iEhjQEMlh0Ws,388
61
66
  tescmd/models/config.py,sha256=BjL_oJjyH7vsJY0JruDb0Z8nMRiDB1m34KYqmRBYD6E,2001
62
67
  tescmd/models/energy.py,sha256=xj1nEdEHGkfrj4Wd-pDKZKZna40r7R58huowqoPMeZk,1237
63
68
  tescmd/models/sharing.py,sha256=sJv4fCRT5AUkcqmdK8bN2Y8hpuHITEnxNp_BlbX7L4Y,609
64
69
  tescmd/models/user.py,sha256=2hATFqUppheKtWDFg3axIRmxX0gmPTdwgMwZJGSQhtc,770
65
70
  tescmd/models/vehicle.py,sha256=GXkQOAB406JQI4vI7xhEbWB1hK5H0SLhzwtJEXPEsTw,5733
71
+ tescmd/openclaw/__init__.py,sha256=J4Fb8zs69-KQTKgUZVm3MOhvKAafHGhIFF50NxqGNa4,722
72
+ tescmd/openclaw/bridge.py,sha256=_HYO4L5J7aHS4BPIbRumcaHpPHHoIFGzgrVAtOGWT9Y,11665
73
+ tescmd/openclaw/config.py,sha256=73lH7f8hNXJvpUdQcYEdNyz8wTtudTsP1nskw4ybekg,5643
74
+ tescmd/openclaw/dispatcher.py,sha256=LuBsriutiMSOsOIVDCHg0L0RUdXrX_n1n9TTIjZ6CSo,22295
75
+ tescmd/openclaw/emitter.py,sha256=IAY_0tYduXif1JOcWtqhuGeYNN3irDNsnRWrzMdLnXU,6001
76
+ tescmd/openclaw/filters.py,sha256=QJeM8I0Sx_7Hjg4Uy7UjkIU7mAYScMRi_WGzUBnmw0w,4020
77
+ tescmd/openclaw/gateway.py,sha256=pTQ5ZG3PPjXhwmljU4DlsMCe4By4HwOUkTKnMnsCU38,24301
78
+ tescmd/openclaw/telemetry_store.py,sha256=C3VLUstw1_6nKFKGZJgvuWaaYXdclX0K1rbaDT4Rkls,1696
66
79
  tescmd/output/__init__.py,sha256=uFvlXwHmKHkxOIVgP8JryZlQbHLHhbhLGswGo9xuFbI,120
67
80
  tescmd/output/formatter.py,sha256=pQLes-gZJbD4S32-fRwKqcLepsiXb9AIWP-Wm_H1ca0,4658
68
81
  tescmd/output/json_output.py,sha256=4NFuBGn8383xoQ6NbKEgNr6MCE6bF9YaBqKydrPL_e0,2297
69
- tescmd/output/rich_output.py,sha256=gwuAdaahaDx9CDXwuFAjCfjgyYd0itDG3OCQIhVbNM8,31579
82
+ tescmd/output/rich_output.py,sha256=Y3lGLstdC3NL1YjvmPxg6oaTUBAAevKHLwaJPfJ3AvE,32656
70
83
  tescmd/protocol/__init__.py,sha256=VpqeFrWNDs2DxPtFNSFmlu_d-GmioY4_PNKtNuLCqx4,545
71
- tescmd/protocol/commands.py,sha256=_pXDyXAUZYAJyIrgsmLlxnRrBXajnFWtDB6JDuR9fPU,8657
72
- tescmd/protocol/encoder.py,sha256=L4_qtsn1cSi3BbkDvTj1JjFuviXKIvrKtuJzlBud8XA,3543
84
+ tescmd/protocol/commands.py,sha256=yaQdLz7w4nRU0EFUgGSqe_pfw3IrWJuMIa-72v4ftxA,8657
85
+ tescmd/protocol/encoder.py,sha256=KH_9pDhOkWQ_Z7VGVv2t8V75C_QOm9q8mK77cOgwxMY,3538
73
86
  tescmd/protocol/metadata.py,sha256=Hb9QaoGRz54z04bKIQigSD5vJKphQNLu3bcUHEW_tl8,4076
74
- tescmd/protocol/payloads.py,sha256=l1DiJjdkDsXurs-QSfe8s-mwyCxCOrk6syZhvjei4Io,24093
75
- tescmd/protocol/session.py,sha256=s8eiyxb2mdYnKN1w5dRU8DCpolrcpU3pbW7z8GKXm4w,11682
76
- tescmd/protocol/signer.py,sha256=L-OVqCk9XZBuFrLGeATzJSqzMm5JWfOde4hRgL8_xAs,2794
87
+ tescmd/protocol/payloads.py,sha256=osDZxcroYTFk0dmD_Zyx6V1fxIGdMTG4izAU8q7bxng,29072
88
+ tescmd/protocol/session.py,sha256=9AlZiAUX_bnB8JVulmKkaRPDAzcoCFKsWnyWrjqDnWc,11935
89
+ tescmd/protocol/signer.py,sha256=uv1O-A3cWPSXFbAdvEK-XZSLb5SHRRDldDnjTlxJM0k,2357
77
90
  tescmd/protocol/protobuf/__init__.py,sha256=hAvTsN4tkJMoKhLsjnrO_XepHbhrK7PfymBCpah9hUg,291
78
91
  tescmd/protocol/protobuf/messages.py,sha256=8vBH8i-1--FrR5ydSJFAn9UwNMIrSkm6henqWkOMXxU,21124
79
- tescmd/telemetry/__init__.py,sha256=DC0rddsgzFjwHhBstkDJXq_6By3l6fLeX_0AKZy5rMc,568
80
- tescmd/telemetry/dashboard.py,sha256=A4Kqr-fulLqYgYH84zxDj1FXc1Mf9XtzvDuXjo6HJXA,8267
92
+ tescmd/telemetry/__init__.py,sha256=ssX8KzG891GFLnujGuWqKj08bGoqhzXPUC0esGxQK94,897
93
+ tescmd/telemetry/cache_sink.py,sha256=PpCaXSmvZQE_uNWuWaDUtvYpf_B7wMRei1Nxa8CFrM4,5091
94
+ tescmd/telemetry/csv_sink.py,sha256=8G9zxWLy6M2EWNaOeEa7wmwE5PI6FyNtXY2A1Ry0Xwg,5736
95
+ tescmd/telemetry/dashboard.py,sha256=HfCAYuGCTL57-5nFaBEqIdr2H8gy872-BvRYkM5yrT8,8278
81
96
  tescmd/telemetry/decoder.py,sha256=sk7EYFXjPQ1Qrq8Yqa0F_dYNg5-WA_w2mc6BI2aPuQg,9592
82
- tescmd/telemetry/fields.py,sha256=oH82jKjRe8x_iy70J_dwFbxjVQSQaUZWnHsu2m8HT4I,8125
97
+ tescmd/telemetry/fanout.py,sha256=P0TorS9ssN1IrHcVFayhUVOExLACq0dOrfB9MxLte5I,1538
98
+ tescmd/telemetry/fields.py,sha256=78-9mtIVIsOdcyrV-LrntMpxPuE5T5vHuw418iKPrCA,14128
83
99
  tescmd/telemetry/flatbuf.py,sha256=2q4LvlL6SAabTrQg7bS5qrgokO9GylenWQKna363th8,5508
84
- tescmd/telemetry/server.py,sha256=p5qCdJKfQecMRMCtsKjopxXJHx8mBLBF6_EwQaF6fY8,10220
85
- tescmd/telemetry/tailscale.py,sha256=OLbDdEKhIMkVAJRxGRdsez648NKImbzmSYFuWmz1os8,10497
100
+ tescmd/telemetry/mapper.py,sha256=rBoJojr2s27pOPXcYHo7ASc82SJagpZ-YD8dGFd0pTg,9483
101
+ tescmd/telemetry/server.py,sha256=kcl7zJpjTuRIbhgPwWU4K8vvhXWJ-oUAmSNOdPY3x2k,10647
102
+ tescmd/telemetry/setup.py,sha256=d8owu8a72-4MO7QyFfOa99D6YzOBoCrIGVNuAduTEw0,17008
103
+ tescmd/telemetry/tailscale.py,sha256=DmfUXg5OwppE_MnPmX7VJMqJJOZHR2GVz5WY2FMlk00,13014
104
+ tescmd/telemetry/tui.py,sha256=Ka0PuMCcAvDfXMfvNi82k0ESNR0KWEt9hw3hDOG0e8g,64505
86
105
  tescmd/telemetry/protos/__init__.py,sha256=VAyp9-euADAEHyi533DRswRK5yEGdL08nXCTiWysgqM,150
87
106
  tescmd/telemetry/protos/vehicle_alert.proto,sha256=NZnGi1-PGYBf6JpKD0ptynVOh2AOthRXfsAcvYsLLN4,708
88
107
  tescmd/telemetry/protos/vehicle_alert_pb2.py,sha256=s0XzDPekU7V2w3j22EKMeOYNIEEv93PADGJhLufU-ag,2369
@@ -99,8 +118,11 @@ tescmd/telemetry/protos/vehicle_error_pb2.pyi,sha256=RCYvv4jx4yF7kTarLEDoBz4Iayy
99
118
  tescmd/telemetry/protos/vehicle_metric.proto,sha256=eFuBVRnhNfP6ef9KlxPMQKPH9xvsEPoF1n9q2Khbn4s,515
100
119
  tescmd/telemetry/protos/vehicle_metric_pb2.py,sha256=uFg2RgxwMy-ZRnlq5bK-_MbiTowrJS2idbP4koiXyWQ,2340
101
120
  tescmd/telemetry/protos/vehicle_metric_pb2.pyi,sha256=hFjmnO_D41FYO39NvCakOczCGLVVNm0WGavbnaHXkqI,1676
102
- tescmd-0.2.0.dist-info/METADATA,sha256=NUeaLIWUmYjqETYZ7xV9D9UMS6eQYsGhAFHCNUJVInw,25156
103
- tescmd-0.2.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
104
- tescmd-0.2.0.dist-info/entry_points.txt,sha256=e-Uk81_gfLu4XzJl9bv6-bUIodJbnxAgfR5ugFyeD2E,48
105
- tescmd-0.2.0.dist-info/licenses/LICENSE,sha256=gFEbRZ5xHSPxkT3OgbLFhDWVUxZv80kFDnv0t3G1E7M,1070
106
- tescmd-0.2.0.dist-info/RECORD,,
121
+ tescmd/triggers/__init__.py,sha256=kFFbRlhCDbYtE_kZ_A65dcxzpvuDsgYZpYgATNggAgc,432
122
+ tescmd/triggers/manager.py,sha256=xon72FVI37JaqtNroRg_B8pn62zv2cuO3iREcESsnsM,8418
123
+ tescmd/triggers/models.py,sha256=t-Bg7renbVaXKDtxPna2z4bdUhJ1_5wGMs4ahwHPVhM,2812
124
+ tescmd-0.4.0.dist-info/METADATA,sha256=-emZGYAYJ7gWthCwpUguC56PWnFFsJ4nkHeOBD8FAF0,11762
125
+ tescmd-0.4.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
126
+ tescmd-0.4.0.dist-info/entry_points.txt,sha256=e-Uk81_gfLu4XzJl9bv6-bUIodJbnxAgfR5ugFyeD2E,48
127
+ tescmd-0.4.0.dist-info/licenses/LICENSE,sha256=gFEbRZ5xHSPxkT3OgbLFhDWVUxZv80kFDnv0t3G1E7M,1070
128
+ tescmd-0.4.0.dist-info/RECORD,,
@@ -1,495 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: tescmd
3
- Version: 0.2.0
4
- Summary: A Python CLI for querying and controlling Tesla vehicles via the Fleet API
5
- Project-URL: Homepage, https://github.com/oceanswave/tescmd
6
- Project-URL: Repository, https://github.com/oceanswave/tescmd
7
- Project-URL: Issues, https://github.com/oceanswave/tescmd/issues
8
- Project-URL: Documentation, https://github.com/oceanswave/tescmd#readme
9
- Author: oceanswave
10
- License-Expression: MIT
11
- License-File: LICENSE
12
- Keywords: cli,ev,fleet-api,tesla,vehicle
13
- Classifier: Development Status :: 4 - Beta
14
- Classifier: Environment :: Console
15
- Classifier: Intended Audience :: Developers
16
- Classifier: License :: OSI Approved :: MIT License
17
- Classifier: Operating System :: OS Independent
18
- Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.11
20
- Classifier: Programming Language :: Python :: 3.12
21
- Classifier: Programming Language :: Python :: 3.13
22
- Classifier: Topic :: Software Development :: Libraries
23
- Classifier: Typing :: Typed
24
- Requires-Python: >=3.11
25
- Requires-Dist: click>=8.1
26
- Requires-Dist: cryptography>=42.0
27
- Requires-Dist: httpx>=0.27
28
- Requires-Dist: keyring>=25.0
29
- Requires-Dist: protobuf>=5.29
30
- Requires-Dist: pydantic-settings>=2.0
31
- Requires-Dist: pydantic>=2.0
32
- Requires-Dist: python-dotenv>=1.0
33
- Requires-Dist: rich>=13.0
34
- Provides-Extra: ble
35
- Requires-Dist: bleak>=0.22; extra == 'ble'
36
- Provides-Extra: dev
37
- Requires-Dist: build>=1.0; extra == 'dev'
38
- Requires-Dist: grpcio-tools>=1.68; extra == 'dev'
39
- Requires-Dist: mypy-protobuf>=3.6; extra == 'dev'
40
- Requires-Dist: mypy>=1.13; extra == 'dev'
41
- Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
42
- Requires-Dist: pytest-cov>=5.0; extra == 'dev'
43
- Requires-Dist: pytest-httpx>=0.34; extra == 'dev'
44
- Requires-Dist: pytest-xdist>=3.0; extra == 'dev'
45
- Requires-Dist: pytest>=8.0; extra == 'dev'
46
- Requires-Dist: ruff>=0.8; extra == 'dev'
47
- Provides-Extra: telemetry
48
- Requires-Dist: websockets>=14.0; extra == 'telemetry'
49
- Description-Content-Type: text/markdown
50
-
51
- # tescmd
52
-
53
- [![PyPI](https://img.shields.io/pypi/v/tescmd)](https://pypi.org/project/tescmd/)
54
- [![Python](https://img.shields.io/pypi/pyversions/tescmd)](https://pypi.org/project/tescmd/)
55
- [![Build](https://img.shields.io/github/actions/workflow/status/oceanswave/tescmd/test.yml?branch=main&label=build)](https://github.com/oceanswave/tescmd/actions/workflows/test.yml)
56
- [![License](https://img.shields.io/github/license/oceanswave/tescmd)](LICENSE)
57
- [![GitHub Release](https://img.shields.io/github/v/release/oceanswave/tescmd)](https://github.com/oceanswave/tescmd/releases)
58
-
59
- A Python CLI for querying and controlling Tesla vehicles via the Fleet API — built for both human operators and AI agents.
60
-
61
- ## Why tescmd?
62
-
63
- Tesla's Fleet API gives developers full access to vehicle data and commands, but working with it directly means juggling OAuth2 PKCE flows, token refresh, regional endpoints, key enrollment, and raw JSON responses. tescmd wraps all of that into a single command-line tool that handles authentication, token management, and output formatting so you can focus on what you actually want to do — check your battery, find your car, or control your vehicle.
64
-
65
- tescmd is designed to work as a tool that AI agents can invoke directly. Platforms like [OpenClaw](https://openclaw.ai/), [Claude Desktop](https://claude.ai), and other agent frameworks can call tescmd commands, parse the structured JSON output, and take actions on your behalf — "lock my car", "what's my battery at?", "start climate control". The deterministic JSON output, meaningful exit codes, cost-aware wake confirmation, and `--wake` opt-in flag make it safe for autonomous agent use without surprise billing.
66
-
67
- ## Features
68
-
69
- - **Vehicle state queries** — battery, range, charge status, climate, location, doors, windows, trunks, tire pressure, dashcam, sentry mode, and more
70
- - **Vehicle commands** — charge start/stop/limit/departure scheduling, climate on/off/set temp/seats/steering wheel, lock/unlock, sentry mode, trunk/frunk, windows, HomeLink, navigation waypoints, media playback, speed limits, PIN management
71
- - **Vehicle Command Protocol** — ECDH session management with HMAC-SHA256 signed commands via the `signed_command` endpoint; automatically used when keys are enrolled
72
- - **Key enrollment** — `tescmd key enroll <VIN>` sends your public key to the vehicle and guides you through Tesla app approval
73
- - **Tier enforcement** — readonly tier blocks write commands with clear guidance to upgrade
74
- - **Energy products** — Powerwall live status, site info, backup reserve, operation mode, storm mode, time-of-use settings, charging history, calendar history, grid import/export
75
- - **User & sharing** — account info, region, orders, feature flags, driver management, vehicle sharing invites
76
- - **Fleet Telemetry streaming** — `tescmd vehicle telemetry stream` starts a real-time dashboard with push-based data from your vehicle via Tailscale Funnel — no polling, 99%+ cost reduction
77
- - **Universal response caching** — all read commands are cached with tiered TTLs (1h for specs/warranty, 5m for fleet lists, 1m standard, 30s for location-dependent); bots can call tescmd as often as needed — within the TTL window, responses are instant and free
78
- - **Cost-aware wake** — prompts before sending billable wake API calls; `--wake` flag for scripts that accept the cost
79
- - **Guided OAuth2 setup** — `tescmd auth login` walks you through browser-based authentication with PKCE
80
- - **Key management** — generate EC keys, register via Tesla Developer Portal (remote) or BLE enrollment (proximity)
81
- - **Rich terminal output** — tables, panels, spinners powered by Rich; auto-detects TTY vs pipe
82
- - **Configurable display units** — switch between PSI/bar, °F/°C, and mi/km (defaults to US units)
83
- - **JSON output** — structured output for scripting and agent integration
84
- - **Multi-profile** — switch between vehicles, accounts, and regions with named profiles
85
- - **Agent-friendly** — deterministic JSON, meaningful exit codes, `--wake` opt-in, headless auth support
86
-
87
- ## Quick Start
88
-
89
- ```bash
90
- pip install tescmd
91
- tescmd setup
92
- ```
93
-
94
- That's it. The interactive setup wizard walks you through everything: creating a Tesla Developer app, generating an EC key pair, hosting the public key (via GitHub Pages or Tailscale Funnel), registering with the Fleet API, authenticating via OAuth2, and enrolling your key on a vehicle. Each step checks prerequisites and offers remediation if something is missing.
95
-
96
- After setup completes, you can start using commands:
97
-
98
- ```bash
99
- tescmd charge status # Check battery and charging state
100
- tescmd vehicle info # Full vehicle data snapshot
101
- tescmd climate on --wake # Turn on climate (wakes vehicle if asleep)
102
- tescmd security lock --wake # Lock the car
103
- tescmd vehicle telemetry stream # Real-time telemetry dashboard
104
- ```
105
-
106
- Every read command is cached — repeat calls within the TTL window are instant and free.
107
-
108
- ## Prerequisites
109
-
110
- The following tools should be installed and authenticated before running `tescmd setup`:
111
-
112
- | Tool | Required | Purpose | Auth |
113
- |------|----------|---------|------|
114
- | **Git** | Yes | Version control, repo management | N/A |
115
- | **GitHub CLI** (`gh`) | Recommended | Auto-creates `*.github.io` domain for key hosting | `gh auth login` |
116
- | **Tailscale** | Optional | Key hosting via Funnel + Fleet Telemetry streaming | `tailscale login` |
117
-
118
- Without the GitHub CLI, `tescmd setup` will try Tailscale Funnel for key hosting (requires Funnel enabled in your tailnet ACL). Without either, you'll need to manually host your public key at the Tesla-required `.well-known` path on your own domain.
119
-
120
- For telemetry streaming, you need **Tailscale** with Funnel enabled.
121
-
122
- ## Installation
123
-
124
- ### From PyPI
125
-
126
- ```bash
127
- pip install tescmd
128
- ```
129
-
130
- ### From Source
131
-
132
- ```bash
133
- git clone https://github.com/oceanswave/tescmd.git
134
- cd tescmd
135
- pip install -e ".[dev]"
136
- ```
137
-
138
- ## Configuration
139
-
140
- tescmd resolves settings in this order (highest priority first):
141
-
142
- 1. **CLI arguments** — `--vin`, `--region`, `--format`, `--units`, etc.
143
- 2. **Environment variables** — `TESLA_VIN`, `TESLA_REGION`, etc. (`.env` files loaded automatically)
144
- 3. **Defaults**
145
-
146
- ### Environment Variables
147
-
148
- Create a `.env` file in your working directory or `~/.config/tescmd/.env`:
149
-
150
- ```dotenv
151
- TESLA_CLIENT_ID=your-client-id
152
- TESLA_CLIENT_SECRET=your-client-secret
153
- TESLA_VIN=5YJ3E1EA1NF000000
154
- TESLA_REGION=na
155
-
156
- # Token storage (optional — defaults to OS keyring with file fallback)
157
- TESLA_TOKEN_FILE=~/.config/tescmd/tokens.json
158
-
159
- # Cache settings (optional)
160
- TESLA_CACHE_ENABLED=true
161
- TESLA_CACHE_TTL=60
162
- TESLA_CACHE_DIR=~/.cache/tescmd
163
-
164
- # Command protocol: auto | signed | unsigned (optional)
165
- TESLA_COMMAND_PROTOCOL=auto
166
-
167
- # Display units (optional — defaults to US units)
168
- TESLA_TEMP_UNIT=F # F or C
169
- TESLA_DISTANCE_UNIT=mi # mi or km
170
- TESLA_PRESSURE_UNIT=psi # psi or bar
171
- ```
172
-
173
- ## Token Storage
174
-
175
- By default, tescmd stores OAuth tokens in the OS keyring (macOS Keychain, GNOME Keyring, Windows Credential Manager). On headless systems where no keyring daemon is available (Docker, CI, SSH sessions), tescmd automatically falls back to a file-based store at `~/.config/tescmd/tokens.json` with restricted permissions (`0600` on Unix, owner-only ACL on Windows).
176
-
177
- You can force file-based storage by setting `TESLA_TOKEN_FILE`:
178
-
179
- ```bash
180
- export TESLA_TOKEN_FILE=~/.config/tescmd/tokens.json
181
- ```
182
-
183
- To transfer tokens between machines, use `auth export` and `auth import`:
184
-
185
- ```bash
186
- # On source machine
187
- tescmd auth export > tokens.json
188
-
189
- # On target machine (Docker, CI, etc.)
190
- tescmd auth import < tokens.json
191
- ```
192
-
193
- Check which backend is active with `tescmd status` — the output includes a `Token store` line showing `keyring` or the file path.
194
-
195
- > **Security note:** File-based tokens are stored as plaintext JSON. The file is created with owner-only permissions, but treat it like any other credential file.
196
-
197
- ## Commands
198
-
199
- | Group | Commands | Description |
200
- |---|---|---|
201
- | `setup` | *(interactive wizard)* | First-run configuration: client ID, secret, region, domain, key enrollment |
202
- | `auth` | `login`, `logout`, `status`, `refresh`, `register`, `export`, `import` | OAuth2 authentication lifecycle |
203
- | `vehicle` | `list`, `get`, `info`, `data`, `location`, `wake`, `rename`, `mobile-access`, `nearby-chargers`, `alerts`, `release-notes`, `service`, `drivers`, `calendar`, `subscriptions`, `upgrades`, `options`, `specs`, `warranty`, `fleet-status`, `low-power`, `accessory-power`, `telemetry {config,create,delete,errors,stream}` | Vehicle discovery, state queries, fleet telemetry streaming, power management |
204
- | `charge` | `status`, `start`, `stop`, `limit`, `limit-max`, `limit-std`, `amps`, `port-open`, `port-close`, `schedule`, `departure`, `precondition-add`, `precondition-remove`, `add-schedule`, `remove-schedule`, `clear-schedules`, `clear-preconditions`, `managed-amps`, `managed-location`, `managed-schedule` | Charge queries, control, scheduling, and fleet management |
205
- | `billing` | `history`, `sessions`, `invoice` | Supercharger billing history and invoices |
206
- | `climate` | `status`, `on`, `off`, `set`, `precondition`, `seat`, `seat-cool`, `wheel-heater`, `overheat`, `bioweapon`, `keeper`, `cop-temp`, `auto-seat`, `auto-wheel`, `wheel-level` | Climate, seat, and steering wheel control |
207
- | `security` | `status`, `lock`, `auto-secure`, `unlock`, `sentry`, `valet`, `valet-reset`, `remote-start`, `flash`, `honk`, `boombox`, `speed-limit`, `pin-to-drive`, `pin-reset`, `pin-clear-admin`, `speed-clear`, `speed-clear-admin`, `guest-mode`, `erase-data` | Security, access, and PIN management |
208
- | `trunk` | `open`, `close`, `frunk`, `window`, `sunroof`, `tonneau-open`, `tonneau-close`, `tonneau-stop` | Trunk, frunk, sunroof, tonneau, and window control |
209
- | `media` | `play-pause`, `next-track`, `prev-track`, `next-fav`, `prev-fav`, `volume-up`, `volume-down`, `adjust-volume` | Media playback control |
210
- | `nav` | `send`, `gps`, `supercharger`, `homelink`, `waypoints` | Navigation and HomeLink |
211
- | `software` | `status`, `schedule`, `cancel` | Software update management |
212
- | `energy` | `list`, `status`, `live`, `backup`, `mode`, `storm`, `tou`, `history`, `off-grid`, `grid-config`, `telemetry`, `calendar` | Energy product (Powerwall) management |
213
- | `user` | `me`, `region`, `orders`, `features` | User account information |
214
- | `sharing` | `add-driver`, `remove-driver`, `create-invite`, `redeem-invite`, `revoke-invite`, `list-invites` | Vehicle sharing and driver management |
215
- | `key` | `generate`, `deploy`, `validate`, `show`, `enroll`, `unenroll` | Key management and enrollment |
216
- | `partner` | `public-key`, `telemetry-error-vins`, `telemetry-errors` | Partner account endpoints (require client credentials) |
217
- | `cache` | `status`, `clear` | Response cache management |
218
- | `raw` | `get`, `post` | Arbitrary Fleet API endpoint access |
219
-
220
- Use `tescmd <group> --help` for detailed usage on any command group. For API endpoints not yet covered by a dedicated command, use `raw get` or `raw post` as an escape hatch.
221
-
222
- ### Global Flags
223
-
224
- These flags can be placed at the root level or after any subcommand:
225
-
226
- | Flag | Description |
227
- |---|---|
228
- | `--vin VIN` | Vehicle VIN (also accepted as a positional argument) |
229
- | `--profile NAME` | Config profile name |
230
- | `--format {rich,json,quiet}` | Force output format |
231
- | `--quiet` | Suppress normal output |
232
- | `--region {na,eu,cn}` | Tesla API region |
233
- | `--verbose` | Enable verbose logging |
234
- | `--no-cache` / `--fresh` | Bypass response cache for this invocation |
235
- | `--wake` | Auto-wake vehicle without confirmation (billable) |
236
-
237
- ## Output Formats
238
-
239
- tescmd auto-detects the best output format:
240
-
241
- - **Rich** (default in TTY) — formatted tables, panels, colored status indicators
242
- - **JSON** (`--format json` or piped) — structured, parseable output
243
- - **Quiet** (`--quiet`) — minimal output on stderr, suitable for scripts that only check exit codes
244
-
245
- ```bash
246
- # Human-friendly output
247
- tescmd vehicle list
248
-
249
- # JSON for scripting
250
- tescmd vehicle list --format json
251
-
252
- # Pipe-friendly (auto-switches to JSON)
253
- tescmd vehicle list | jq '.[0].vin'
254
-
255
- # Quiet mode (exit code only)
256
- tescmd vehicle wake --quiet && echo "Vehicle is awake"
257
- ```
258
-
259
- ### Display Units
260
-
261
- Rich output displays values in US units by default (°F, miles, PSI). Switch to metric with a single flag:
262
-
263
- ```bash
264
- tescmd --units metric charge status # All metric: °C, km, bar
265
- tescmd --units us charge status # All US: °F, mi, psi (default)
266
- ```
267
-
268
- Or configure individual units via environment variables:
269
-
270
- ```dotenv
271
- TESLA_TEMP_UNIT=C # F or C
272
- TESLA_DISTANCE_UNIT=km # mi or km
273
- TESLA_PRESSURE_UNIT=bar # psi or bar
274
- ```
275
-
276
- | Dimension | US (default) | Metric | Env Variable |
277
- |---|---|---|---|
278
- | Temperature | °F | °C | `TESLA_TEMP_UNIT` |
279
- | Distance | mi | km | `TESLA_DISTANCE_UNIT` |
280
- | Pressure | psi | bar | `TESLA_PRESSURE_UNIT` |
281
-
282
- The `--units` flag overrides all three env vars at once. The Tesla API returns Celsius, miles, and bar — conversions happen in the display layer only.
283
-
284
- ## Tesla Fleet API Costs
285
-
286
- Tesla's Fleet API is **pay-per-use** — every request returning a status code below 500 is billable, including 4xx errors like "vehicle asleep" (408) and rate limits (429). Wake requests are the most expensive category and are rate-limited to 3/min. There is no free tier (the $10/month credit is being discontinued).
287
-
288
- > **Official pricing:** [Tesla Fleet API — Billing and Limits](https://developer.tesla.com/docs/fleet-api/billing-and-limits)
289
-
290
- ### Why This Matters
291
-
292
- A naive script that polls `vehicle_data` every 5 minutes generates **4-5 billable requests per check** (asleep error + wake + poll + data fetch). That's **1,000+ billable requests per day** from a single cron job. At roughly $1 per 500 data requests, monitoring one vehicle costs around $60/month before you even count wake requests (the most expensive tier).
293
-
294
- ### Cost Example: Battery Check
295
-
296
- | | Without tescmd | With tescmd |
297
- |---|---|---|
298
- | Vehicle asleep, check battery | 408 error (billable) + wake (billable) + poll (billable) + data (billable) = **4+ requests** | Cache miss → prompt user → user wakes via Tesla app (free) → retry → data (billable) = **1 request** |
299
- | Check battery again 30s later | Another 4+ requests | **0 requests** (cache hit) |
300
- | 10 checks in 1 minute | **40+ billable requests** | **1 billable request** + 9 cache hits |
301
-
302
- ### How tescmd Reduces Costs
303
-
304
- tescmd implements four layers of cost protection:
305
-
306
- 1. **Universal read-command cache** — **all** read commands are cached with tiered TTLs: static data (specs, warranty) cached for 1 hour, fleet lists for 5 minutes, standard queries for 1 minute, location-dependent data for 30 seconds. Bots can call tescmd as often as needed — within the TTL, responses are instant and free.
307
- 2. **Smart wake state** — Tracks whether the vehicle was recently confirmed online (30s TTL). Skips redundant wake attempts.
308
- 3. **Wake confirmation prompt** — Prompts before sending billable wake calls in interactive mode. JSON/piped mode returns a structured error with `--wake` guidance.
309
- 4. **Write-command invalidation** — write commands automatically invalidate the relevant cache scope (vehicle or energy site) so subsequent reads reflect the new state.
310
-
311
- ```bash
312
- # First call: hits API, caches response
313
- tescmd charge status
314
-
315
- # Second call within 60s: instant cache hit, no API call
316
- tescmd charge status
317
-
318
- # All read commands are cached — even vehicle list, user info, billing, etc.
319
- tescmd vehicle list # cached 5 min
320
- tescmd user me # cached 1 hour
321
- tescmd vehicle specs # cached 1 hour
322
- tescmd billing history # cached 1 min
323
-
324
- # Bypass cache when you need fresh data
325
- tescmd charge status --fresh
326
-
327
- # Auto-wake without prompting (for scripts accepting the cost)
328
- tescmd charge status --wake
329
-
330
- # Manage cache
331
- tescmd cache status # entry counts, disk usage
332
- tescmd cache clear # clear all
333
- tescmd cache clear --vin VIN # clear for one vehicle
334
- tescmd cache clear --site 12345 # clear for an energy site
335
- tescmd cache clear --scope account # clear account-level entries
336
- ```
337
-
338
- For the full cost breakdown with more examples, savings calculations, and Fleet Telemetry streaming comparison, see [docs/api-costs.md](docs/api-costs.md).
339
-
340
- Configure via environment variables:
341
-
342
- | Variable | Default | Description |
343
- |---|---|---|
344
- | `TESLA_CACHE_ENABLED` | `true` | Enable/disable the cache |
345
- | `TESLA_CACHE_TTL` | `60` | Time-to-live in seconds |
346
- | `TESLA_CACHE_DIR` | `~/.cache/tescmd` | Cache directory path |
347
-
348
- ## Fleet Telemetry Streaming
349
-
350
- Tesla's Fleet Telemetry lets your vehicle push real-time data directly to your server — no polling, no per-request charges. tescmd handles all the setup:
351
-
352
- ```bash
353
- # Install telemetry dependencies
354
- pip install tescmd[telemetry]
355
-
356
- # Stream real-time data (Rich dashboard in TTY, JSONL when piped)
357
- tescmd vehicle telemetry stream
358
-
359
- # Select field presets
360
- tescmd vehicle telemetry stream --fields driving # Speed, location, power
361
- tescmd vehicle telemetry stream --fields charging # Battery, voltage, current
362
- tescmd vehicle telemetry stream --fields climate # Temps, HVAC state
363
- tescmd vehicle telemetry stream --fields all # Everything (120+ fields)
364
-
365
- # Override polling interval
366
- tescmd vehicle telemetry stream --interval 5 # Every 5 seconds
367
-
368
- # JSONL output for scripting
369
- tescmd vehicle telemetry stream --format json | jq .
370
- ```
371
-
372
- **Requires Tailscale** with Funnel enabled. The stream command starts a local WebSocket server, exposes it via Tailscale Funnel (handles TLS + NAT traversal), configures Tesla to push data to it, and renders an interactive dashboard with live uptime counter, unit conversion, and connection status. Press `q` to stop — cleanup messages show each step (removing telemetry config, restoring partner domain, stopping tunnel).
373
-
374
- ### Telemetry vs Polling Costs
375
-
376
- | Approach | 1 vehicle, 5-second interval, 24 hours | Monthly cost estimate |
377
- |---|---|---|
378
- | **Polling `vehicle_data`** | ~17,280 requests × $0.001 = **$17/day** | **$500+/month** |
379
- | **Fleet Telemetry streaming** | 1 config create + 1 config delete = **2 requests** | **< $0.01/month** |
380
-
381
- Fleet Telemetry streaming is a flat-cost alternative: you pay only for the initial config setup and teardown, regardless of how much data flows. The tradeoff is that you need Tailscale running on a machine to receive the push.
382
-
383
- ## Key Enrollment & Vehicle Command Protocol
384
-
385
- Newer Tesla vehicles require commands to be signed using the [Vehicle Command Protocol](https://github.com/teslamotors/vehicle-command). tescmd handles this transparently:
386
-
387
- 1. **Generate a key pair** — `tescmd key generate` creates an EC P-256 key pair
388
- 2. **Enroll on vehicle** — `tescmd key enroll <VIN>` sends the public key to the vehicle; approve in the Tesla app
389
- 3. **Commands are signed automatically** — once enrolled, tescmd uses ECDH sessions + HMAC-SHA256 to sign commands via the `signed_command` endpoint
390
-
391
- ```bash
392
- # Generate EC key pair
393
- tescmd key generate
394
-
395
- # Enroll on a vehicle (interactive approval via Tesla app)
396
- tescmd key enroll 5YJ3E1EA1NF000000
397
-
398
- # Commands are now signed automatically
399
- tescmd security lock --wake
400
- ```
401
-
402
- The `command_protocol` setting controls routing:
403
-
404
- | Value | Behavior |
405
- |---|---|
406
- | `auto` (default) | Use signed path when keys are enrolled; fall back to unsigned |
407
- | `signed` | Require signed commands (error if no keys) |
408
- | `unsigned` | Force legacy REST path (skip signing) |
409
-
410
- Set via `TESLA_COMMAND_PROTOCOL` environment variable or in your config.
411
-
412
- See [docs/vehicle-command-protocol.md](docs/vehicle-command-protocol.md) for the full protocol architecture.
413
-
414
- ## Agent Integration
415
-
416
- tescmd is designed for use by AI agents and automation platforms. Agents like [Claude Code](https://github.com/anthropics/claude-code), Claude Desktop, and other LLM-powered tools can invoke tescmd commands, parse the structured JSON output, and act on your behalf.
417
-
418
- **Why tescmd works well as an agent tool:**
419
-
420
- - **Structured JSON output** — piped/non-TTY mode automatically emits parseable JSON with consistent schema
421
- - **Cost protection** — agents won't accidentally trigger billable wake calls without `--wake`; the default behavior is safe
422
- - **Cache-aware** — every read command is cached; repeated queries from an agent within the TTL window cost nothing
423
- - **Meaningful exit codes** — agents can branch on success/failure without parsing output
424
- - **Stateless invocations** — each command is self-contained; no session state to manage
425
- - **Signed commands** — when keys are enrolled, commands are signed transparently; no agent-side crypto needed
426
-
427
- **Example agent workflow:**
428
-
429
- ```bash
430
- # Agent checks battery (cache hit if recent)
431
- tescmd charge status --format json
432
-
433
- # Agent decides to start charging
434
- tescmd charge start --wake --format json
435
-
436
- # Agent verifies the command took effect (cache was invalidated)
437
- tescmd charge status --format json --fresh
438
- ```
439
-
440
- See [docs/bot-integration.md](docs/bot-integration.md) for the full JSON schema, exit code reference, and headless authentication setup.
441
-
442
- ## Development
443
-
444
- ```bash
445
- # Clone and install in dev mode
446
- git clone https://github.com/oceanswave/tescmd.git
447
- cd tescmd
448
- pip install -e ".[dev]"
449
-
450
- # Run checks
451
- ruff check src/ tests/
452
- ruff format --check src/ tests/
453
- mypy src/
454
- pytest
455
-
456
- # Run a specific test
457
- pytest tests/cli/test_auth.py -v
458
-
459
- # Validate API coverage against Tesla Fleet API spec
460
- python scripts/validate_fleet_api.py
461
- ```
462
-
463
- ### API Coverage Validation
464
-
465
- tescmd ships a spec-driven validation utility that compares our implementation against the Tesla Fleet API. The canonical spec lives at `spec/fleet_api_spec.json` (sourced from Tesla's docs and Go SDK), and `scripts/validate_fleet_api.py` validates all API methods, parameters, and types using AST introspection.
466
-
467
- ```bash
468
- python scripts/validate_fleet_api.py # Summary
469
- python scripts/validate_fleet_api.py --verbose # All endpoints
470
- python scripts/validate_fleet_api.py --json # Machine-readable
471
- ```
472
-
473
- Run this periodically or after modifying API methods to catch drift.
474
-
475
- See [docs/development.md](docs/development.md) for detailed contribution guidelines.
476
-
477
- ## Documentation
478
-
479
- - [Setup Guide](docs/setup.md) — step-by-step walkthrough of `tescmd setup`
480
- - [FAQ](docs/faq.md) — common questions about tescmd, costs, hosting, and configuration
481
- - [Command Reference](docs/commands.md) — detailed usage for every command
482
- - [API Costs](docs/api-costs.md) — detailed cost breakdown and savings calculations
483
- - [Bot Integration](docs/bot-integration.md) — JSON schema, exit codes, telemetry streaming, headless auth
484
- - [Architecture](docs/architecture.md) — layered design, module responsibilities, design decisions
485
- - [Vehicle Command Protocol](docs/vehicle-command-protocol.md) — ECDH sessions and signed commands
486
- - [Authentication](docs/authentication.md) — OAuth2 PKCE flow, token storage, scopes
487
- - [Development](docs/development.md) — contribution guidelines, testing, linting
488
-
489
- ## Changelog
490
-
491
- See [CHANGELOG.md](CHANGELOG.md) for release history.
492
-
493
- ## License
494
-
495
- MIT