Edit configuration.yaml from Home assistant CLI?

Hi all.

Struggling with what should be a simple issue to fix. My home assistant web gui is not running. Accessed my Home assisstant CLI directly through console and I’ve run ‘core check’ which confirms there’s a duplicate entry in my ‘configuration.yaml’ file.

I normally access my .yaml files through samba share, ssh terminal, or file editor but these services aren’t set to start automatically so as far as I can tell, its not an option since I cant access web gui to initialize.

So my question is: how else can I access my configuration.yaml file so I can edit and resolve! Is there a way I can access and edit the file directly through HA CLI? Through the host system itself?

Any help is greatly appreciated. Thanks.

Disregard. For whatever reason, after a few hours, I was able to access HA from web gui again and was able to access my config.yaml through file editor to fix.

Hi
Did anyone figure out how to edit configuration.yaml from HA CLI. I have an error and I dont have access to web UI to fix it.

Thank you!!

cd /config
nano configuration.yaml

Or if you prefer old-school:

cd /config
vi configuration.yaml

Figured this out.

From the ‘HA’ Prompt…

type ‘login’
then cd /mnt/data/supervisor/homeassistant

type ‘ls’
you’ll see ‘configuration.yaml’ is in this directory

vi configuration.yaml to edit

For basics VI editor commands

i — Switch to Insert mode.
Esc — Switch to Command mode.
:w — Save and continue editing.
:wq or ZZ — Save and quit/exit vi.
:q! — Quit vi and do not save changes.

1 Like