Code Monkey home page Code Monkey logo

projectman's Introduction

ProjectMan🦸




npm npm bundle size

ProjectMan is a CLI which lets you add projects to favorites using command pm add and open them from anywhere you want using command pm open.

Along with this there are also other commands like pm seteditor, pm remove, cd $(pm getpath) mentioned in documentation below.


ProjectMan gif explaining how it works


Installation

With NodeJS installed in your machine,

npm install -g projectman

Commands

pm is an alias of projectman so you can use pm <command> or projectman <command>

📖 Open Project

Opens project in your code editor (Check out pm seteditor command to set your preferred editor)

Usage :

pm open [projectName]

[projectName] is an optional parameter.

Alias: pm o, pm

➕ Add Project or Template

Add project to favorites

cd /till/the/project
pm add

You can pass --url param to add a URL instead of a directory.

🪄 Create Project

Use added projects as a template to create new project

pm create

Alias: pm c

💫 Set Editor

pm seteditor

Sets default editor to open projects from.

To set a different editor for a specific project,

Flag: --for-project

pm seteditor --for-project

Sets different editor for a specific project. E.g You can use VSCode for other projects and Atom for CoolProject1

If your TextEditor/IDE is not listed, You can select option Other from the list and give your editorCommand. Read editorCommand ref for more information.

🏃🏽 cd to a project without opening.

cd $(pm getpath [projectName])

[projectName] is an optional parameter.

Alias : cd $(pm gp)

(Note: This does not work in Windows cmd, You can use it in Windows Powershell)

❌ Remove Project

pm remove

Removes project from favorites.

➖ Remove editor

pm rmeditor

Shows list of project and removes the project specific editor from the project.

pm rmeditor --all

removes all project specific editors.


⚙️ Settings.json

If you want to sort projects/change name of project/change path, You can type pm edit to open settings.json

Example settings:

{
    "commandToOpen": "code",
    "projects": [
        {
            "name": "Project1",
            "path": "path/to/project1"
        },
        {
            "name": "Project2",
            "path": "path/to/project2",
            "editor": "atom"
        },
        {
            "name": "Project3",
            "path": "path/to/project3"
        }
    ]
}

This will show three projects in pm open and project2 will be opened in Atom and other projects will be opened in Visual Studio Code

Settings Ref:

> commandToOpen :

  • This is your editor's command, this command will be used to open the file in your editor.
  • Default is code which opens in vscode.
  • This is the command that you normally use to open directories in your editor.
Editor 'commandToOpen' value
VSCode code
Atom atom
Sublime subl
Vim vim
WebStorm wstorm

> projects.name :

  • This is the name that will be visible when you type projectman open

> projects.path :

  • This should be the absolute path to your folder.

> projects.editor :

  • This is optional key. In case it doesn't exist it will read value from commandToOpen
  • You can use this to specify separate editor for a particular project.
  • You can set it by adding "editor": "<commandToOpen>" in projects array in settings.json (Example is shown above)

ChangeLogs

v2.0.0 @latest

  • Add pm create command
  • Remove support for binaries

For More Changes read CHANGELOG.md


Rust Port

@hskang9 has made a pretty cool rust port for projectman. You can check it out at: https://github.com/hskang9/projectman-rust


Contributing to ProjectMan

contributions welcome to projectman

I would be extremely happy to have people contribute to ProjectMan. You can read Contribution guidelines in CONTRIBUTING.md


Thank you for showing Interest! Do contribute and star ProjectMan🦸 on GitHub

projectman's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

projectman's Issues

Connect Project with the git repository hosting

It would be useful to associate a project with like a github repository, then users would be able to open the repository page in the browser using projectman directly.

Suggestions:
pm addrepo [projectName] [--url=<url>]
This would prompt the user if arguements are not specified, and add the url into the settings.json file with the project meta.

Open the repository page:
pm openRepo [projectName] [--browser=<browser>]
Opens with default browser or the browser given if specified.

This added infromation might be useful in the future, for example, if you wanted to inplement a clone feature, or what not.

Testing for CLI commands

the functions in helper.js are straight forward we can simply write unit tests (Checkout #28 if you're interested in writing unit test for lib/helper.js) but lib/action.js is comparatively complicated to test since it asks for user inputs.

If you know about any way of handling these user inputs through testing do let me know here :D

Add possibility to extend editors

Currently, only popular editors are available.

Will be useful to allow custom editor commands.
For instance, I use vim for some projects, and webstorm for Web projects and Idea for Java, etc.

Projects are erased after updating package

So when a user installs the package he gets settings.json in his npm global directory/projectman/lib/settings.json. Since it is also a part of package it is replaced with blank settings.json every time a user updates the package.

I can't really think of any way to stop this, Any ideas?

Sorting projects in `pm open`

Was thinking about the ways we can sort projects in pm open. I am highly thinking about sorting them as per the last opened date. So the recently opened project will be listed first and last opened will be listed last.

Is there any other parameter we can use to sort projects? Let's discuss here.

and should we really sort projects or keep them as it is?

`cd` to the project directory

Not really an issue. Just a feature request if possible.

It would be nice if the terminal will also change directory after running the pm open project command.
Or even more, extend it to run npm scripts like npm start.

Need to setup Unit Tests

If anyone wants to help me out by settings up unit tests for actions and other functions do comment here.

I will prefer Mocha and Chai for unit tests, let's discuss here if you want to use any other libraries

Add possibility to don't open editor

I'd find it very useful to have a possibility do don't use any editor, i.e I just want to cd to the project directory and don't open any editor.

I use Android Studio for some of my projects so it's annoying to close VSCode every time I use pm open.

Open project in CLI

Hi @saurabhdaware, very nice tool :)

Is it possible to add a way to jump directly in the CLI to the project root? So instead of open an IDE just jump to the project path in the current command line?

br

Direct way to add project specific editor

So in v1.1.0 #10 , I added a way to add multiple editors, so since this version you can pm edit and add "editor" key in projects[] which will be specific to that project only

{
    "commandToOpen": "code",
    "projects": [
        {
            "name": "Project1",
            "path": "path/to/project1"
        },
        {
            "name": "Project2",
            "path": "path/to/project2",
            "editor": "atom"
        },
        {
            "name": "Project3",
            "path": "path/to/project3"
        }
    ]
}

So having this in settings will let you open other projects in VSCode but Project2 in Atom.

Problem?
User has to pm edit and add "editor" key manually.

Things I regret but can't change
Can't really change the behavior of pm seteditor(which I regret, it should've been something like pm setdefaulteditor) or any other command since a lot of people are already using it and in documentation I don't want to suddenly be like It works like A in v1.1.0 and like B in v1.2.0

Any suggestions on how we can solve this?
Also, please discuss here and wait for confirmation before actually writing code and sending PR

Using "pm open foo" opens document rather than project

I added a project called accounts. When I use pm without arguments I can select accounts from the menu and it opens the expected project. When I try:

pm open accounts

I get an editor with an empty document called accounts. The settings have

"commandToOpen": "code",

I am on macOS Mojave, node v10.16.3.

(Only just installed, and looking forward to trying projectman over next week. Thanks for sharing.)

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.