Gemini-CLI: Cannot read Automation YAML/Logic despite Long-Lived Token

Hi all,

I’m trying to use gemini-cli with a Long-Lived Access Token to manage my automations.

The model is successful in listing all automations and their states, confirming basic API connectivity:

I was able to connect to your Home Assistant API and retrieve a list of 99 automations and their current status (on/off).

However, when I ask it to create or edit an automation, I receive this response:

However, I cannot read the actual code/logic of these automations via the standard API token, as that requires administrative access to the configuration endpoints which are often restricted or disabled for external tokens.

My question is:

Is there a workaround or a recommended way to grant the necessary administrative access for gemini-cli to handle automations?

Thanks for any help!

The best recommendation is… don’t do it.

However, if you’re really determined, this may be interesting:

Don’t say you weren’t warned.

I think it would be neat. I also see that devs added this file which is used by coding agents like Claude, Gemini, Copilot and Codex on the command line already.

If they can be used developing Home Assistant, I’m sure they can be used to configure Home Assistant.