Skip to content

Repository files navigation

pm

A fast Rust project manager CLI for switching between repositories, tracking recent projects, and organizing work across GitHub orgs.

Install

cargo install --path .

The CLI binary is p.

Nix

The repository provides a flake package. To use p in another flake, add it as an input and include the package in your development shell:

{
  inputs.pm.url = "github:jakeisnt/pm";

  outputs = { nixpkgs, pm, ... }:
    let
      system = "aarch64-darwin"; # or x86_64-linux, etc.
      pkgs = import nixpkgs { inherit system; };
    in {
      devShells.${system}.default = pkgs.mkShell {
        packages = [ pm.packages.${system}.default ];
      };
    };
}

For a one-off install, use nix profile install github:jakeisnt/pm. The package can also be run directly with nix run github:jakeisnt/pm.

Development

This repository pins Rust in rust-toolchain.toml.

cargo build
cargo test
cargo clippy -- -D warnings
cargo fmt --check

Usage

# Interactive project switcher
p

# Jump directly to a project; if no match is found, opens the selector with this query prefilled
p pm

# Open pi in the selected project
p --agent pm
p -a

# Resolve a project path
p resolve pm

# Create a new private GitHub repo and clone it under ~/Documents/<owner>/<repo>
p create my-new-repo
p create ulnd/my-new-repo --description "Demo project"
# Public repositories are intentionally refused by p; create those manually.

# List all projects
p list
p list --json
p list --source local

# Remove a project from disk
p remove /path/to/project --force

# Rename a project locally and on GitHub
# First argument: current name. Second argument: desired new name.
p rename <old-name> <new-name>
p r <old-name> <new-name>

# Move a linked worktree branch back onto the primary checkout
p worktree checkout <branch-name>
p worktree co <branch-name>

# Manage org visibility
p org list
p org hide <org>
p org show <org>

# Authenticate GitHub access for remote repository lookup/clone
PM_GITHUB_CLIENT_ID=<oauth-client-id> p github login
p github status
p github logout

# Install a shell hook that indexes repositories after git init/clone/worktree add
p hook-install
# Or choose a shell explicitly
p hook-install zsh
p hook-install bash
p hook-install fish

# Print the hook without installing it
p hook zsh

# Force a full reindex of configured local roots and accessible GitHub remotes
p index

# Index one git repository manually (used by shell hooks)
p index /path/to/repo

# Manage config.json
p config list
p config set searchDepth 3
p config delete searchDepth

Configuration

config.json in the current checkout supports:

  • searchRoots: array of directories to scan for Git repositories
  • searchDepth: recursion depth for project discovery

Runtime state is stored in SQLite under the platform data directory (pm/pm.db). GitHub OAuth tokens are stored separately in the platform config directory (pm/github-token) with user-only permissions on Unix.

p hook-install installs an idempotent hook block in your shell startup file (.zshrc, .bashrc, or ~/.config/fish/conf.d/p.fish). The hook wraps git and only runs after successful repository-creating commands such as git init, git clone, and git worktree add; it does not run on prompt or directory changes. When it runs, it calls p index --quiet <repo-path> in the background. p index <repo-path> records that local repository and, when origin points at GitHub, stores the owner/repo remote in the index too. Running p index without a path forces a full reindex of configured local roots plus GitHub repositories accessible to your authenticated account.

License

MIT

About

Project shortcut CLI. Pretend you don't have a file system.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages