A command line interface to https://linear.app.
You can use the OCI container image to run the CLI without installing it.
$ podman run -w /git -v .:/git -v ~/.ssh:/root/.ssh -it --rm -e GITHUB_TOKEN="$GITHUB_TOKEN" -e LINEAR_API_KEY="$LINEAR_API_KEY" ghcr.io/rubyists/linear-cli:stable lcls (1)
$ docker run -it --rm -e LINEAR_API_KEY=your-api-key ghcr.io/rubyists/linear-cli:stable lcls (2)
-
Podman Usage
-
Docker Usage, without mounting your ssh keys and git dir. This will not be able to do git operations.
There is a helper script available to wrap this up for you.
📝
|
Git commands will require a passphrase for every operation if you are using an ssh key. |
$ curl -sL https://raw.githubusercontent.com/rubyists/linear-cli/main/oci/plc | sudo tee /usr/local/bin/lc
$ sudo chmod +x /usr/local/bin/lc
Then you can just run 'lc' to use the CLI.
You must set the LINEAR_API_KEY environment variable to your Linear API key. You can find your API key in your Linear Settings.
If you are using bash or zsh, you can enable tab completion by adding the following to your .bashrc
or .zshrc
:
bash:
eval "$(lc completion bash)" (1)
eval "$(lc completion -a bash)" (2)
-
This will enable tab completion for the 'lc' command in bash
-
This will include the subcommand aliases as well
zsh:
eval "$(lc completion zsh)" (1)
eval "$(lc completion -a zsh)" (2)
-
This will enable tab completion for the 'lc' command in zsh
-
This will include the subcommand aliases as well
You can get help/usage for any command or subcommand by using the --help
flag.
$ lc --help
$ lc [COMMAND] --help
$ lc [COMMAND] [SUBCOMMAND] --help
You can use the 'w' alias for 'whoami' (or whodat, for Saints fans)
$ lc whoami
$ lc whodat (1)
$ lc w --teams (2)
-
Bayou style
-
Include the teams you are a member of
lcls
is a helper provided to list issues. It’s an alias for lc issues list
.
$ lcls
$ lcls --full
$ lcls -f CRY-1
'i' is a shortcut for the 'issue' command
$ lc i take CRY-1234
$ lc issue take CRY-456 CRY-789
'c' is a shortcut for the 'create' subcommand of the issue command
$ lc i c --title "My new issue" --description "This is a new issue" --labels Bug,Feature --team CRY
$ lc i c -t "My new issue" -T CRY -l Improvement,Feature
📝
|
If you don’t provide a title, team, labels or description, you will be prompted to enter them. |
💡
|
When creating an issue, you can use the --dev option to immediately start development on the issue. |
This will switch to the branch for the issue, creating the branch if it doesn’t exist.
'dev' is a shortcut for the 'develop' subcommand of the issue command
$ lc i dev CRY-1234
All of the update options can work on multiple issues, so long as it’s not more than 50 at a time. You can also use the 'u' alias for 'update', and as always, the 'i' alias for 'issue'.
$ lc issue update --comment "Here is a comment" CRY-1234 (1)
$ lc issue u --close --reason "I do not like you" CRY-14 CRY-15 (2)
$ lc i u --cancel --trash --reason "I have no idea why you are here" CRY-16 CRY-17 (3)
$ lc i u --comment - CRY-14 CRY-15 (4)
$ lcomment CRY-1234 CRY-3 (5)
-
This will use the provided comment to comment on the issue
-
This will close multiple issues without prompting (reason is added as a comment)
-
This will cancel multiple issues without prompting, and move them to the trash (reason is added as a comment)
-
This will prompt for a comment (use '-' to prompt)
-
This will always prompt you for a comment ('lcomment' is an alias for 'lc issue update --comment -')