Git Product home page Git Product logo

plugin-cli's Introduction

CLI for the Home Assistant Operating System

This is for the Home Assistant Operating System and is the login shell.

plugin-cli's People

Contributors

agners avatar crawford avatar dependabot[bot] avatar frenck avatar ludeeus avatar mdegat01 avatar pvizeli avatar sairon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

plugin-cli's Issues

Home Assistant CLI Help doesn't list Login command

Describe the problem

The Home Assistant CLI built-in help shows a list titled "Available Commands". While Login is a recognized command, it is not listed. When in the context of the "system console" (example, the VirtualBox window), where the user "lands" in the running CLI, this leads the user to believe that there is no such option supported by the CLI. It also prevents users from understanding that they have system control options (namely, a shell) that they can employ to solve problem like paginating HA CLI command output (example github issue; example forum thread). Considering that Home Assistant is aimed at DIY tech enthusiasts, this feature should be easy to discover, not hidden.

Debug information

  1. SSH Addon type
  • Community
  • Core
  • Custom
  1. Version of the CLI

CLI Version: 2023.06.0
Add-on:
Add-on version:

  1. Version of Home Assistant Core & the Home Assistant Supervisor

Home Assistant Core: 2023.10.5
Home Assistant Supervisor: 2023.10.1

  1. Output from executing the command with debug info

Expected behavior

A list of CLI "Available Commands" (all, not just some), and/or an indication that some commands are hidden and how to view them.

Additional context

Console - Five first keystrokes duplicate

Describe the issue you are experiencing

I run Home Assistant OS (up to date) on a virtual machine in VMware. I noticed a little bit ago, within the past month, that when I tried to type a command into the console on the machine, I would get the first 5 characters I typed duplicated. For example, if I typed the word "network" and pressed enter, it would show I entered "netwonetwork". Interestingly, the exit command still works, though, though I think that's just a sign of robust programming.

I thought this issue was isolated to some problem I was having with my own VM. But then I tried installing a fresh up-to-date version on a Raspberry Pi 400, and noticed it had the exact same issue.

...How?

