Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rudrapatel50/autopilot) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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/autopilotFeatures
✅ 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 connectWhat 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_TOKENenvironment variable as fallback - Only allows one connected account at a time
Creating a GitHub Token:
- Go to: https://github.com/settings/tokens?type=beta
- Click "Generate new token" (Fine-grained)
- 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)
- Token name:
- 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)
- Click "Generate token" and copy it immediately
- Run
autopilot connectand paste your token
autopilot user
Check which GitHub account is currently connected.
autopilot userWhat 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 logoutWhat it does:
- Removes your stored GitHub token from the system keychain
- Disconnects your current session
- Requires running
autopilot connectagain 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 initWhat it does:
- Checks if you're authenticated (prompts to run
autopilot connectif not) - Verifies Git is installed on your system
- Initializes a git repository if not already initialized
- Sets default branch to
main - Optionally creates
.gitignoreandREADME.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 pushWhat 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 pushautopilot --help
Display help information for all available commands.
autopilot --helpautopilot --version
Show the current version of Autopilot.
autopilot --versionQuick Start
Install Autopilot
npm install -g @rudrapatel50/autopilot
Connect your GitHub account
autopilot connect
Verify your connection
autopilot user
Initialize a repository
cd your-project autopilot initMake changes and push
autopilot push
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 linkProject 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.mdTechnologies 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
- GitHub authentication with PAT
- Secure credential storage
- User connection status
- Logout and credential management
- Repository initialization (
autopilot init) - 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)