Skip to content

🚀 Spaceship prompt section that shows the title of any issue associated with the current branch

License

Notifications You must be signed in to change notification settings

bjoerge/spaceship-linear

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 spaceship-linear

Spaceship prompt section that shows the title of any Linear issue associated with the current branch

Screenshot

Installing

Add Linear API key

Get your API key from here, and add this line to your .zprofile, .bash_profile etc.

export SPACESHIP_LINEAR_API_KEY="lin_api_****************************************"

Configure shell

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"

Manual

If none of the above methods works for you, you can install Spaceship manually.

  1. Clone this repo somewhere, for example to $HOME/.zsh/spaceship-linear.
  2. Source this section in your ~/.zshrc.

Example

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"

Usage

After installing, add the following line to your .zshrc in order to include the Linear section in the prompt:

spaceship add linear

Options

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

Credits

This plugin is riffing off of the initial idea and great work by Rostislav Melkumyan in the linear-branch-matcher project

License

MIT © Bjørge Næss

About

🚀 Spaceship prompt section that shows the title of any issue associated with the current branch

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages