npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@rudrapatel50/autopilot

v1.0.5

Published

A CLI that watches your project, commits, and pushes automatically

Readme

Git Autopilot

Autopilot: a CLI that watches your project, commits, and pushes automatically — zero Git hassle.

Autopilot is a lightweight, developer-friendly CLI tool that automates Git initialization, commits, and pushes. It lets developers instantly turn any local folder into a live GitHub repository — handling setup, authentication, and auto-pushing file changes behind the scenes.

Designed for simplicity, Autopilot is ideal for developers who frequently create small experiments, side projects, or micro-repos and want Git/GitHub setup to be completely hands-off.

Installation

npm install -g @git/autopilot

Features

Connect to GitHub - Securely store your GitHub Personal Access Token
Check Connection - Verify your current GitHub connection status
Logout - Disconnect and remove stored credentials
Repository Initialization - Create GitHub repos from local folders
Commit & Push - Easily commit and push changes to GitHub
🤖 AI-Powered Commits - Smart commit messages generated by AI (coming soon)
🚧 Watch Mode - Monitor file changes and auto-push (coming soon)

Commands

autopilot connect

Connect your GitHub account by providing a Personal Access Token (PAT).

autopilot connect

What it does:

  • Prompts for your GitHub Personal Access Token
  • Validates the token with GitHub API
  • Securely stores credentials in your system keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service)
  • Supports GITHUB_TOKEN environment variable as fallback
  • Only allows one connected account at a time

Creating a GitHub Token:

  1. Go to: https://github.com/settings/tokens?type=beta
  2. Click "Generate new token" (Fine-grained)
  3. Configure your token:
    • Token name: autopilot-cli (or any name you prefer)
    • Expiration: 30 days, 90 days, or custom (recommended: 90 days)
    • Repository access: All repositories (or select specific ones)
  4. Required Permissions (under "Repository permissions"):
    • Administration: Read and write (required for creating repositories)
    • Contents: Read and write (required for pushing code)
    • Metadata: Read-only (automatically included)
  5. Click "Generate token" and copy it immediately
  6. Run autopilot connect and paste your token

autopilot user

Check which GitHub account is currently connected.

autopilot user

What it does:

  • Displays your connected GitHub username
  • Shows additional profile information (name, email if available)
  • Validates that your token is still valid

autopilot logout

Disconnect your GitHub account and remove stored credentials.

autopilot logout

What it does:

  • Removes your stored GitHub token from the system keychain
  • Disconnects your current session
  • Requires running autopilot connect again to reconnect

Use cases:

  • Switching to a different GitHub account
  • Revoking access when done with a project
  • Security best practice when sharing a machine

autopilot init

Initialize a git repository and create it on GitHub.

autopilot init

What it does:

  • Checks if you're authenticated (prompts to run autopilot connect if not)
  • Verifies Git is installed on your system
  • Initializes a git repository if not already initialized
  • Sets default branch to main
  • Optionally creates .gitignore and README.md
  • Creates an initial commit
  • Prompts to create a new GitHub repository
  • Configures the remote origin
  • Pushes your code to GitHub

Interactive prompts:

  • Repository name (defaults to current folder name)
  • Repository description (optional)
  • Public or private repository
  • Create initial files (.gitignore, README.md)

Example workflow:

cd my-new-project
autopilot init
# Follow the prompts, and your project is live on GitHub!

autopilot push

Commit and push your changes to GitHub.

autopilot push

What it does:

  • Checks authentication and Git installation
  • Verifies you're in a git repository with a remote
  • Shows what files have changed
  • Prompts for a commit message
  • Stages all changes
  • Creates a commit
  • Pushes to your remote repository

Features:

  • Smart error handling for common push issues
  • Shows preview of changed files
  • Detects and handles missing upstream branches
  • Handles diverged branch scenarios
  • Default commit message with timestamp if needed

Example:

# Interactive mode (prompts for message)
autopilot push

autopilot --help

Display help information for all available commands.

autopilot --help

autopilot --version

Show the current version of Autopilot.

autopilot --version

Quick Start

  1. Install Autopilot

    npm install -g @rudrapatel50/autopilot
  2. Connect your GitHub account

    autopilot connect
  3. Verify your connection

    autopilot user
  4. Initialize a repository

    cd your-project
    autopilot init
  5. Make changes and push

    autopilot push
  6. When you're done, logout

    autopilot logout

How It Works

Secure Credential Storage

Autopilot uses @napi-rs/keyring to securely store your GitHub token in your operating system's native credential manager:

  • macOS: Keychain
  • Windows: Credential Manager
  • Linux: Secret Service API (libsecret)

Your token is never stored in plain text files, ensuring your credentials remain secure.

Token Validation

When you connect, Autopilot validates your token by making a request to GitHub's API (GET /user). This ensures:

  • The token is valid and active
  • You have the necessary permissions
  • We can retrieve your GitHub username for display

AI-Powered Commit Messages (Coming Soon)

Autopilot will integrate AI to automatically generate meaningful commit messages based on your code changes. The AI will:

  • Analyze file diffs to understand what changed
  • Generate descriptive, conventional commit messages
  • Follow best practices for commit message formatting
  • Support customization for different commit message styles

This feature will make autopilot push and autopilot watch even more hands-off by eliminating the need to write commit messages manually.

Development

Prerequisites

  • Node.js 16+
  • npm or yarn

Setup

# Clone the repository
git clone https://github.com/rudrapatel50/autopilot.git
cd autopilot

# Install dependencies
npm install

# Build the project
npm run build

# Link for local development
npm link

Project Structure

autopilot/
├── src/
│   ├── cli.ts              # CLI entry point and command registration
│   ├── commands/
│   │   ├── connect.ts      # GitHub connection logic
│   │   ├── init.ts         # Repository initialization
│   │   ├── logout.ts       # Logout and credential removal
│   │   ├── push.ts         # Commit and push changes
│   │   └── user.ts         # User info display
│   └── lib/
│       ├── cerds.ts        # Credential management (keyring)
│       └── git.ts          # Git command utilities
│       └── github.ts       # GitHub API interactions
├── package.json
├── tsconfig.json
└── README.md

Technologies Used

  • TypeScript - Type-safe development
  • Commander.js - CLI framework and command parsing
  • @napi-rs/keyring - Cross-platform secure credential storage
  • axios - HTTP client for GitHub API
  • prompts - Interactive CLI prompts
  • chalk - Terminal styling and colors

Roadmap

  • [x] GitHub authentication with PAT
  • [x] Secure credential storage
  • [x] User connection status
  • [x] Logout and credential management
  • [x] Repository initialization (autopilot init)
  • [x] Manual commit and push (autopilot push)
  • [ ] AI-powered commit message generation
  • [ ] Watch mode with auto-commit/push (autopilot watch)
  • [ ] Configuration file support
  • [ ] Multiple account support

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Author

Rudra Patel (@rudrapatel50)