Spaceship prompt section that shows the title of any Linear issue associated with the current branch
Get your API key from here, and add this line to your .zprofile
, .bash_profile
etc.
export SPACESHIP_LINEAR_API_KEY="lin_api_****************************************"
You need to source this plugin somewhere in your dotfiles. Here's how to do it with some popular tools:
Execute this command to clone this repo into Oh-My-Zsh plugin's folder:
git clone https://github.com/bjoerge/spaceship-linear.git $ZSH_CUSTOM/plugins/spaceship-linear
Include spaceship-linear
in Oh-My-Zsh plugins list:
plugins=($plugins spaceship-linear)
zplug "bjoerge/spaceship-linear"
antigen bundle "bjoerge/spaceship-linear"
antibody bundle "bjoerge/spaceship-linear"
zinit light "bjoerge/spaceship-linear"
zgen load "bjoerge/spaceship-linear"
[plugins.spaceship-linear]
github = "bjoerge/spaceship-linear"
If none of the above methods works for you, you can install Spaceship manually.
- Clone this repo somewhere, for example to
$HOME/.zsh/spaceship-linear
. - Source this section in your
~/.zshrc
.
mkdir -p "$HOME/.zsh"
git clone --depth=1 https://github.com/bjoerge/spaceship-linear.git "$HOME/.zsh/spaceship-linear"
For initializing prompt system add this to your .zshrc
:
source "~/.zsh/spaceship-linear/spaceship-linear.plugin.zsh"
After installing, add the following line to your .zshrc
in order to include the Linear section in the prompt:
spaceship add linear
This section is shown only in directories where the working git branch matches a Linear ticket ID
Variable | Default | Meaning |
---|---|---|
SPACESHIP_LINEAR_SHOW |
true |
Show the Linear section |
SPACESHIP_LINEAR_LINK |
true |
Set to true to display link next to issue title or set to false to not show link at all. Alternatively, set to text to turn the issue title into a link using OSC 8 hyperlinks (note: this may cause rendering issues). |
SPACESHIP_LINEAR_ASYNC |
true |
Render section asynchronously |
SPACESHIP_LINEAR_PREFIX |
$SPACESHIP_PROMPT_DEFAULT_PREFIX |
Prefix before section |
SPACESHIP_LINEAR_SUFFIX |
$SPACESHIP_PROMPT_DEFAULT_SUFFIX |
Suffix after section |
SPACESHIP_LINEAR_SYMBOL |
ó°»¿ |
Symbol displayed before the section (requires nerd fonts) |
SPACESHIP_LINEAR_COLOR |
white |
Color of section |
SPACESHIP_LINEAR_TITLE_MAX_LENGTH |
35 |
Max length of issue title. Longer titles will be truncated |
SPACESHIP_LINEAR_CACHE_DIR |
/tmp/.spaceship-linear |
Which directory to cache ticket info in |
SPACESHIP_LINEAR_CACHE_TTL_SECONDS |
300 |
How long (in seconds) to cache ticket info for before re-fetching from the linear API |
This plugin is riffing off of the initial idea and great work by Rostislav Melkumyan in the linear-branch-matcher project
MIT © Bjørge Næss