Skip to content

Adds basic status command to CLI tool#8

Open
masq wants to merge 8 commits intoProtonVPN:stablefrom
masq:stable
Open

Adds basic status command to CLI tool#8
masq wants to merge 8 commits intoProtonVPN:stablefrom
masq:stable

Conversation

@masq
Copy link

@masq masq commented Feb 24, 2026

Hey all,

As it says on the tin, this is a "simple" status command added to the CLI tool. I'm not sure if this is how it should be done, but this is at least a start. Hopefully someone from Proton or who is more familiar with the codebase can help improve upon this and streamline it a bit. Most of the Lines of Code (LoCs) are just building a large dict with all of the possible information I would think folks would be interested in getting from the status command, though I'm sure there are more data points people might want.

This addresses the Linux CLI connection status feature request posted on the ProtonVPN UserVoice.

The main issue I'm having is that the connection_details object isn't consistently populated. I couldn't divine how it was being populated or not populated, so I just left it as-is and figured someone smarter than I could figure it out. As-is, it is sometimes populated when called, and other times, it isn't.

When using for something like Polybar or i3bar, you'll want to pipe the outputs of this command to grep -v "Server list" to avoid getting the message about the server list updating which sometimes pops up. I also included a --simple or -s flag to the command that will make the output "simple" for use with something like a status bar.

Thanks!

@dchauran
Copy link

dchauran commented Feb 24, 2026

I came here to specifically look for whether this feature was being implemented. +1 on this being absolutely necessary and the most basic functionality.

masq added 2 commits February 27, 2026 18:51
…etails object we all know and love for consistent handling
@masq
Copy link
Author

masq commented Feb 28, 2026

I just added some code that will write to the /tmp directory a JSON-encoded ConnectionDetails object during the connect command. That way, the status command can fallback to reading from that if the ConnectionDetails object isn't populated when status is run. If there's a better method for this, feel free to adjust or request that I rollback those commits. I assume /tmp is fine since the data shouldn't really persist across reboots since you'll likely end up with a different exit IP. Just figure it's better to cache that data to disk if we can't consistently get it from the Connector rather than having to call some external IP lookup service or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants