Show a project's dev card
$ grim server:dev:info shop
Three weeks after a project went onto the box, somebody asks what the Mailpit address was, or what the database password is. The summary grim server:dev:add-project printed is long gone from the terminal. grim server:dev:info prints it again, and adds what the containers are doing right now.
Usage
$ grim server:dev:info shop # the card for one projectRun it from anywhere. It reads the project's dev environment from your ~/.grim/servers.json, so it works on the machine that ran grim server:dev:add-project and nowhere else.
Arguments and options
Print URLs, SSH command, DB credentials and container status for a dev project
Usage
grim server:dev:info <project>Arguments
| Argument | Description |
|---|---|
project |
Project name (required) |
What it actually does
- Reads the registration. Host, domains, path and database credentials come from
servers.json, as they were saved when the project was added. Nothing is asked of the server for this part. - Asks the box for container states. It connects as
devand runsdocker compose psin the project directory. When that fails for any reason, the card is printed without those rows and without an error. - Prints the card. The app URL, the Vite and Mailpit hosts, the
sshandcode --remotecommands, the project path, an SSH tunnel command for the database with the name, user and password to use through it, and one row per service with its state.
Pitfalls
No container rows is a finding, not a glitch
The rows are dropped silently when the box cannot be reached as dev, when the project directory is gone, or when the stack was never started. If the card ends at the database password, check ssh dev@<host> first.
The card shows what was saved, not what is
The database values are a copy made when the project was added. Someone editing .env on the box does not change your card, and neither does a project name with a dash, which .env stores with an underscore. When the card and the app disagree, .env in the project directory on the box is right.
It only knows projects you added
No dev environment registered for project "shop". Run grim server:dev:add-project first. on a colleague's machine does not mean the project is missing from the box. The registration lives with whoever added it. Send them the card.
The card prints the database password in plain text. It is a dev database, but think before pasting the whole card into a public channel.
After it finishes
Nothing has changed anywhere. To act on what the card showed, grim server:dev:reload recreates a stack that is not picking up its .env, and grim server:dev:remove takes the project off the box.
Related spells
grim server:dev:add-project
Settle a project on the box
Clone a repository onto a shared dev box, give it a dev .env and domains, and start its stack there.
grim server:dev:reload
Recreate a dev stack
Recreate the containers of a project on a dev box from your own machine, so a changed .env or grim.json takes effect.
grim server:dev:ssh-config
Write the SSH block
Print a ready ~/.ssh/config block for a dev box, so ssh and VS Code Remote-SSH reach it under one short name.
grim server:dev:remove
Take a project off the box
Stop a project's stack on a dev box and delete its volumes, its directory and its registration, keeping what you ask to keep.