Code Monkey home page Code Monkey logo

Comments (2)

apricote avatar apricote commented on August 25, 2024

Hey @edgecode,

there is currently no API endpoint to get details about the current project. We would need one to show this information. I have added a +1 to our internal feedback tracker for this request.

I personally display the active context or the token prefix in my zsh prompt:
screenshot-zsh-hcloud-ps1

Right now the function code is pretty much hardcoded for my theme, but you should be able to adjust the style-only lines to match your prompt:

hcloud_ps1 () {
	if command -v hcloud > /dev/null
	then
		local HCLOUD_PS1
		HCLOUD_PS1+="%{$fg_bold[blue]%}hc:("
		HCLOUD_PS1+="%{$fg_bold[red]%}"
		if [[ -z "$HCLOUD_TOKEN" ]]
		then
			HCLOUD_PS1+="$(hcloud context active)"
		else
			HCLOUD_PS1+="$( echo $HCLOUD_TOKEN | cut -b 1-8)..."
		fi
		HCLOUD_PS1+="%{$fg_bold[blue]%})%{$reset_color%}"
		echo "${HCLOUD_PS1}"
	fi
}

I am going to close this issue as we can only implement what is available through the API.

from cli.

edgecode avatar edgecode commented on August 25, 2024

Sad to hear that the API does not expose the project name.
That is a bit unexpected to be honest ;-)

But hey, thanks @apricote for your quick response!
And for adding to Hetzner's internal feedback tracker.
And of course for the hint with the shell prompt; which is at least a mitigation.

best, @edgecode

from cli.

Related Issues (20)

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.