Skip to content

Registry Management

Graft keeps a local registry of your servers, allowing you to reference them by a simple name instead of an IP address and SSH key path every time.

Your registry is stored locally in ~/.graft/registry.json.

List all servers currently saved in your local registry.

Terminal window
graft registry ls

Interactively add a new server to your registry. You will be prompted for:

  • Host IP: The address of the remote server.
  • Port: SSH port (default 22).
  • User: SSH username.
  • Key Path: Path to your private SSH key.
  • Registry Name: A friendly name to refer to this server (e.g., prod-us).
Terminal window
graft registry add

Remove a server from your registry by its name. You will be asked to confirm.

Terminal window
graft registry del my-server

If the server you delete was the default registry, the default is cleared at the same time, so it can never point at a registry that no longer exists.

When you use a registry name in any Graft command (e.g., via the -r flag), Graft automatically retrieves the correct SSH credentials to target that specific remote server from your registry. This is essential for operations that aren’t tied to a specific local project directory.


Typing -r <name> every time gets repetitive when you mostly work against one server. Marking a registry as the default lets you drop the flag for work outside a project directory.

Mark a registry as the default.

Terminal window
graft -default vps
✅ Default registry set to 'vps' (root@31.97.114.213)
Commands run outside a project directory will target this server.

Report the current default. graft registry ls also marks the default row with *.

Terminal window
graft -default

When a command has no -r, no -p, and no project in the current directory, Graft runs exactly what graft -r <default> <command> would have run:

Terminal window
cd ~/scratch # no .graft here
graft ps # same as: graft -r vps ps
graft -sh "uptime" # same as: graft -r vps -sh "uptime"
graft stats # same as: graft -r vps stats

Graft says so when it does this, so you always know which server a command landed on:

🌐 No project here - using default registry 'vps'
🚀 Executing on 'vps': sudo docker ps

Explicit scoping also wins: -r and -p both take precedence, so the default applies only when nothing else has scoped the command.

init, pub, projects and registry already work without a project, so they are never redirected — graft init stays graft init wherever you run it.

Commands that genuinely need a project, such as sync and map, are handed to the default registry like anything else, which means they fail there exactly as graft -r <name> sync would. Use -p <project> when you mean to act on a project from outside its directory.


Inspect what projects are running on a specific host without being in their local directories.

Terminal window
graft -r prod-us projects ls

If you are on a new machine, you can “pull” an existing project from a remote server to set up your local development environment instantly.

Terminal window
graft -r prod-us pull my-awesome-project

Execute terminal commands directly on a server in your registry.

Terminal window
graft -r prod-us -sh "uptime"

Directly execute sudo docker commands on your remote registry. Graft acts as a wrapper, passing your command arguments straight to the Docker CLI on the remote server.

Terminal window
graft -r <registryname> <command>

Examples:

Terminal window
# List containers
graft -r vps ps
# View docker stats
graft -r vps stats
# Stop a container (subshell example)
graft -r vps stop $(docker ps -q)