Typings

vcspull.types defines the typed dictionaries and aliases that describe configuration data on its way from file to sync — the annotations to reach for when you type code that calls vcspull.config.

Typings for vcspull.

Configuration Object Graph

The user-facing .vcspull.yaml maps workspace roots (parent directories) to named repositories. For example:

~/study/c:
  cpython:
    repo: git+https://github.com/python/cpython.git
  tmux:
    repo: git+https://github.com/tmux/tmux.git

~/work/js:
  react:
    repo: https://github.com/facebook/react.git
  vite:
    repo: https://github.com/vitejs/vite.git

In Python we model this as:

WorkspaceRoot - Mapping of repository name to its configuration WorkspaceRoots - Mapping of workspace root path to WorkspaceRoot

When the configuration is parsed we preserve the original key string, but WorkspaceRoot terminology is used consistently across the codebase.

class vcspull.types._WorktreeConfigDictRequired
class vcspull.types._WorktreeConfigDictRequired

Bases: TypedDict

Configuration for a single git worktree.

Worktrees allow checking out multiple branches/tags/commits of a repository simultaneously in separate directories.

Exactly one of tag, branch, or commit must be specified.

Examples

Tag worktree (immutable, detached HEAD):

{"dir": "../myproject-v1.0", "tag": "v1.0.0"}

Branch worktree (updatable):

{"dir": "../myproject-dev", "branch": "develop"}

Commit worktree (immutable, detached HEAD):

{"dir": "../myproject-abc", "commit": "abc123"}
class vcspull.types._WorktreeConfigDictOptional
class vcspull.types._WorktreeConfigDictOptional

Bases: TypedDict

Optional configuration for a single git worktree.

class vcspull.types.WorktreeConfigDict
class vcspull.types.WorktreeConfigDict

Bases: _WorktreeConfigDictRequired, _WorktreeConfigDictOptional

Configuration for a single git worktree.

class vcspull.types.RepoPinDict
class vcspull.types.RepoPinDict

Bases: TypedDict

Per-operation pin flags for a repository entry.

Unspecified keys default to False (not pinned).

Note: Distinct from WorktreeConfigDict.lock which prevents git worktree removal at the filesystem level. RepoPinDict controls vcspull config mutation policy only.

Examples

Pin only import:

options:
  pin:
    import: true

Pin import and fmt:

options:
  pin:
    import: true
    fmt: true
class vcspull.types.RepoOptionsDict
class vcspull.types.RepoOptionsDict

Bases: TypedDict

Per-repository options stored under the options: key in a repo entry.

Two groups of keys live here:

  • Sync tuning (rev, shallow, depth) — forwarded to libvcs to shape how the checkout is cloned/updated.

  • Mutation policy (pin, allow_overwrite, pin_reason) — guards whether vcspull’s commands may rewrite this config entry.

Note: pin here controls vcspull config mutation. It is distinct from WorktreeConfigDict.lock which prevents git worktree removal.

Examples

Pin to a ref and clone with a small history window:

options:
  rev: v1.2.3
  depth: 50

Pin all operations:

options:
  pin: true
  pin_reason: "pinned to upstream"

Pin only import (prevent --sync from replacing URL):

options:
  pin:
    import: true

Shorthand form — equivalent to pin: {import: true}:

options:
  allow_overwrite: false
class vcspull.types._RepoEntryDictRequired
class vcspull.types._RepoEntryDictRequired

Bases: TypedDict

Raw per-repository entry as written to .vcspull.yaml.

Examples

Minimal entry:

repo: git+git@github.com:user/myrepo.git

Pinned to a ref and shallow-cloned:

repo: git+git@github.com:user/myrepo.git
options:
  rev: v1.2.3
  depth: 50

With pin options:

repo: git+git@github.com:user/myrepo.git
options:
  pin:
    import: true
  pin_reason: "pinned to company fork"
class vcspull.types._RepoEntryDictOptional
class vcspull.types._RepoEntryDictOptional

Bases: TypedDict

Optional raw per-repository entry fields.

class vcspull.types.RepoEntryDict
class vcspull.types.RepoEntryDict

Bases: _RepoEntryDictRequired, _RepoEntryDictOptional

Raw per-repository entry as written to .vcspull.yaml.

class vcspull.types.RawConfigDict
class vcspull.types.RawConfigDict

Bases: TypedDict

Configuration dictionary without any type marshalling or variable resolution.

class vcspull.types._ConfigDictRequired
class vcspull.types._ConfigDictRequired

Bases: TypedDict

Required fields for resolved vcspull configuration entries.

class vcspull.types._ConfigDictOptional
class vcspull.types._ConfigDictOptional

Bases: TypedDict

Optional fields for resolved vcspull configuration entries.

class vcspull.types.ConfigDict
class vcspull.types.ConfigDict

Bases: _ConfigDictRequired, _ConfigDictOptional

Configuration map for vcspull after shorthands and variables resolved.