Skip to content

bconnorwhite/gitkraken-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitkraken-cli

NPM TypeScript Coverage Status GitHub Stars Twitter Follow

CLI to launch GitKraken from a given path.

Currently has only been tested on MacOS, feel free to submit a pull request to add Windows support.

Installation

yarn global add gitkraken-cli
npm install --global gitkraken-cli

CLI

kraken

Usage: kraken [options] [path]

Open repository with GitKraken

Options:
  -v --version    Output the version number
  -h --help       Display help for command

Commands:
  help [command]  Display help for command

Examples

Open current directory in GitKraken:

kraken 

Open target directory in GitKraken:

kraken path/to/repo

API

Usage

import { createCommand } from "commander";
import openCommand, { openAction, open } from "gitkraken-cli";

// Add kraken to your own commander program:
program
  .addCommand(openCommand)
  // ...

// Add the open action to your own commander command:
program
  .name("my-command")
  .action(openAction);

// Call open programmatically:
open("path/to/repo").then(() => {
  // GitKraken is now open...
});

Types

function open(path?: string): Promise<ExecResult>;

function openAction(path?: string | undefined): Promise<void>

const openCommand: commander.Command;

Dependenciesdependencies

  • @bconnorwhite/exec: Execute commands while keeping flags easily configurable as an object
  • commander-version: A wrapper for Commander that automatically sets the version based on your package.json
  • is-absolute: Returns true if a file path is absolute. Does not rely on the path module and can be used as a polyfill for node.js native path.isAbolute.

Dev DependenciesDavid


License license

MIT