How edge driver enroll works?

When I do

smartthings edge:channels:enroll

How does it find my hub? Does it scan the local network? Does it already know somehow that I have that particular hub at my location but I don’t remember I ever provided location id or anything of that kind.

You will have either authenticated the CLI with your ST account, or configured it with personal access tokens. So it just asks the API what hubs you have.

That is the thing. I downloaded smartthings.exe, never explicitly configured it, never provided my personal access token, just started using it. However before that I did a lot of other things with the AWS SmartApp, AWS schema and so on. I wonder where smartthings.exe found my personal access token.

When you run a command, the CLI opens a page in the browser asking for authorization, if you click on “authorize” or “accept”, then an Access Token is automatically generated and in Windows, it is saved in the file called credentials.json in this directory:

%LOCALAPPDATA%\@smartthings\cli