Code Monkey home page Code Monkey logo

bitcar's Introduction

bitcar

NPM version npm Travis Apache 2.0 GitHub stars

Seemlessly jump between repos from the command line.


bitcar in action

Requirements

  • node 6.x.x or newer
  • either bash 3+, or zsh 5+

Older versions of zsh may work, but are untested.

Installation

npm i -g bitcar

Setup

bitcar --setup

Setup will drop a few dotfiles in ~/.bitcar and it will append a few lines to your ~/.bash_profile.

Note: You MUST use the command name you chose during setup. Only use the bitcar command itself for setup.

IMPORTANT: Now, start a new terminal session.

Usage

In the examples below, it is assumed you have set your bitcar command to bit. If you've chosen a different command name, adjust accordingly.

Search / Clone / Change Directory to Repo

bit {searchTerm}

Open Repo in Browser

bit --open {searchTerm}
bit -o {searchTerm}

Open Repo in Editor

bit --edit {searchTerm}
bit -e {searchTerm}

Refresh Cache

bit --refresh
bit -r

This is done automatically the first time you try and use bitcar, but you can also manual refresh the cache when needed.

Defaults

The bit command without any searchTerm will drop you into the root bitcar workspace.

For --open and --edit, the searchTerm argument is optional. If no searchTerm is given, then bitcar will attempt to open the current directory's repo.

Github personal access token settings

If you'd like to use bitcar with your private repos, you'll need to setup a personal access token on your github account. Please ensure you've set the correct scope for this token. The repo scope should be fully enabled.

Experimental Features

WARNING: Experimental features are named so for a reason! These are currently under active development and may or may not be part of future releases. Use at your own risk.

Clone All

bit --clone-all {searchTerm}

This will clone ALL repos which match the searchTerm. If searchTerm is omitted it will clone ALL repos in your local cache. You will be prompted to confirm your intention.

Sync Existing

bit --sync-existing

This will add any existing repos in your bitcar workspace to your cache if they are not already there. Run this after each --refresh. This is particularly useful if you are using bitcar to manage your GOPATH.

Create Repo

bit --create {repoName}
bit -c {repoName}

Currently this only works for GitHub. Please note you must include the domain in the repo name. i.e. bit -c github.com/machellerogden/foo.

This feature will remain experimental until more options are added. For the time being, it will create a public repo on your github account. After creating the repo you will need to run a cache refresh in order for bitcar to find the new repo.

License

Apache 2.0

bitcar's People

Contributors

machellerogden avatar thehipbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitcar's Issues

JavaScript Error when running bitcar --setup

On Mac OS Sierra, tried installing and setting up bitcar

tommy@tommy ~/dev
๐Ÿ”   npm i -g bitcar
/usr/local/bin/bitcar -> /usr/local/lib/node_modules/bitcar/index.js
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/npm-package-arg requires hosted-git-info@'^2.1.5' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/hosted-git-info,
npm WARN unmet dependency which is version 2.1.4
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/npm-registry-client requires graceful-fs@'^4.1.6' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/graceful-fs,
npm WARN unmet dependency which is version 4.1.4
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/rimraf requires glob@'^7.0.5' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/glob,
npm WARN unmet dependency which is version 7.0.4
[email protected] /usr/local/lib/node_modules/bitcar
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected] ([email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
โ””โ”€โ”€ [email protected]


tommy@tommy ~/dev
๐Ÿ”   bitcar --setup
/usr/local/lib/node_modules/bitcar/cli.js:38
        let { results, confirmMessage, errorMessage, handler } = options;
            ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at /usr/local/lib/node_modules/bitcar/index.js:5:13
    at Object.<anonymous> (/usr/local/lib/node_modules/bitcar/index.js:16:2)
    at Module._compile (module.js:409:26)


Zsh support

Add zsh support to bitcar.

Note, I know this is reference in README.md but I thought I would create an issue too so it is easier to track.

Non-existent dir accepted resulting in errors

I accidentally provided a non-existing path for bitcar to clone repos. This results in a error as below for all bitcar commands

fs.js:922
  return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: ENOENT: no such file or directory, mkdir '/Users/workspace/repos/src'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:922:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/bitcar/lib/workspaceDir.js:9:8)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/bitcar/lib/getSourceResult.js:5:22)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

May be there should be check for existence of the path provided during setup.

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.