Metadata-Version: 2.5
Name: spin-up-dev-project
Version: 0.2.0
Summary: Spin up a new project: directory, README, git repo, private GitHub repo, then launch your coding agent.
Project-URL: Homepage, https://github.com/lorenzowood/spin-up
Project-URL: Issues, https://github.com/lorenzowood/spin-up/issues
Author: Lorenzo Wood
License-Expression: MIT
License-File: LICENSE
Keywords: cli,coding-agent,git,github,scaffold
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# spin-up

Start a new project in one command: create the directory, drop in a placeholder
`README.md`, `git init`, commit, create a **private** GitHub repo, push, and then
launch your coding agent inside it.

```console
$ spin-up claude ~/Projects/local-ai-library
Created https://github.com/you/local-ai-library (private)
# ...and Claude Code starts in ~/Projects/local-ai-library
```

## Requirements

- Python 3.10+
- [`git`](https://git-scm.com/)
- the [GitHub CLI](https://cli.github.com/) (`gh`), authenticated (`gh auth login`).
  spin-up checks this on every run, and creates repos under the account `gh` is
  logged in as, so there is no owner to configure
- whichever coding agent(s) you want to launch

## Install

The PyPI package is `spin-up-dev-project`; the command it installs is `spin-up`.

```console
uv tool install spin-up-dev-project      # or: pipx install spin-up-dev-project
```

## Configure agents

Create `~/.config/spin-up` mapping a key to the command that starts your agent,
one per line (blank lines and `#` comments are ignored):

```
claude: claude --dangerously-skip-permissions
cursor: cursor-agent
```

## Usage

```
spin-up [-y] [-q] [--owner OWNER] <agent> <directory> [<name>]
```

| Argument | Meaning |
| --- | --- |
| `agent` | A key from `~/.config/spin-up`. |
| `directory` | The directory to create. It **must not already exist**. Its basename is the repo name. |
| `name` | Optional title for the README's `# H1`. Defaults to the directory name. |
| `--owner` | GitHub owner for the new repo. Defaults to the user `gh` is logged in as. |
| `-q`, `--quiet` | Don't print progress messages. |
| `-y`, `--yes` | Don't ask for confirmation when possibly-related repos are found. |

What it does, in order:

1. Checks the agent is configured and its command is on `PATH`, that the
   directory doesn't exist, and that `gh` is authenticated. Nothing is created if any check fails.
2. Lists your GitHub repos and looks for ones that might be related (see below).
   If any are found it prints them and asks `Continue with spin-up of <directory>?`.
3. Creates the directory and `README.md`, runs `git init -b main`, and commits.
4. Creates the **private** repo `<owner>/<directory-name>` and pushes.
5. If run inside [herdr](https://herdr.dev) (`HERDR_WORKSPACE_ID` is set), renames the
   current workspace to `<name>` if given, else the directory name. A failure here is
   only a warning.
6. Replaces itself with the agent command, running in the new directory.

### Related-repo check

To avoid starting a project you already have, the directory name is split on
`-`, `_`, `.` and spaces; words are lower-cased and singularised
(`libraries` → `library`); common stop words (`the`, `a`, `of`, `and`, …) are
dropped. Any existing repo whose name shares at least one remaining word is
listed as possibly related. Only repo *names* are compared, and singularisation
is a small rule-based English heuristic rather than a full dictionary.

## Development

```console
uv run --with pytest --with-editable . pytest
```

The tests use real `git` and a fake `gh` on `PATH`, so they never touch GitHub.

## Licence

MIT
