docs/commands/publish.md
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) |
gh)gh auth loginWithout 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" --public
If the repository already exists on GitHub:
$ f publish --public
Repository username/my-repo already exists (private).
Updating visibility to public...
✓ Updated to public
✓ https://github.com/username/my-repo
--name, folder name, or prompts--public/--private or promptsgit initgh repo create with --source=. --pushcd my-new-project
f publish -y --public
# ✓ Published to https://github.com/username/my-new-project
f 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-candidate
Install from https://cli.github.com:
# macOS
brew install gh
# Linux
sudo apt install gh # or equivalent
Run 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.