Skip to main content

Commands

mani​

repositories manager and task runner

Options​

--color enable color (default true)
-c, --config string specify config
-h, --help help for mani
-u, --user-config string specify user config

run​

Run tasks

Synopsis​

Run tasks.

The tasks are specified in a mani.yaml file along with the projects you can target.

run <task>

Examples​

# Execute task for all projects
mani run <task> --all

# Execute a task in parallel with a maximum of 8 concurrent processes
mani run <task> --projects <project> --parallel --forks 8

# Execute task for a specific projects
mani run <task> --projects <project>

# Execute a task for projects with specific tags
mani run <task> --tags <tag>

# Execute a task for projects matching specific paths
mani run <task> --paths <path>

# Execute a task for all projects matching a tag expression
mani run <task> --tags-expr 'active || git' <tag>

# Execute a task with environment variables from shell
mani run <task> key=value

Options​

-a, --all select all projects
-k, --cwd select current working directory
--describe display task information
--dry-run display the task without execution
-e, --edit edit task
-f, --forks uint32 maximum number of concurrent processes (default 4)
-h, --help help for run
--ignore-errors continue execution despite errors
--ignore-non-existing skip non-existing projects
--omit-empty-columns hide empty columns in table output
--omit-empty-rows hide empty rows in table output
-o, --output string set output format [stream|table|markdown|html|json|jsonl|yaml]
--parallel execute tasks in parallel across projects
-d, --paths strings select projects by path
-p, --projects strings select projects by name
-s, --silent hide progress output during task execution
-J, --spec string set spec
-t, --tags strings select projects by tag
-E, --tags-expr string select projects by tags expression
-T, --target string select projects by target name
--theme string set theme
--tty replace current process

exec​

Execute arbitrary commands

Synopsis​

Execute arbitrary commands. Use single quotes around your command to prevent file globbing and environment variable expansion from occurring before the command is executed in each directory.

exec <command> [flags]

Examples​

# List files in all projects
mani exec --all ls

# List git files with markdown suffix in all projects
mani exec --all 'git ls-files | grep -e ".md"'

Options​

-a, --all target all projects
-k, --cwd use current working directory
--dry-run print commands without executing them
-f, --forks uint32 maximum number of concurrent processes (default 4)
-h, --help help for exec
--ignore-errors ignore errors
--ignore-non-existing ignore non-existing projects
--omit-empty-columns omit empty columns in table output
--omit-empty-rows omit empty rows in table output
-o, --output string set output format [stream|table|markdown|html|json|jsonl|yaml]
--parallel run tasks in parallel across projects
-d, --paths strings select projects by path
-p, --projects strings select projects by name
-s, --silent hide progress when running tasks
-J, --spec string set spec
-t, --tags strings select projects by tag
-E, --tags-expr string select projects by tags expression
-T, --target string target projects by target name
--theme string set theme
--tty replace current process

init​

Initialize a mani repository

Synopsis​

Initialize a mani repository.

Creates a new mani repository by generating a mani.yaml configuration file and a .gitignore file in the current directory.

With --source <provider>/<name>, mani fetches repositories from a remote source and scaffolds mani.yaml from them. The query is persisted in a 'sources:' block so 'mani refresh' can pick up new repos later.

Supported providers:

  • github/<name> auto-detect org or user (requires 'gh')
  • github-org/<name> explicit organization (requires 'gh')
  • github-user/<name> explicit user (requires 'gh')
  • gitea/<name>, forgejo/<name>, codeberg/<name> auto-detect (all Gitea-compatible) (requires 'gt')
  • gitea-org/<name>, forgejo-org/<name>, codeberg-org/<name> (requires 'gt')
  • gitea-user/<name>, forgejo-user/<name>, codeberg-user/<name> (requires 'gt')

