Skip to content

netmask/one

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ One CLI

The unified command-line tool for freelancers

Go Version License Platform

Work across multiple projects with a single, beautiful interface for PRs, tickets, and more.

Installation β€’ Quick Start β€’ Features β€’ Documentation


πŸ’‘ What is One CLI?

One CLI is designed for freelancers and consultants who juggle multiple clients and projects. Instead of remembering different workflows, credentials, and commands for each project, One provides a unified interface that adapts to your current project automatically.

The Problem

# Project A (Client 1) - GitHub + Jira
cd ~/client1/project-a
git checkout -b PROJ-123-feature
# ... make changes ...
git push origin PROJ-123-feature
# Open browser, create PR manually, copy ticket link...

# Project B (Client 2) - GitLab + Linear
cd ~/client2/project-b  
git checkout -b LIN-456-feature
# ... different workflow ...
# Different credentials, different browser profile...

The Solution

# Any project, anywhere
cd ~/any/project
one start PROJ-123    # Automatically: checkout, pull, create branch
# ... make changes ...
one pr                # Automatically: push, create PR, open in browser

One CLI automatically detects your project, uses the right credentials, opens the correct browser profile, and creates PRs in the right format.


✨ Features

🎨 Beautiful TUI

  • Interactive forms powered by Huh
  • Real-time progress with Bubble Tea
  • Markdown rendering via Glamour

πŸ”’ Secure by Default

  • Credentials in OS keyring (never plaintext)
  • OAuth device flow for GitHub
  • Per-project credential isolation
  • No manual token management

🌐 Multi-Provider

  • Git: GitHub, GitLab, Bitbucket
  • Tickets: Jira, Linear, GitHub Issues
  • Browsers: Chrome, Firefox, Safari
    • Shows actual profile names & emails
    • No more "Profile 1" confusion!

⚑ Smart & Fast

  • Auto-detects Git provider, owner, repo
  • Auto-detects browser profiles with emails
  • Hooks for linting, testing, automation
  • < 100ms startup time
  • Single binary, no dependencies
  • Cross-platform (macOS/Linux/Windows)

🎬 Demo

Initialize a Project

$ one init
βœ“ Detected Git remote: github (acme-corp/main-app)

β”Œβ”€ Project Name ────────────────────────────┐
β”‚ Acme Corp                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€ Git Provider ────────────────────────────┐
β”‚ > GitHub          (Detected: github)      β”‚
β”‚   GitLab                                  β”‚
β”‚   Bitbucket                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

βœ“ Configuration saved successfully!

πŸ” Starting GitHub authentication...
Please visit: https://github.com/login/device
And enter code: ABCD-1234

Waiting for authorization......

βœ“ Successfully authenticated with GitHub!

Start Working

$ one start PROJ-1234
Starting new task...

  Project: Acme Corp

  βœ“ Checked out main
  βœ“ Pulled from origin/main
  βœ“ Fetching ticket info...
  βœ“ Created branch PROJ-1234-add-user-authentication

βœ“ Ready to work on PROJ-1234-add-user-authentication!

  When done, run: one pr

Create a PR

$ one pr
Creating pull request...

  Project: Acme Corp
  Branch: PROJ-1234-add-authentication
  Ticket ID: PROJ-1234

  βœ“ Pushed to origin
  βœ“ PR created: https://github.com/acme/app/pull/123

⚑ Running after_pr hooks...

  [1/1] Notify team
  βœ“ Success (0.3s)

Opening in browser (Work Profile - john@acme.com)...

Done! πŸš€

Everything automated: Git detection, OAuth, hooks, browser profiles!


πŸ“¦ Installation

Using Go

go install github.com/yourusername/one@latest

From Source

git clone https://github.com/yourusername/one.git
cd one
make build
sudo make install

Homebrew (Coming Soon)

brew install one-cli

πŸš€ Quick Start

1. Navigate to Your Project

cd /path/to/your/project

2. Initialize Configuration

one init

This interactive wizard will:

  • βœ… Auto-detect your Git remote (GitHub/GitLab/Bitbucket)
  • βœ… Pre-fill owner and repository from remote URL
  • βœ… Detect your default branch (main/master/develop)
  • βœ… Authenticate with GitHub via OAuth (optional)
  • βœ… Configure browser profiles for work/personal separation
  • βœ… Set up ticket system integration (Jira/Linear)

