Publish projects to GitHub.
Creates a new GitHub repository and pushes the current project. Automatically infers the repo name from the folder name and handles both new repos and existing ones.
# Interactive mode - prompts for name and visibility
f publish
# Skip prompts, use folder name, default to private
f publish -y
# Create public repo
f publish --public
# Create with specific name
f publish --name my-awesome-project| Option | Short | Description |
|---|---|---|
--name <NAME> |
-n |
Repository name (defaults to folder name) |
--public |
Create as public repository | |
--private |
Create as private repository | |
--description <DESC> |
-d |
Repository description |
--yes |
-y |
Skip prompts, use defaults (private, folder name) |
- GitHub CLI installed (
gh) - Authenticated with
gh auth login
Without flags, prompts for configuration:
$ f publish
Repository name [my-project]:
Visibility (public/private) [private]: public
Create repository:
Name: username/my-project
Visibility: public
Proceed? [Y/n]:# Use all defaults (private, folder name as repo name)
f publish -y
# Public repo with defaults
f publish -y --public
# Specific name and description
f publish -n cool-tool -d "A cool CLI tool" --publicIf the repository already exists on GitHub:
- Checks current visibility
- Updates visibility if different from requested
- Adds origin remote if missing
- Pushes current branch
$ f publish --public
Repository username/my-repo already exists (private).
Updating visibility to public...
✓ Updated to public
✓ https://github.com/username/my-repo- Check gh CLI - Verifies GitHub CLI is installed
- Check authentication - Ensures you're logged in to GitHub
- Get username - Fetches your GitHub username
- Determine repo name - Uses
--name, folder name, or prompts - Determine visibility - Uses
--public/--privateor prompts - Check if exists - If repo exists, updates visibility if needed
- Initialize git - If not a git repo, runs
git init - Create initial commit - If no commits, stages all and commits
- Create repository - Uses
gh repo createwith--source=. --push - Output URL - Prints the GitHub URL
cd my-new-project
f publish -y --public
# ✓ Published to https://github.com/username/my-new-projectf publish -n api-server -d "REST API for my app" --private# Repo exists as private, make it public
f publish --public
# Repository username/my-repo already exists (private).
# Updating visibility to public...
# ✓ Updated to public#!/bin/bash
cd /path/to/project
f publish -y --public -n release-candidateInstall from https://cli.github.com:
# macOS
brew install gh
# Linux
sudo apt install gh # or equivalentRun gh auth login and follow the prompts.
Ensure you're authenticated: gh auth status
Some visibility changes may require specific permissions or GitHub plan features.