'gt' is the Gitea CLI (https://gitea.com/gitea/cli). codeberg/ lists the repositories of codeberg.org, with gt's account there ('gt auth login --host https://codeberg.org'). gitea/ and forgejo/ list those of gt's default instance.

With --source, the repositories that are cloned locally already are not added, unless --auto-discovery is given. Without discovery (with --source, or with --auto-discovery=false), 'auto_discovery: false' is written to mani.yaml, so that 'mani refresh' doesn't add them either. Set it to true to add them, and every repository that is cloned by hand.

A repository whose name or directory is in use is not added, and is listed with what is in its way: nothing is renamed to make it fit. That is a repository of the source whose directory holds something other than a clone of it (a clone of another repository, or a directory of the workspace), or a local repository with the name of another project: of two clones of one name, the first one found keeps it. A project name can't have a quote or a bracket (' " [ ] { }), nor be a name that YAML reads as another value (1.0 is the number 1, True the boolean true, ~ null): a repository with such a name is listed as well. With --auto-discovery, a repository of the source that is cloned in another directory than its own (as with --source-path) is listed too, also when its own directory or its name is in use, with the command that adds it in that directory: added, it would be cloned a second time.

Archived repositories are left out unless --exclude-archived=false is given, and forks are added unless --exclude-forks is given. --exclude-repos leaves repositories out by name, and --exclude-topics by topic. They are all written to the 'exclude:' block of the source, which 'mani refresh' follows, and a clone of a repository that is left out is not added either. Nor is a clone of a repository that is gone upstream, as the listing of the account that is logged in shows: it is listed, with the command that adds it, as a repository that the token of the provider's CLI can't see is missing from the listing as well.

The projects get the URL that the provider's CLI clones with: its git_protocol ('gh config get git_protocol -h github.com', 'gt config get git_protocol'), ssh or https, unless --protocol is given. It is written to the 'protocol:' of the source, so that 'mani refresh' gives new projects the same URLs on every machine.

The projects get tags from their repository: archived, fork, its visibility (public, private, internal) and its topics. --tags-from says which of them, and is written to 'tags_from:' of the source.

The provider's CLI must be installed and authenticated before use. The auto-detect form (github/, gitea/, …) probes the org endpoint first and falls back to the user endpoint; explicit -org/-user forms skip the probe and go directly to the right endpoint.

init [flags]

Examples​

# Initialize with default settings (local auto-discovery)
mani init

# Initialize from a GitHub organization
mani init --source github/my-org

# Initialize from a Codeberg user
mani init --source codeberg/some-user

# Initialize from a GitHub org, placing all repos under a common path
mani init --source github/my-org --source-path my-org

# Initialize from a Gitea org, including archived repos
mani init --source gitea/my-org --exclude-archived=false

# Initialize from a GitHub org, without forks, sandbox repos, and repos with the topic deprecated
mani init --source github/my-org --exclude-forks --exclude-repos 'sandbox-*' --exclude-topics deprecated

# Initialize from a GitHub org with a smaller limit, tagging projects only with their topics
mani init --source github/my-org --limit 50 --tags-from topics

# Initialize from a GitHub org, without tags
mani init --source github/my-org --tags-from=

# Initialize from a Codeberg user, with https URLs
mani init --source codeberg/some-user --protocol https

# Initialize without auto-discovering projects
mani init --auto-discovery=false

# Initialize without updating .gitignore
mani init --sync-gitignore=false

Options​

--auto-discovery discover local Git repositories and add them to mani.yaml (off with --source, unless given) (default true)
--exclude-archived leave out the archived repositories of the source (--exclude-archived=false to add them) (default true)
--exclude-forks leave out the forks of the source
--exclude-repos strings repositories of the source to leave out, by name or glob pattern (comma-separated)
--exclude-topics strings leave out the repositories of the source with one of these topics (comma-separated)
-h, --help help for init
--limit int maximum number of repositories to add from the remote source (excluded ones don't count) (default 1000)
--protocol string the URLs that the projects get: ssh or https (default: the git_protocol of the provider's CLI)
--source string remote source to scaffold projects from (e.g. github/my-org, gitea/foo, codeberg/joe)
--source-path string common path prefix under which the source's projects are placed
-g, --sync-gitignore synchronize .gitignore file (default true)
--tags-from strings the tags that the projects get: archived, fork, visibility and topics (comma-separated, empty for none) (default [archived,fork,visibility,topics])

refresh​

Update mani.yaml with new projects from remote sources and local clones

Synopsis​

Update the 'projects:' mapping in mani.yaml from two places:

  1. Remote sources — re-query each entry in the 'sources:' block and append any new upstream repositories.
  2. Local clones — when auto-discovery is on (the config's 'auto_discovery', true when it is not set, or --auto-discovery), walk the config directory for git repositories that aren't listed yet and append them (the same discovery 'mani init' performs). This is how a repo you 'git clone' into the workspace by hand gets picked up. A 'project_dir' outside the config directory is walked as well, unless it holds the config directory (.., ~): that would take in repositories of other workspaces.

Repositories that are projects in an imported config are listed already, and are not added. New projects are added to the config that is refreshed, with a path relative to its 'project_dir'.

By default, refresh only adds projects. Existing entries are left untouched — any local edits (renames, custom tags, env, etc.) are preserved.

A project whose repository is gone upstream is reported as stale; use --prune to also remove it. The projects that would be removed are listed first, and you are asked to confirm, unless --force is given. Without a terminal to ask on (in a script), the refresh stops with an error, and nothing is written: pass --force. When the removal is declined, the refresh goes on as it does without --prune. A project that a target or a task names is not removed: the refresh stops with an error, also with --dry-run, and nothing is written.

A repository is only known to be gone when its source lists everything there is: the repositories of the account that is logged in to the provider's CLI (github/<you>). An organization, or another user, only lists what that account can see, so a private repository may be missing from the listing and still exist. Such a project is reported as possibly gone, and is never removed: use 'mani project rm' if it is gone.

Only projects of the host and owner of a source are considered, so projects from a different remote (or discovered locally) are never removed. A repository that the source leaves out (archived, a fork, or beyond its limit) still exists and is not stale, and nothing is stale when a source returns no repositories.

Projects are matched on their repository, whichever form the URL has: a project with an https URL is the same as the ssh URL that a source reports. The host of an ssh URL is the one that ssh connects to ('ssh -G'): a clone through a host alias of the ssh config (git@work:acme/api.git) is of the repository on the host of the alias. A repository of a source that belongs in the directory of a project is that project, also when the URLs differ. A repository on disk is a project by its directory: a second clone of a remote, in another directory, is added as a project of its own. The clone of a repository that is gone upstream is not added again: it is listed, with the command that adds it, until the clone is deleted or its name is excluded. A repository that the token of the provider's CLI can't see (a fine-grained token, or GH_TOKEN in CI) is missing from the listing, and is taken for gone as well.

A project has a name and a directory of its own. A new repository whose name or directory is in use is not added, and nothing is renamed to make it fit: it is listed as not added, with what is in its way. That is the case when two sources have a repository of the same name (the first source in the config keeps the name), when a project has the name already, or when the directory holds something other than a clone of it: a clone of another repository, or files that are not a git repository. A project name can't have a quote or a bracket (' " [ ] { }), nor be a name that YAML reads as another value (1.0 is the number 1, True the boolean true, ~ null), so a repository with such a name is not added either. Add such a repository by hand under another name with 'mani project add', or leave it out with the 'exclude:' block of its source. It is listed on every refresh until then. A config with a project of a name that YAML reads as another value, quoted or not, is not refreshed: rename the project.

A new repository of a source that is cloned in another directory than its own (as when the source has a 'path:') is not added either: it would be cloned a second time. It is listed with the 'mani project add' command that adds it in the directory that it is cloned in, also when its own directory or its name is in use.

A source leaves repositories out with its 'exclude:' block: its archived repositories (unless 'archived: false'), its forks ('forks: true'), and repositories by name (or glob pattern) and by topic. What a source leaves out is never added, also not when a clone of it is on disk. A project that is there already is kept.

sources:

  • source: github/my-org exclude: archived: true forks: true repos: [sandbox, legacy-*] topics: [deprecated]

New projects of a source get the URL of its 'protocol:', ssh or https, and without one the URL that the provider's CLI clones with (its git_protocol).

The 'sources:' block is optional: a config from a plain 'mani init' has none, and refresh still picks up local clones. Sources do require the provider CLI to be installed and authenticated:

refresh [flags]

Examples​

# Append new upstream repos and locally-cloned repos to projects:
mani refresh

# Show what would change without writing
mani refresh --dry-run

# Only re-query remote sources, skip local discovery
mani refresh --auto-discovery=false

# Also remove projects whose upstream repo is gone (prompts for confirmation)
mani refresh --prune

# Remove them without prompting
mani refresh --prune --force

Options​

--auto-discovery discover locally-cloned git repositories and add them to mani.yaml (default: the config's auto_discovery, which is true when it is not set)
--dry-run show what would change but do not modify mani.yaml
-f, --force skip the confirmation prompt of --prune
-h, --help help for refresh
--prune remove projects whose upstream repository no longer exists, after confirmation

sync​

Clone repositories and update .gitignore

Synopsis​

Clone repositories and update .gitignore file. For repositories requiring authentication, disable parallel cloning to enter credentials for each repository individually.

sync [flags]

Examples​

# Clone repositories one at a time
mani sync

# Clone repositories in parallel
mani sync --parallel

# Disable updating .gitignore file
mani sync --sync-gitignore=false

# Sync project remotes. This will modify the projects .git state
mani sync --sync-remotes

# Clone repositories even if project sync field is set to false
mani sync --ignore-sync-state

# Display sync status
mani sync --status

Options​

-f, --forks uint32 maximum number of concurrent processes (default 4)
-h, --help help for sync
--ignore-sync-state sync project even if the project's sync field is set to false
-p, --parallel clone projects in parallel
-d, --paths strings clone projects by path
-w, --remove-orphaned-worktrees remove git worktrees not in config
-s, --status display status only
-g, --sync-gitignore sync gitignore (default true)
-r, --sync-remotes update git remote state
-t, --tags strings clone projects by tags
-E, --tags-expr string clone projects by tag expression

edit​

Open up mani config file

Synopsis​

Open up mani config file in $EDITOR.

edit [flags]

Examples​

# Edit current context
mani edit

Options​

-h, --help help for edit

edit project​

Edit mani project

Synopsis​

Edit mani project in $EDITOR.

edit project [project] [flags]

Examples​

# Edit projects
mani edit project

# Edit project <project>
mani edit project <project>

Options​

-h, --help help for project

edit task​

Edit mani task

Synopsis​

Edit mani task in $EDITOR.

edit task [task] [flags]

Examples​

# Edit tasks
mani edit task

# Edit task <task>
mani edit task <task>

Options​

-h, --help help for task

project​

Add or remove projects in mani.yaml

Synopsis​

Add or remove projects in mani.yaml.

Edits are lossless: comments, blank lines, indentation, and any hand-customized fields outside the touched entry are preserved byte-for-byte. The edited file is validated as YAML before it is written, so a failed edit never corrupts the config.

Examples​

# Add a remote project (cloned on next sync)
mani project add my-repo --url git@github.com:org/my-repo.git --tags backend

# Remove a project
mani project rm my-repo

Options​

-h, --help help for project

project add​

Add a project to mani.yaml

Synopsis​

Add a project to mani.yaml.

A repository URL is required — either as the argument or via --url:

  • A git URL (https://…, ssh://…, git@host:org/repo.git, host.tld:org/repo.git) is recorded as the project's url and the project name is derived from the repo (the final path segment, minus ".git"). Override the derived name with --name. An ssh host alias without a dot (work:org/repo) is taken for a name: write it as git@work:org/repo, or pass it with --url.
  • A plain name needs --url to supply the repository.

A project name can't have a quote or a bracket (' " [ ] { }), nor be a name that YAML reads as another value (1.0 is the number 1, True the boolean true, ~ null), and a tag can't have a '.

The project is appended to the 'projects:' mapping and cloned on the next 'mani sync'. Comments and formatting elsewhere in mani.yaml are preserved.

project add <name|url> [flags]

Examples​

# Add from a URL — name is derived (-> "mani")
mani project add https://github.com/alajmo/mani.git

# Add from a URL but choose the name
mani project add https://github.com/alajmo/mani.git --name kaka

# Add by name with an explicit url and tags
mani project add my-repo --url git@github.com:org/my-repo.git --tags backend

# Add a remote, cloned to a custom path with a description
mani project add my-lib --url git@github.com:org/my-lib.git --path ./libs/my-lib --desc "shared lib"

Options​

--desc string project description
-h, --help help for add
--name string project name (defaults to the repo name derived from a URL argument)
--path string local directory path, relative to project_dir (defaults to the project name)
--tags string comma-separated tags
--url string git repository URL (cloned on next sync)

project remove​

Remove a project from mani.yaml

Synopsis​

Remove a project from mani.yaml.

Only the project entry is removed. Comments above it are kept, as is all other formatting. The project's files on disk are NOT deleted. You are prompted for confirmation unless --force is given. Without a terminal to confirm on (in a script, or with input from a pipe), it is an error unless --force is given.

A project that a target or a task names is not removed, as they would name a project that doesn't exist: remove it from them first. One that another config defines as well stays a project, and is removed.

project remove <name> [flags]

Examples​

# Remove a project (prompts for confirmation)
mani project rm my-repo

# Remove without prompting
mani project rm my-repo --force

Options​

-f, --force skip the confirmation prompt
-h, --help help for remove

list projects​

List projects

Synopsis​

List projects.

list projects [projects] [flags]

Examples​

# List all projects
mani list projects

# List projects by name
mani list projects <project>

# List projects by tags
mani list projects --tags <tag>

# List projects by paths
mani list projects --paths <path>

# List projects matching a tag expression
mani list projects --tags-expr '<tag-1> || <tag-2>'

Options​

-a, --all select all projects (default true)
-k, --cwd select current working directory
--headers strings specify columns to display [project, path, relpath, description, url, tag, worktree] (default [project,tag,description])
-h, --help help for projects
-d, --paths strings select projects by paths
-t, --tags strings select projects by tags
-E, --tags-expr string select projects by tags expression
-T, --target string select projects by target name
--tree display output in tree format

Options inherited from parent commands​

-o, --output string set output format [table|markdown|html|json|yaml] (default "table")
--theme string set theme (default "default")

list tags​

List tags

Synopsis​

List tags.

list tags [tags] [flags]

Examples​

# List all tags
mani list tags

Options​

--headers strings specify columns to display [project, tag] (default [tag,project])
-h, --help help for tags

Options inherited from parent commands​

-o, --output string set output format [table|markdown|html|json|yaml] (default "table")
--theme string set theme (default "default")

list tasks​

List tasks

Synopsis​

List tasks.

list tasks [tasks] [flags]

Examples​

# List all tasks
mani list tasks

# List tasks by name
mani list task <task>

Options​

--headers strings specify columns to display [task, description, target, spec] (default [task,description])
-h, --help help for tasks

Options inherited from parent commands​

-o, --output string set output format [table|markdown|html|json|yaml] (default "table")
--theme string set theme (default "default")

describe projects​

Describe projects

Synopsis​

Describe projects.

describe projects [projects] [flags]

Examples​

# Describe all projects
mani describe projects

# Describe projects by name
mani describe projects <project>

# Describe projects by tags
mani describe projects --tags <tag>

# Describe projects by paths
mani describe projects --paths <path>

# Describe projects matching a tag expression
mani run <task> --tags-expr '<tag-1> || <tag-2>'

Options​

-a, --all select all projects (default true)
-k, --cwd select current working directory
-e, --edit edit project
-h, --help help for projects
-d, --paths strings filter projects by paths
-t, --tags strings filter projects by tags
-E, --tags-expr string target projects by tags expression
-T, --target string target projects by target name

Options inherited from parent commands​

--theme string set theme (default "default")

describe tasks​

Describe tasks

Synopsis​

Describe tasks.

describe tasks [tasks] [flags]

Examples​

# Describe all tasks
mani describe tasks

# Describe task <task>
mani describe task <task>

Options​

-e, --edit edit task
-h, --help help for tasks

Options inherited from parent commands​

--theme string set theme (default "default")

tui​

TUI

Synopsis​

Run TUI

tui [flags]

Examples​

# Open tui
mani tui

Options​

-h, --help help for tui
-r, --reload-on-change reload mani on config change
--theme string set theme (default "default")

check​

Validate config

Synopsis​

Validate config.

check [flags]

Examples​

# Validate config
mani check

Options​

-h, --help help for check

gen​

Generate man page

gen

Options​

-d, --dir string directory to save manpage to (default "./")
-h, --help help for gen