3. Start Working

# Start a new task
one start PROJ-1234

# Make your changes
git add .
git commit -m "Add feature"

# Create a PR (push + create + open in browser)
one pr

That's it! One CLI handles the rest. πŸŽ‰


🎯 Key Commands

Command Description
one init Interactive setup with Git auto-detection
one start <ticket-id> Start working on a task (checkout, pull, create branch)
one pr Create and open a pull request
one ticket <ticket-id> Open ticket in browser
one config list List all configured projects
one config show Show current project config
one profiles List browser profiles with emails
one help Beautiful formatted help
one docs View documentation

🎨 Screenshots

Interactive Setup

Init Command

Real-time Progress

Start Command

Beautiful Documentation

Help Command


πŸ“š Documentation


πŸ”§ Configuration

One CLI uses YAML configuration files stored in ~/.config/one/projects/.

Example Configuration

version: 1

project:
  name: "Acme Corp"
  paths:
    - "/Users/john/Projects/acme-app"

git:
  provider: github
  remote: origin
  base_branch: main
  
  github:
    owner: acme-corp
    repo: main-app
    token_env: GITHUB_TOKEN

browser:
  type: chrome
  profile: "Work Profile"  # Keep work and personal separate!

ticket:
  system: jira
  base_url: https://acme.atlassian.net
  
  jira:
    board_id: ACME

templates:
  pr_title: "[{ticket_id}] {branch_name}"
  pr_body: |
    ## Changes
    - 
    
    ## Ticket
    {ticket_url}

branch_patterns:
  ticket_id: "^([A-Z]+-\\d+)"

# Hooks: Run commands before/after PR creation
hooks:
  before_pr:
    - name: "Lint code"
      command: "bundle exec rubocop"
      fail_on_error: true  # Stop if lint fails
    
    - name: "Run tests"
      command: "bundle exec rspec"
      fail_on_error: true  # Stop if tests fail
  
  after_pr:
    - name: "Notify team"
      command: 'curl -X POST $SLACK_WEBHOOK -d "{\"text\":\"PR created!\"}"'
      fail_on_error: false  # Continue even if notification fails

See examples/ for more configurations and HOOKS.md for complete hooks documentation.


🀝 Why One CLI?

For Freelancers & Consultants

  • Multiple Clients: Different projects, different providers, one workflow
  • Context Switching: Automatic project detection, no mental overhead
  • Professional: Browser profiles keep work separate from personal
  • Secure: OS keyring integration, never store tokens in plaintext

For Teams

  • Onboarding: New team members set up in minutes with one init
  • Consistency: Everyone uses the same workflow across projects
  • Standards: Enforce PR templates and branch naming conventions
  • Flexibility: Each project can have its own configuration

πŸ› οΈ Technology Stack

Built with the Charm ecosystem:

Plus:


🌟 Features Deep Dive

🎯 Auto-Detection

One CLI is smart about your environment:

  • Git Remote: Detects GitHub/GitLab/Bitbucket from git remote
  • Owner & Repo: Parses SSH and HTTPS remote URLs
  • Default Branch: Detects main/master/develop
  • Project Path: Uses current directory automatically

πŸ” GitHub OAuth Device Flow

Secure authentication without copying tokens:

$ one init
# ... configuration ...

β”Œβ”€ Authenticate with GitHub now? ───────────┐
β”‚ > Yes, authenticate                       β”‚
β”‚   Skip for now                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ” Starting GitHub authentication...
Please visit: https://github.com/login/device
And enter code: ABCD-1234

Waiting for authorization......
βœ“ Successfully authenticated with GitHub!

Your token is securely stored in:

  • macOS: Keychain
  • Linux: Secret Service (gnome-keyring/kwallet)
  • Windows: Credential Manager

🌐 Browser Profiles

Keep work and personal browsing separate:

browser:
  type: chrome
  profile: "Work Profile"

One CLI opens PRs in your work browser profile with your work Google account logged in. No more confusion!

πŸ“ Template System

Customize PR titles and descriptions per project:

templates:
  pr_title: "[{ticket_id}] {branch_name}"
  pr_body: |
    ## πŸ“ Summary
    
    
    ## πŸ”— Related
    - Ticket: {ticket_url}
    - Branch: {branch_name}
    - Author: {author}
    
    ## βœ… Checklist
    - [ ] Tests added
    - [ ] Docs updated

Available variables:

  • {ticket_id} - Extracted from branch name
  • {branch_name} - Current branch
  • {ticket_url} - Generated ticket URL
  • {author} - Git user name
  • {email} - Git user email
  • {date} - ISO 8601 date

πŸŽ“ Use Cases

Freelance Developer with Multiple Clients

# Client A - GitHub + Jira
cd ~/clients/acme
one start ACME-123  # Uses Acme config automatically

# Client B - GitLab + Linear
cd ~/clients/beta
one start BET-456   # Uses Beta config automatically

# Personal Project - GitHub
cd ~/personal/side-project
one start FEAT-789  # Uses personal config automatically

Consultant Switching Contexts

# Morning: Enterprise client (strict PR template)
cd ~/work/enterprise
one start ENT-1001
one pr  # Opens in work Chrome profile

# Afternoon: Startup client (simple workflow)
cd ~/work/startup
one start DEV-42
one pr  # Opens in different Chrome profile

# Evening: Open source (personal)
cd ~/oss/project
one start ISS-99
one pr  # Opens in personal browser

πŸ“Š Comparison

Feature One CLI Manual Workflow Other Tools
Multi-project support βœ… Automatic ❌ Manual ⚠️ Limited
Auto-detection βœ… Git remote ❌ None ❌ None
GitHub OAuth βœ… Device flow ❌ Manual tokens ❌ Manual
Browser profiles βœ… Yes ❌ Manual ❌ No
Ticket integration βœ… Multiple systems ❌ Manual ⚠️ Single
Cross-platform βœ… Full βœ… Yes ⚠️ Limited
Secure storage βœ… OS keyring ❌ Plaintext ⚠️ Varies
Setup time βœ… < 2 minutes ❌ Per project ⚠️ Complex

πŸ€” FAQ

Do I need to configure each project manually?

No! Run one init in your project directory and it will:

  • Auto-detect your Git provider from the remote URL
  • Pre-fill owner and repository information
  • Detect your default branch
  • Optionally authenticate via OAuth

You just confirm the detected values.

How does One CLI know which project I'm working on?

One CLI checks your current working directory against configured project paths. It uses prefix matching, so any subdirectory of a configured project will work.

cd ~/projects/acme/src/api  # Matches ~/projects/acme
one pr                      # Uses Acme config automatically
Is it safe to store credentials?

Yes! One CLI uses your operating system's native secure storage:

  • macOS: Keychain Services
  • Linux: Secret Service (gnome-keyring/kwallet)
  • Windows: Credential Manager

Credentials are never stored in plaintext files. You can also use environment variables as a fallback.

Can I use it with self-hosted Git servers?

Yes! One CLI supports:

  • GitHub Enterprise
  • Self-hosted GitLab instances
  • Bitbucket Server

Just specify the base URL in your configuration.

Does it work with my ticket system?

One CLI supports:

  • Jira Cloud (with API integration)
  • Linear (URL generation)
  • GitHub Issues (URL generation)

More integrations coming soon! Or use custom ticket URLs.


πŸ›£οΈ Roadmap

  • OAuth flows for GitLab and Bitbucket
  • Browser profile auto-detection
  • Shell completions (bash/zsh/fish)
  • Draft PR support
  • Linear API integration (not just URLs)
  • Azure DevOps support
  • PR review commands
  • Multi-repo operations
  • GitHub App instead of OAuth app
  • Team features (shared configs)

🀝 Contributing

Contributions are welcome! Whether it's:

  • πŸ› Bug reports
  • πŸ’‘ Feature requests
  • πŸ“ Documentation improvements
  • πŸ”§ Code contributions

Please see CONTRIBUTING.md for guidelines.


πŸ“„ License

MIT License - see LICENSE for details.


πŸ’– Acknowledgments

Built with the amazing Charm ecosystem:


Made with ❀️ for freelancers and consultants

⭐ Star on GitHub β€’ πŸ› Report Bug β€’ πŸ’‘ Request Feature

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published