A project is a code repository on your disk: the nearest folder holding
.git, .fslckout or .zit-checkout. Suit finds projects by scanning the
folders you name, and matches each one to config by its remote address.
The key
A project's key is its remote address reduced to host and path: lower-case
host, no scheme, no user or password, no port, no trailing .git or /.
| Remote address | Key |
|---|---|
https://github.com/Owner/Name.git |
github.com/Owner/Name |
[email protected]:Owner/Name.git |
github.com/Owner/Name |
ssh://[email protected]/Owner/Name |
github.com/Owner/Name |
https://User:[email protected]:8443/x/y.git/ |
example.com/x/y |
https://zeitforge.app/r/dmestas/suit |
zeitforge.app/r/dmestas/suit |
The key is what a [wear personal KEY] or [wear shared KEY] section in
suit.conf names, so config follows a project wherever it is cloned. A
user name or password in a remote address never reaches suit's files or
output.
Commands
| Command | What it does |
|---|---|
suit roots |
Print the folders suit looks in |
suit roots add FOLDER |
Add one. FOLDER is an absolute path. |
suit roots rm FOLDER |
Remove one |
suit projects scan |
Walk the roots and rewrite the list of projects |
suit projects |
Print the list: one line per project folder, KEY FOLDER KIND |
suit project set FOLDER KEY |
Give a project a key by hand |
suit project unset FOLDER |
Take a hand-set key away |
A project with no key is listed with - in the key column. A key set by
hand is applied by the next scan and kept across scans.
The scan
- It walks each root to a depth of four folders.
- It does not follow symbolic links.
- It does not look inside a project for more projects, except to find a git project's linked worktrees.
- A folder it cannot read is skipped with a note.
- It runs no other program. Everything is read from the project's own files.
What each kind supports
| Kind | Marker | Where the remote is read from | Worktrees |
|---|---|---|---|
| git | .git |
url under [remote "origin"] in .git/config, or the first remote when there is no origin |
Each linked worktree is listed with its project's key |
| Fossil | .fslckout |
The checkout database names the repository file, and that file's last-sync-url setting holds the remote |
Not applicable |
| zit | .zit-checkout |
Not read. A zit project has no key until you set one with suit project set. |
Not found |
A linked git worktree has a .git file where a project has a .git folder.
Suit follows it to the main repository's config, so a worktree made by an
agent gets the same key, and later the same personal links, as the project
it belongs to.
Files
All three sit in suit's home folder, are read strictly (a malformed line is an error that names the file and the line) and are rewritten by writing a new file beside the old one and renaming it.
| File | Holds | Written by |
|---|---|---|
roots |
One absolute folder per line | suit roots add, suit roots rm |
projects |
One line per project folder: key, folder, kind | suit projects scan |
projects.set |
Keys set by hand: folder and key | suit project set, suit project unset |