(FYI, I am noting the hardware I'm CURRENTLY using in this bug report, but keep in mind that this applies to at least Home Assistant OS on a Raspberry Pi 400, as well).

What operating system image do you use?

generic-x86-64 (Generic UEFI capable x86-64 systems)

What version of Home Assistant Operating System is installed?

11.1

Did you upgrade the Operating System.

Yes

Steps to reproduce the issue

  1. Boot up the machine
  2. Type somthing and hit enter
  3. The first five characters will be duplicated (i.e. - network becomes netwonetwork )
    ...

Anything in the Supervisor logs that might be useful for us?

The logs here won't help with actions occurring on the console at the baremetal level.

Anything in the Host logs that might be useful for us?

The logs here won't help with actions occurring on the console at the baremetal level.

System information

System Information

version core-2023.11.2
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.6
os_name Linux
os_version 6.1.59
arch x86_64
timezone America/Denver
config_dir /config
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 11.1
update_channel stable
supervisor_version supervisor-2023.11.3
agent_version 1.6.0
docker_version 24.0.6
disk_total 30.8 GB
disk_used 13.8 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Uptime Kuma (0.9.1), Vaultwarden (Bitwarden) (0.20.1), Terminal & SSH (9.8.1), Duck DNS (1.15.0), Studio Code Server (5.14.2), RPC Shutdown (2.4), Network UPS Tools (0.12.2), Spotify Connect (0.12.6), Whisper (1.0.0), Piper (1.4.0), Traccar (0.22.0), MariaDB (2.6.1)
Dashboards
dashboards 3
resources 0
views 12
mode storage
Recorder
oldest_recorder_run November 10, 2023 at 15:40
current_recorder_run November 19, 2023 at 01:13
estimated_db_size 100.10 MiB
database_engine sqlite
database_version 3.41.2

Additional information

This occurs at LEAST on both a virtual machine and on a Raspberry Pi 400.

Unable to restore password protected snapshot via command line

Describe the issue you are experiencing

I want to restore a password protected snapshot via the Hassio command line, with a password that contains spaces.

I have tried to run the command with single and double quotes around the password, and without any quotes. In all cases I'm getting the following error:

FATA[0000] Error while executing rootCmd: accepts 1 arg(s), received 3

My command" ha snapshot restore c1a07617 --password 'my secret password'

It works fine using the UI.

What is the used version of the Supervisor?

2021.04.3

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

What is the version of your installed operating system?

5.13

What version of Home Assistant Core is installed?

2021.5.3

Steps to reproduce the issue

  1. Make a snapshot, with a password that contains spaces
  2. Restore it using the command line ha snapshot restore c1a07617 --password 'my secret password'

Anything in the Supervisor logs that might be useful for us?

FATA[0000] Error while executing rootCmd: accepts 1 arg(s), received 3

Additional information

No response

HA CLI incorrectly strips "ha" off hardware command.

Hardware Environment

  • ODROID N2+ 4GB

Home Assistant OS release:

  • Updated from version - unknown - fresh out of box before upgrade and didn't note version before upgrading...

  • Additional information (if accessible):
    System Health

version: core-2021.7.4
installation_type: Home Assistant OS
dev: false
hassio: true
docker: true
virtualenv: false
python_version: 3.9.5
os_name: Linux
os_version: 5.9.16
arch: aarch64
timezone: America/Los_Angeles

logged_in: false
can_reach_cert_server: ok
can_reach_cloud_auth: ok
can_reach_cloud: ok

host_os: Home Assistant OS 6.1
update_channel: stable
supervisor_version: supervisor-2021.06.8
docker_version: 20.10.6
disk_total: 113.9 GB
disk_used: 3.3 GB
healthy: true
supported: true
board: odroid-n2
supervisor_api: ok
version_api: ok
installed_addons:

dashboards: 1
resources: 0
mode: auto-gen

Supervisor logs:
blank

Journal logs:
NA

Kernel logs:
NA

Description of problem:
Is the problem reproducible? YES
Has this been working before (is this a regression?) Unknown - new to home assistant
Has there been attempt to rule out hardware issues? (different SD card etc.) Definitely not a HW issue

I'm new to HA and am exploring various system commands... working from ha CLI with screen and keyboard attached directly to N2+.
Noted advisory from CLI software when entering ha before commands on HA CLI --> "Note: Leading 'ha' is not necessary as this HA CLI."

Problem: When you enter the command 'hardware' alone you get the following error message:

'Error: unknown command "rdware" for "ha"
Did you mean this?
hardware'

HA CLI is assuming any entered command string that starts with "ha" needs the advisory message mentioned above and strips the 'ha' from the command before proceeding which causing the problem above. The CLI should check for the presence of "ha " (with space after ha) instead of assuming that if the first two characters are "ha" the user is proceeding command with ha. If the CLI is written in python there's a 'cmdString'.startswith('ha') check that is responsible for the advisory message and removal that needs to be modified. All ha commands I've seen so far have a space after the ha which is why the looking for the "ha " will work.

The hardware command will work correctly if you enter it as 'ha hardware' - you'll just get yelled at given the leading 'ha' .

ha utility no longer works

After a recent upgrade ha command line tool crashes with the following error,

Welcome to Home Assistant OS.

Use `ha` to access the Home Assistant CLI.
# ha
OCI runtime exec failed: exec failed: unable to start container process: exec /usr/bin/ha: exec format error: unknown

I dived into hassio_cli image and found that /usr/bin/ha is actually a text file containing Not Found

# docker exec -it hassio_cli /bin/sh
/ # ha
/usr/bin/ha: line 1: Not: not found
/ # cat /usr/bin/ha
Not Found/ # 

So it is quite possible that something derailed during image creation.

Details

  • Hardware: RPi 4, preinstalled with HAOS
  • Home Assistant: 10.5

Docker Images

REPOSITORY                                          TAG         IMAGE ID       CREATED        SIZE
ghcr.io/home-assistant/raspberrypi4-homeassistant   2023.10.0   bf0377bf16ea   25 hours ago   1.64GB
ghcr.io/home-assistant/armv7-hassio-supervisor      2023.10.0   87dbd9ca3522   2 days ago     343MB
ghcr.io/home-assistant/armv7-hassio-supervisor      latest      87dbd9ca3522   2 days ago     343MB
homeassistant/armv7-hassio-supervisor               2023.10.0   87dbd9ca3522   2 days ago     343MB
homeassistant/armv7-hassio-supervisor               latest      87dbd9ca3522   2 days ago     343MB
zigbee2mqtt/zigbee2mqtt-armv7                       1.33.1-1    1ec333688e03   2 days ago     167MB
ghcr.io/home-assistant/armv7-hassio-cli             2023.09.0   102856190904   3 days ago     87.4MB
ghcr.io/hassio-addons/sqlite-web/armv7              3.9.3       cff45d2c5b91   3 weeks ago    75.1MB
ghcr.io/hassio-addons/grafana/armv7                 9.0.3       643722dab46a   2 months ago   522MB
ghcr.io/home-assistant/armv7-hassio-dns             2023.06.2   4ece8572a8e6   3 months ago   103MB
ghcr.io/home-assistant/armv7-hassio-multicast       2023.06.2   77dcb507fc37   3 months ago   89.5MB
ghcr.io/home-assistant/armv7-hassio-observer        2023.06.0   68a99a8a7950   3 months ago   7.55MB
ghcr.io/home-assistant/armv7-hassio-audio           2023.06.0   47302b442c78   3 months ago   121MB
hassioaddons/grafana-armv7                          5.3.6       52e0ed659393   2 years ago    292MB
dwelch2101/zigbee2mqtt-armhf                        1.14.4      5f1088bc6ad0   3 years ago    418MB

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.